The Congress API
With the Congress API, you can get summaries of roll-call votes in the U.S. Congress; get lists of members of Congress; and get vote data, floor appearances, biographical information and role data for individual House and Senate members. You can also get information about bills (summaries and bill actions), nominees, committees and schedules.
For information about changes in the current version, see Introducing Version 3 of the Congress API and the summary of changes on this page. For a general overview and background, see Introducing the Congress API.
Note: In this document, curly braces { } indicate required items. Square brackets [ ] indicate optional items or placeholders.
The Congress API at a Glance | |
---|---|
Base URI | api.nytimes.com/svc/politics/{version}/us/legislative/congress |
Scope | House of Representatives votes and members: 102nd Congress (1991–1993) to present House of Representatives member roles: 98th Congress (1983–1985) to present Senate votes: 101st Congress (1989–1991) to present Senate members and member roles: 80th Congress (1947–1949) to present Floor appearances: 111th Congress (2009–2010) to present (earlier data will be added) Bills: 105th Congress (1997–1999) to present Nominees: 107th Congress (2001–2002) to present Additional scope notes are included with the descriptions of the various request types. |
HTTP method | GET |
Response formats | XML (.xml , default), JSON (.json ) |
Quick links | Requests | Responses | Examples | Errors | Change Log |
To use the Congress API, you must sign up for an API key. Usage is limited to 5000 requests per day (rate limits are subject to change). Please read and agree to the API Terms of Use, the Supplemental Terms of Use and the Attribution Guidelines before you proceed.
For more information about the data returned by the Congress API, see Congressional Data.
Requests
The Congress service uses a RESTful style. The available request types fall into five categories: members, votes, bills, nominees and other.
Members | Votes |
---|---|
Member Lists Member Bio and Roles New Members Current Members by State/District Members Leaving Office Member Vote Positions Member Vote Comparison Bills Cosponsored by a Member Member Sponsorship Comparison Member Floor Appearances |
Roll-Call Votes Votes by Type Votes by Date Senate Nomination Votes |
Bills | Nominees | Other |
---|---|---|
Recent Bills Bills by Member Bill Details Bill Subjects/Amendments and Related Bills Bill Cosponsors |
Nominee Lists Nominee Details Nominees by State |
State Party Counts Committees and Rosters Chamber Schedule |
For general tips on creating a request URI, see Constructing a Request. For details about the data that is returned by each request type, see Responses.
Common Parameters
These parameters are used in all request types. See below for URI structures and additional parameters for each type of request.
Name and Description | Required? | Value and Notes |
---|---|---|
version The API version |
Yes | v3 (in URI path) The current version is v3 . Version 2 is no longer supported. (Version 1 is for internal use only.) |
api-key Your registered API key |
Yes | Alphanumeric (in query string) For more information, see Requesting a Key. |
response-format Sets the representation data format |
No | .xml | .json (extension) To return JSON, add the appropriate extension to your request URI. XML is the default format; you do not need to add the .xml extension to get an XML response. |
Members
Jump to:
Member Lists | Member Bio and Roles | New Members | Current Members by State/District | Members Leaving Office |
Member Vote Positions | Member Vote Comparison |
Bills Cosponsored by a Member | Member Sponsorship Comparison |
Member Floor Appearances
Member Lists
To get a list of members of a particular chamber in a particular Congress, use the following URI structure:
api.nytimes.com/svc/politics/{version}/us/legislative/congress/{congress-number}/{chamber}/members[.response-format]?[optional-params]&api-key={your-API-key}
To get a list of members of a particular chamber currently serving in a particular Congress, use the following URI structure, which takes no optional parameters:
api.nytimes.com/svc/politics/{version}/us/legislative/congress/{congress-number}/{chamber}/members/current[.response-format]?api-key={your-API-key}
Required Parameters
With the exception of api-key
, these parameters are specified in the URI path. Add your api-key
as a name-value pair in a query string.
Name and Description | Value and Notes |
---|---|
version |
See Common Parameters. |
congress-number The number of the Congress during which the members served |
House of Representatives: 102–113 Senate: 80–113 For a table of years and session numbers, see the official site of the U.S. Senate. |
chamber |
house | senate |
api-key |
See Common Parameters. |
Optional Parameters
Name and Description | Value and Notes |
---|---|
state Limits the list of members by state |
Two-letter state code (e.g., CA ) |
district Limits the list of members by district (House only) |
House of Representatives district number If you specify a district , you must also specify a state . If the district number you specify is higher than the total number of districts for that state , a 404 response will be returned.Note: Member list responses include district numbers. |
response-format |
See Common Parameters. |
Next Steps:
Responses | Data Returned | Examples | Top of this section | Full list of requests
Member Bio and Roles
To get biographical and Congressional role information for a particular member of Congress, use the following URI structure:
api.nytimes.com/svc/politics/{version}/us/legislative/congress/members/{member-id}[.response-format]?api-key={your-API-key}
For a summary of role data, see Congressional Data.
Required Parameters
With the exception of api-key
, these parameters are specified in the URI path. Add your api-key
as a name-value pair in a query string.
Name and Description | Value and Notes |
---|---|
version |
See Common Parameters. |
member-id The member's unique ID number |
Alphanumeric To find a member's ID number, get the list of members for the appropriate House or Senate. You can also use the Biographical Directory of the United States Congress to get a member's ID. In search results, each member's name is linked to a record by index ID (e.g., bioguide.congress.gov/scripts/biodisplay.pl?index=C001041). Use the index ID as member-id in your request. |
api-key |
See Common Parameters. |
Optional Parameters
To specify a response-format
, add the appropriate extension to the path. For details, see Common Parameters.
Next Steps:
Responses | Data Returned | Examples | Top of this section | Full list of requests
New Members
To get a list of the most recent new members of the current Congress, use the following URI structure:
api.nytimes.com/svc/politics/{version}/us/legislative/congress/members/new[.response-format]?api-key={your-API-key}
Required Parameters
Specify the version
in the URI path. Add your api-key
as a name-value pair in a query string. For details, see Common Parameters.
Optional Parameters
To specify a response-format
, add the appropriate extension to the path. For details, see Common Parameters.
Next Steps:
Responses | Data Returned | Examples | Top of this section | Full list of requests
Current Members by State/District
To get the current members of Congress for a particular chamber, state and (for House requests) district, use the following URI structure:
api.nytimes.com/svc/politics/{version}/us/legislative/congress/members/{chamber}/{state}/{district*}/current[.response-format]?api-key={your-API-key}
*The district
parameter is required only when the chamber
parameter is set to house
.
Required Parameters
With the exception of api-key
, these parameters are specified in the URI path. Add your api-key
as a name-value pair in a query string.
Name and Description | Value and Notes |
---|---|
version |
See Common Parameters. |
chamber |
house | senate When chamber=senate , this request returns both current senators, if available. When chamber=house , this request returns the current occupant of the district seat. |
state |
Two-letter state abbreviation |
district (House requests only) |
House of Representatives district number Specify the district number; for "at large" districts (Alaska, Delaware, Montana, North Dakota, South Dakota, Vermont and Wyoming), specify the number 1 .The district parameter is required for House requests. If you specify a district in a Senate request, it will be ignored. |
api-key |
See Common Parameters. |
Optional Parameters
To specify a response-format
, add the appropriate extension to the path. For details, see Common Parameters.
Next Steps:
Responses | Data Returned | Examples | Top of this section | Full list of requests
Members Leaving Office
To get a list of members who have left the Senate or House or have announced plans to do so, use the following URI structure:
api.nytimes.com/svc/politics/{version}/us/legislative/congress/{congress-number}/{chamber}/members/leaving[.response-format]?api-key={your-API-key}
Required Parameters
With the exception of api-key
, these parameters are specified in the URI path. Add your api-key
as a name-value pair in a query string.
Name and Description | Value and Notes |
---|---|
version |
See Common Parameters. |
congress-number The number of the Congress during which the members served |
111 | 112 | 113 IData for previous Congresses will be added soon. |
chamber |
house | senate |
api-key |
See Common Parameters. |
Optional Parameters
To specify a response-format
, add the appropriate extension to the path. For details, see Common Parameters.
Next Steps:
Responses | Data Returned | Examples | Top of this section | Full list of requests
Member Vote Positions
To get the most recent vote positions for a specific member of the House of Representatives or Senate, use the following URI structure:
api.nytimes.com/svc/politics/{version}/us/legislative/congress/members/{member-id}/votes[.response-format]?api-key={your-API-key}
Note: Member positions are also included in roll-call vote responses (for that particular vote).
Required Parameters
With the exception of api-key
, these parameters are specified in the URI path. Add your api-key
as a name-value pair in a query string.
Name and Description | Value and Notes |
---|---|
version |
See Common Parameters. |
member-id The member's unique ID number |
Alphanumeric To find a member's ID number, get the list of members for the appropriate House or Senate. You can also use the Biographical Directory of the United States Congress to get a member's ID. In search results, each member's name is linked to a record by index ID (e.g., bioguide.congress.gov/scripts/biodisplay.pl?index=C001041). Use the index ID as member-id in your request. |
api-key |
See Common Parameters. |
Optional Parameters
To specify a response-format
, add the appropriate extension to the path. For details, see Common Parameters.
Next Steps:
Responses | Data Returned | Examples | Top of this section | Full list of requests
Member Vote Comparison
Use this request type to compare two members' vote positions in a particular Congress and chamber. Responses include four calculated values, showing the number and percentage of votes in which the members took the same position or opposing positions. (See Data Returned for details.)
To compare two members' vote positions, use the following URI structure:
api.nytimes.com/svc/politics/{version}/us/legislative/congress/members/{first-member-id}/votes/{second-member-id}/{congress-number}/{chamber}[.response-format]?api-key={your-API-key}
Required Parameters
With the exception of api-key
, these parameters are specified in the URI path. Add your api-key
as a name-value pair in a query string.
Name and Description | Value and Notes |
---|---|
version |
See Common Parameters. |
first-member-id second-member-id The ID numbers of the members you want to compare |
Alphanumeric To find a member's ID number, get the list of members for the appropriate House or Senate. You can also use the Biographical Directory of the United States Congress to get a member's ID. In search results, each member's name is linked to a record by index ID (e.g., bioguide.congress.gov/scripts/biodisplay.pl?index=C001041). Use the index ID as member-id in your request. |
congress-number The number of the Congress in which the members served |
Senate: 101–113 House: 102–113 For a table of years and session numbers, see the official site of the U.S. Senate. If the two members did not serve together in the Congress and chamber you specify, an error will be returned. |
chamber The chamber in which the members served |
house | senate If the two members did not serve together in the Congress and chamber you specify, an error will be returned. |
api-key |
See Common Parameters. |
Optional Parameters
To specify a response-format
, add the appropriate extension to the path. For details, see Common Parameters.
Next Steps:
Responses | Data Returned | Examples | Top of this section | Full list of requests
Bills Cosponsored by a Member
To get bill cosponsorship data for a particular member, use the following URI structure:
api.nytimes.com/svc/politics/{version}/us/legislative/congress/members/{member-id}/bills/{type}[.response-format]?api-key={your-API-key}
Required Parameters
With the exception of api-key
, these parameters are specified in the URI path. Add your api-key
as a name-value pair in a query string.
Name and Description | Value and Notes |
---|---|
version |
See Common Parameters. |
member-id The member's unique ID number |
Alphanumeric To find a member's ID number, get the list of members for the appropriate House or Senate. You can also use the Biographical Directory of the United States Congress to get a member's ID. In search results, each member's name is linked to a record by index ID (e.g., bioguide.congress.gov/scripts/biodisplay.pl?index=C001041). Use the index ID as member-id in your request. |
type |
cosponsored | withdrawn cosponsored : the 20 bills most recently cosponsored by member-id .withdrawn : the 20 most recently withdrawn cosponsorships for member-id . |
api-key |
See Common Parameters. |
Optional Parameters
To specify a response-format
, add the appropriate extension to the path. For details, see Common Parameters.
Next Steps:
Responses | Examples | Top of this section | Full list of requests
Member Sponsorship Comparison
To compare bill sponsorship between two members who served in the same Congress and chamber, use the following URI structure:
api.nytimes.com/svc/politics/{version}/us/legislative/congress/members/{member-id-1}/bills/{member-id-2}/{congress-number}/{chamber}[.response-format]?api-key={your-API-key}
Required Parameters
With the exception of api-key
, these parameters are specified in the URI path. Add your api-key
as a name-value pair in a query string.
Name and Description | Value and Notes |
---|---|
version |
See Common Parameters. |
member-id-1 and member-id-2 The unique ID numbers of the members you want to compare |
Alphanumeric To find a member's ID number, get the list of members for the appropriate House or Senate. You can also use the Biographic |