sunlight.congress

The Sunlight Congress API provides methods for obtaining information for the people and work of Congress. Information on legislators, districts, committees, bills, votes, as well as real-time notice of hearings, floor activity and upcoming bills.

class sunlight.services.congress.Congress(use_https=True)[source]

Bindings to the Congress API. Keep in mind this is a thin wrapper around the API so the API documentation is the place to look for help on field names and examples.

By default, the API runs over https. You can set congress.use_https = False or congress = Congress(use_https=False) to use regular http.

Class methods that do not specify positional arguments accept filtering, pagination, and sorting parameters as keyword arguments. See each method’s API page for specfic filtering arguments.

Legislators

This set of method provides various ways to search or look up federal legislators. For detailed documentaion on the return value of these methods see legislator fields.

Congress.legislators(**kwargs)[source]

Search and filter for members of Congress.

For details see Legislators API docs <http://sunlightlabs.github.io/congress/legislators.html>

Congress.legislator(identifier, id_type='bioguide', **kwargs)[source]

Retrieve a member of Congress by a unique identifier. Defaults to bioguide. Choices are:

  • bioguide
  • ocd
  • thomas
  • lis
  • govtrack
  • votesmart
  • crp
  • fec

For details see Legislators API docs <http://sunlightlabs.github.io/congress/legislators.html>

Congress.all_legislators_in_office(**kwargs)[source]

Returns all legislators currently in office (non-paginated response).

For details see Legislators API docs

Congress.locate_legislators_by_lat_lon(lat, lon, **kwargs)[source]

Find members of Congress by a latitude and longitude.

For details see Legislators API docs

Congress.locate_legislators_by_zip(zipcode, **kwargs)[source]

Find members of Congress by zip code.

For details see Legislators API docs

Bills

This set of method provides various ways to search or look up Congressional bills. For detailed documentaion on the return value of these methods see bill fields.

Congress.bills(**kwargs)[source]

Search and filter through bills in Congress.

For details see Bills API docs

Congress.bill(bill_id, **kwargs)[source]

Retrieve a bill by bill_id.

For details see Bills API docs

Congress.search_bills(query, **kwargs)[source]

Search the full text of legislation, and other fields.

For details see Bill search API docs

Congress.upcoming_bills(**kwargs)[source]

Search and filter through upcoming bills in the House and Senate.

This will return bills that have been scheduled by party leadership for upcoming House and Senate floor action.

For details see Upcoming Bills API docs

Districts

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

Congress.locate_districts_by_lat_lon(lat, lon, **kwargs)[source]

Find congressional districts by a latitude and longitude.

For details see Districts API docs

Congress.locate_districts_by_zip(zipcode, **kwargs)[source]

Find congressional districts by a latitude and longitude.

For details see Districts API docs

Committees

The following methods search legislative committees. For detailed documentaion on the return value of these methods see committee fields.

Congress.committees(**kwargs)[source]

Search and filter through committees in the House and Senate.

For details see Committees API docs

Amendments

The following methods search amendments. For detailed documentaion on the return value of these methods see committee fields.

Congress.amendments(**kwargs)[source]

Search and filter through amendments in Congress.

For details see Amendments API docs

Votes

The following methods search votes. For detailed documentaion on the return value of these methods see vote fields.

Congress.votes(**kwargs)[source]

Search and filter through votes in Congress.

For details see Votes API docs

Floor Updates

The following methods search floor updates. For detailed documentaion on the return value of these methods see floor update fields.

Congress.floor_updates(**kwargs)[source]

Search and filter through floor updates in the House and Senate.

For details see Floor Updates API docs

Hearings

The following methods search committee hearings. For detailed documentaion on the return value of these methods see hearing fields.

Congress.hearings(**kwargs)[source]

Search and filter through committee hearings in the House and Senate.

For details see Hearings API docs

Nominations

The following methods search nominations made by the President of the United States. For detailed documentaion on the return value of these methods see nominations fields.

Congress.nominations(**kwargs)[source]

Search and filter through presidential nominations in Congress.

For details see Nominations API docs

Congressional Documents

The following methods search congressional documents including House witness documents and House committee reports. For detailed documentaion on the return value of these methods see congressional documents fields.

Congress.congressional_documents(**kwargs)[source]

Search congressional documents including House witness documents and House committee reports.

For details see Congressional documents API docs

Documents

The following methods search a wide range of documents including Government Accountability Office (GAO) Reports and Inspector General Reports. These government oversight documents investigate misconduct, waste and programs. For detailed documentaion on the return value of these methods see documents fields.

Congress.documents(**kwargs)[source]

Search oversight documents including Government Accountability Office reports and Inspectors General reports.

For details see Documents API docs