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.
This set of Congress API methods deal with federal legislators. For detailed documentaion on the return value of these methods see legislator fields.
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
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
Query for all legislators representing an given location.
See documentation at legislators.allForLatLong
Pair of methods for retrieving districts. District dictionaries have a ‘state’ and ‘number’ key (ex. {‘state’: ‘NC’, ‘number’: ‘3’})
Query for all congressional districts overlapping a zip code.
See documentation at districts.getDistrictFromLatLong
Query for all congressional districts containing a given location.
See documentation at districts.getDistrictFromLatLong
Methods for dealing with committees.
Query for all committees for a chamber. (House|Senate|Joint)
See documentation at committees.getList
Query for all details for a committee, including members.
See documentation at committees.get
Query for all details for all of a legislator’s committee assignments.
See documentation at committees.allForLegislator