sunlight.congress

The Sunlight Labs Congress API provides methods for obtaining basic information on Members of Congress, legislator IDs used by various websites, and geographical lookups between places and the politicians that represent them. The primary purpose of the API is to facilitate mashups involving politicians and the various other APIs that are out there.

Legislators

This set of Congress API methods deal with federal legislators. For detailed documentaion on the return value of these methods see legislator fields.

congress.legislators(**kwargs)[source]

Query for all legislators matching certain criteria.

See documentation at legislators.get(List)

Fuzzy-matching name search against federal legislators.

See documentation at legislators.search

congress.legislators_for_zip(zipcode)[source]

Query for all legislators representing a given ZIP code.

This method is not recommended, prefer legislators_for_lat_lon instead. See the blog post “Don’t Use Zip Codes Unless You Have To”.

See documentation at legislators.allForZip

congress.legislators_for_lat_lon(latitude, longitude)[source]

Query for all legislators representing an given location.

See documentation at legislators.allForLatLong

Districts

Pair of methods for retrieving districts. District dictionaries have a ‘state’ and ‘number’ key (ex. {‘state’: ‘NC’, ‘number’: ‘3’})

congress.districts_for_zip(zipcode)[source]

Query for all congressional districts overlapping a zip code.

See documentation at districts.getDistrictFromLatLong

congress.districts_for_lat_lon(latitude, longitude)[source]

Query for all congressional districts containing a given location.

See documentation at districts.getDistrictFromLatLong

Committees

Methods for dealing with committees.

congress.committees(chamber)[source]

Query for all committees for a chamber. (House|Senate|Joint)

See documentation at committees.getList

congress.committee_detail(id)[source]

Query for all details for a committee, including members.

See documentation at committees.get

congress.committees_for_legislator(bioguide_id)[source]

Query for all details for all of a legislator’s committee assignments.

See documentation at committees.allForLegislator

Table Of Contents

Previous topic

python-sunlight

Next topic

sunlight.openstates

This Page