Skip to content

Instantly share code, notes, and snippets.

@acoffman
Last active February 13, 2019 21:32
Show Gist options
  • Save acoffman/5899dcd565878afcd1b3a83a50381ceb to your computer and use it in GitHub Desktop.
Save acoffman/5899dcd565878afcd1b3a83a50381ceb to your computer and use it in GitHub Desktop.
Get All CIViC Variants
import requests
next_url = 'https://civicdb.org/api/variants?count=100'
variants = []
while next_url:
response = requests.get(nextUrl)
body = response.json()
variants += body['records']
next_url = body['_meta']['links']['next']
print('Retrieved {}, the last of which is named {}.'.format(len(variants), variants[-1]['name']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment