sufyan faizi
sufyan faizi

Reputation: 31

Is there any solution for fetching metadata of Crossref using DOIs (Rest API calls)

I am retrieving metadata of Crossref using crossref rest API

I have CSV file of DOIs from which I fetch DOI using python and make API call for each DOI to retrieve metadata from Crossref. I have to fetch metadata for many DOIs but after retrieving some metadata it gives connection error

import requests  

response = requests.get("https://api.crossref.org/v1/works/http://dx.doi.org/" + CitedDOI[X])

This is connection error

HTTPSConnectionPool(host='api.crossref.org', port=443): Max retries exceeded with url: /v1/works/http://dx.doi.org/10.1080/10426910802104344 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0000019510E068D0>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

Upvotes: 3

Views: 1729

Answers (1)

AdEd12
AdEd12

Reputation: 63

Try

import requests
import json

response = requests.get("https://api.crossref.org/works/YOUR_DOI")

print(response.json())

I also recommend looking at the CrossRef API documentation. The rules change every now and then, but right now you can get faster speeds by

  • Including your email address in a header
  • Requesting multiple DOIs in a single call
  • Multithreading requests (limited to 50 requests per-second at the time of writing)

Upvotes: 2

Related Questions