Created
April 10, 2017 09:16
-
-
Save slint/d30fc0f415300876facbbeb8a0989ab2 to your computer and use it in GitHub Desktop.
Zenodo Search Request Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
records_api_url = 'https://zenodo.org/api/records' | |
search_query = 'type:dataset AND creators.affiliation:("University A" OR "Cambridge")' | |
res = requests.get(records_api_url, params={'q': search_query, 'size': 100, 'page': 1}) | |
# <Response [200]> | |
res.json() | |
# { ...JSON response containing search results... } | |
res.links | |
# { 'next': 'https://zenodo.org/api/records?q=...&size=100&page=2', ... } | |
# In `curl`, the equivalent would be something like: | |
# | |
# curl -X GET 'https://sandbox.zenodo.org/api/records' \ | |
# -d 'q=type:dataset AND creators.affiliation:("University A" OR "Cambridge")' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment