Skip to content

Instantly share code, notes, and snippets.

@edsu edsu/

Last active Apr 13, 2019
What would you like to do?
import json
import requests
# get maryland's current house members
key = "your_key_here"
headers = {"X-API-KEY": key}
url = ''
resp = requests.get(url, headers=headers)
members = resp.json()
# for each member look up what legislation they've introduced in this congress
for member in members['results']:
url = '' + member['id'] + '/bills/introduced.json'
resp = requests.get(url, headers=headers)
bills = resp.json()
for bill in bills['results'][0]['bills']:
if bill['congress'] == '116':
print(' - ' + bill['title'], bill['congressdotgov_url'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.