https://pub.orcid.org/v3.0/csv-search/?q=
For example if I wanted to search for Sarah Adams
https://pub.orcid.org/v3.0/csv-search/?q=Sarah Adams
If you paste that in a web browser most browsers will download a text orper json file populated by relevant orcid-id information for Sarah Adams
However I think this approach uses redirection and browser tricks, therefore I cannot naively do the same thing programmatically using python requests. For example the following approach won't work:
In python search for an authors orcid id by their first and last name.
import requests
NAME="Sarah Adams"
url="https://pub.orcid.org/v3.0/csv-search/?q="+str(NAME)
response = requests.get(url)
Also one might use a selenium web driver in which case this approach also wouldn't work:
url="https://pub.orcid.org/v3.0/csv-search/?q="+str(NAME)
driver.get(url)
I wonder if any one has any ideas how to achieve replacing Google Scholar Scraping of author publications with Orcid+crossrefs without necessarily forcing users of an application to sign up for an API access?
Thanks for any advice.
Russell.
Russell Jarvis |
PhD |
phone: 61444576301 |
email: russel...@protonmail.com |
On 7 Feb 2021, at 11:05, Russell Jarvis <coloure...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "ORCID API Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orcid-api-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orcid-api-users/CADAFsyNNvKd6wNNabcn0HawVfN5XLOcJcwDh5Krkh5Jp_%3DjiVw%40mail.gmail.com.
{'date': 'Mon, 15 Feb 2021 11:26:31 GMT', 'content-type': 'application/vnd.orcid+xml; qs=5;charset=UTF-8', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'set-cookie': '__cfduid=ddeb0b300d41910e79e342881e66cf1ca1613388391; expires=Wed, 17-Mar-21 11:26:31 GMT; path=/; domain=.orcid.org; HttpOnly; SameSite=Lax, X-Mapping-fjhppofk=814C785051499CB634650A2359C0B50C; path=/', 'cache-control': 'no-cache, no-store, max-age=0, must-revalidate', 'expires': '0', 'pragma': 'no-cache', 'x-xss-protection': '1; mode=block', 'access-control-allow-origin': '*', 'x-content-type-options': 'nosniff', 'x-frame-options': 'DENY', 'cf-cache-status': 'DYNAMIC', 'cf-request-id': '08470a3ad10000fea517a1c000000001', 'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', 'server': 'cloudflare', 'cf-ray': '621eaca48e85fea5-MEL'}print(response.content)
b'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<error xmlns="http://www.orcid.org/ns/error">\n <response-code>406</response-code>\n <developer-message>400 Bad Request: There is an issue with your data or the API endpoint. 405 Method Not Allowed: Endpoint and method mismatch. 415 Unsupported Media Type: data must be in XML or JSON format.</developer-message>\n <user-message>ORCID could not process the data, because they were invalid.</user-message>\n <error-code>9001</error-code>\n <more-info>https://members.orcid.org/api/resources/troubleshooting</more-info>\n</error>\n'
--
You received this message because you are subscribed to the Google Groups "ORCID API Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orcid-api-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orcid-api-users/ba10d9eb-ce92-433f-a7e9-c88fbf762c29n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orcid-api-users/CADAFsyMY4Xm8WU-KNU2G%3DB4KveRntqC1QtemTUuJ7oywgYgZvw%40mail.gmail.com.
Thanks for that insight Owen.
I think the python code block below is the answer to my long running forum question. One question though. Is it correct to assume first-name, middle initial and family-name are separated by a plus? Ie ?q=first_name+middle_initial+family_name ?
In the code below if the name is Brian+H+Smith it finds the orcid-id For Brian+J+Smith http://orcid.org/0000-0003-0498-1910.
I am getting the sense that this is not so much an orcid problem, but more a problem with optional human participation in the orcid institution. Possibly Brian H Smith has not fully signed up to and participated in orcid.
I think perhaps the list of orcid-id's for Brian Smith are just ranked hierarchically in terms of research prominence/orcid participation etc? The code ```temp['result'][0]``` below takes the top orcid-id from a list.
headers = {
'Accept': 'application/vnd.orcid+json',
}
def name_to_orcid_id(NAME):
orcid_id = None
plus_initial=NAME['name']['first']
initial = plus_initial.split(" ")
if len(initial)==2:
first_name = initial[0]+str("+")+initial[1][0]
else:
first_name = plus_initial
name = first_name+str("+")+NAME['name']['last']
params = (
('q',name),
)
response = requests.get('https://pub.orcid.org/v3.0/search/', headers=headers, params=params)
temp = response.json()
if len(temp):
orcid_id = temp['result'][0]['orcid-identifier']['path']
return orcid_id
https://pub.orcid.org/v3.0/expanded-search/
You'll get back a basic record that might save you an extra fetch