Skip to content

Instantly share code, notes, and snippets.

@slint
Created April 10, 2017 09:16
Show Gist options
  • Save slint/d30fc0f415300876facbbeb8a0989ab2 to your computer and use it in GitHub Desktop.
Save slint/d30fc0f415300876facbbeb8a0989ab2 to your computer and use it in GitHub Desktop.
Zenodo Search Request Example
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