Skip to main content

A Python client for the Center for Responsive Politics API at

Project description

A Python client for the Center for Responsive Politics API <> at

Access campaign contribution and personal financial data for US congressional members.

You will need a Center for Responsive Politics API key <>.


From PyPI:

pip install opensecrets-crpapi

Or, download and use the install script:

git clone && cd opensecrets-crpapi
python install


All API functions are abstracted to corresponding client methods, and accept the respective parameters. Results are returned in JSON format, and pre-parsed to trim the fat. For example:

>>> from crpapi import CRP
>>> crp = CRP(API_KEY)

# get a specific legislator by CID
>>> cand = crp.candidates.get('N00007360')
>>> cand['lastname']

# get the top contributors to a candidate for a specific cycle
>>> contribs = crp.candidates.contrib('N00007360', '2016')
>>> contribs[0]['@attributes']['org_name']

# get fundraising information for a committee's members, by industry
>>> cmte = crp.committees.cmte_by_ind('HARM', 'F10')
>>> cmte[0]['@attributes']['member_name']
'Heck, Joe'

# use fetch to access the endpoints more directly, without pre-parsed results
>>> summ = crp.fetch('candSummary', cid='N00007360')
>>> summ['summary']['@attributes']['first_elected']

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for opensecrets-crpapi, version 0.2.2
Filename, size File type Python version Upload date Hashes
Filename, size opensecrets_crpapi-0.2.2-py2.py3-none-any.whl (5.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size opensecrets-crpapi-0.2.2.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page