Sunlight Congress API
Base URI
All requests to the Congress API require a Sunlight API key. An API key is free to register and has no usage limits.
API keys can be provided with a request through the query string:
/legislators?apikey=[your_api_key]
Or, by setting the key as the value of an X-APIKEY
HTTP request header.
You can request specific fields by supplying a comma-separated list of fields as the fields
parameter.
Many fields are not returned unless requested. If you don’t supply a fields
parameter, you will get the most commonly used subset of fields only.
To save on bandwidth, parsing time, and confusion, it’s recommended to always specify which fields you will be using.
Provide a query
parameter to return results the API thinks best match your query. Queries are interpreted as phrases.
Senate hearings matching "environment"
/hearings?query=environment&chamber=senate
House floor updates matching "committee of the whole"
/floor_updates?query=committee+of+the+whole&chamber=house
A live JSON API for the people and work of Congress, provided by the Sunlight Foundation.
- Look up members of Congress by location or by zip code.
- Official Twitter, YouTube, and Facebook accounts.
- The daily work of Congress: bills, amendments, nominations.
- The live activity of Congress: past and future votes, floor activity, hearings.
All requests require a Sunlight API key. An API key is free, and has no limits or use restrictions.
We have an API mailing list, and can be found on Twitter at @sunlightlabs. Report bugs and request features on Github Issues.
Encryption (https://
) is used by default, and strongly recommended.
API Key
All requests to the Congress API require a Sunlight API key. An API key is free to register and has no usage limits.
API keys can be provided with a request through the query string:
/legislators?apikey=[your_api_key]
Or, by setting the key as the value of an X-APIKEY
HTTP request header.
Partial responses
You can request specific fields by supplying a comma-separated list of fields as the fields
parameter.
Many fields are not returned unless requested. If you don’t supply a fields
parameter, you will get the most commonly used subset of fields only.
To save on bandwidth, parsing time, and confusion, it’s recommended to always specify which fields you will be using.
Latest vote numbers and their results
/votes?fields=roll_id,result,breakdown.total
{
"results": [
{
"breakdown": {
"total": {
"Yea": 222,
"Nay": 190,
"Not Voting": 19,
"Present": 0
}
},
"result": "Passed",
"roll_id": "h43-2013"
},
{
"breakdown": {
"total": {
"Yea": 261,
"Nay": 154,
"Not Voting": 16,
"Present": 0
}
},
"result": "Passed",
"roll_id": "h44-2013"
}
]
}
Filtering
You can filter on many fields with a simple key/value pair:
/legislators?last_name=Smith
/bills?bill_type=hr&congress=112
The API will automatically treat numbers as numbers, and “true” and “false” as booleans. Dates and times are compared as strings.
To force the API to treat a value as a string, use quotes:
/legislators?thomas_id="136"
See the documentation for a specific data type to see what fields can be filtered on.
The API supports 8 operators that can be combined with filters:
- gt - the field is greater than this value
- gte - the field is greater than or equal to this value
- lt - the field is less than this value
- lte - the field is less than or equal to this value
- not - the field is not this value
- all - the field is an array that contains all of these values (separated by
|
) - in - the field is a string that is one of these values (separated by
|
) - nin - the field is a string that is not one of these values (separated by
|
) - exists - the field is both present and non-null (supply
true
orfalse
)
All operators are applied by adding two underscores (__
) after the field name. They cannot be combined.
Senate votes that got more than 70 Yea votes
/votes?breakdown.total.Yea__gte=70&chamber=senate
Bills that got an up or down vote in the House
/bills?history.house_passage_result__exists=true&chamber=house
Bills cosponsored by both John McCain and Joe Lieberman
/bills?cosponsor_ids__all=M000303|L000304`
Bills sponsored by either John McCain or Joe Lieberman
/bills?sponsor_id__in=M000303|L000304
All results in the Congress API are paginated. Set per_page
and page
to control the page size and offset. The maximum per_page
is 50.
/floor_updates?chamber=house&per_page=50&page=3
At the top-level of every response are count and page fields, with pagination information.
{
"count": 163,
"page": {
"per_page": 50,
"page": 3,
"count": 50
}
See Paging envelope
for details
Sort results by one or more fields with the order
parameter. order
is optional, but if no order
is provided, the order of results is not guaranteed to be predictable.
Append __asc
or __desc
to the field names to control sort direction. The default direction is desc, because it is expected most queries will sort by a date.
Any field which can be used for filtering may be used for sorting. On full-text search endpoints (URLs ending in /search
), you may sort by score
to order by relevancy.
Most recent bills
/bills?order=introduced_on
Legislators from each state, sorted by last name within state
/legislators?order=state__asc,last_name__asc
Most relevant bills matching "health care"
/bills/search?query=health+care&order=score
The Congress API supports CORS for all domains, so requests using any modern JavaScript library inside any modern browser should Just Work.
If CORS isn’t an option, you can provide a callback
parameter to wrap the results in a JavaScript function, suitable for use with JSONP. This can be used to make cross-domain requests to the Congress API within the browser, when CORS is not supported.
For example:
/legislators?last_name=Reid&callback=myCallback
will return:
myCallback({
"results": [
{
"bioguide_id": "R000146",
"chamber": "senate",
"last_name": "Reid"
...
}
],
"count": 1,
"page": {
"count": 1,
"per_page": 20,
"page": 1
}
});
Endpoints ending with /search
that are given a query
parameter perform full text search. These queries can use some advanced operators. Queries are interpreted as keywords (use quotes to form phrases).
Laws matching “health care” and "medicine"
/bills/search?query="health care" medicine&history.enacted=true
Operators allowed:
- Wildcards: Use
*
as a wildcard within words (e.g.nanotech*
). Cannot be used within phrases. - Adjacency: Append
~
and a number to a phrase to allow the words to come within X words of each other. (e.g."transparency accountability"~5
)
Bills matching “freedom of information” and words starting with "accountab"
/bills/search?query="freedom of information" accountab*
Bills with “transparency” and “accountability” within 5 words of each other
/bills/search?query="transparency accountability"~5
When performing full text search, you can retrieve highlighted excerpts of where your search matched by using the parameter highlight=true
. (This will make the request slower, so only use if needed.)
Recent bills matching “gun control”, with highlighting
/bills/search?query="gun control"&highlight=true&order=introduced_on
By default, highlighting is performed with the <em>
and </em>
tags. Control these tags by passing start and close tags to the highlight.tags
parameter. (Disable the highlighting of search terms altogether, leaving only a plain text excerpt, by passing a lone comma, ,
.)
Bills matching “immigration”, with excerpts highlighted with <b> tags
/bills/search?query=immigration&highlight=true&highlight.tags=,
Bills matching “immigration”, with excerpts with no highlighting
/bills/search?query=immigration&highlight=true&highlight.tags=,
Control the size of highlighted excerpts with the highlight.size
parameter. (Note: This doesn’t always work; the database makes a best attempt.) The default highlight.size
is 200.
Bills matching “drugs”, with larger excerpts
/bills/search?query=drugs&highlight=true&highlight.size=500
We provide some bulk data for direct download, separately. The Congress API as documented above is not designed for retrieving bulk data – requests are limited to a maximum of 50 per page, and many fields need to be specifically requested. If you need data in bulk, please use these resources rather than fetching it all through the API.
Legislator spreadsheet
We offer a CSV of basic legislator information for direct download here.
It includes basic information about names, positions, biographical details, contact information, social media accounts, and identifiers for various public databases.
It contains current information only - it does not include a legislator’s history of changes to name, party, chamber, etc.
Zip Codes to Congressional Districts
We provide a CSV connecting Zip Code Tabulation Areas (ZCTAs) to congressional districts for direct download here.
This is the data we use in our /legislators/locate and /districts/locate endpoints when a zip
is provided. These are technically not zip codes, but ZCTAs: all of our warnings and caveats about using ZCTAs apply.
Legislator Photos
We help maintain a repository of public domain images of members of Congress, located at:
https://github.com/unitedstates/images
Images are collected primarily from the Government Printing Office’s Member Guide, and hosted at predictable URLs, using the member of Congress’ Bioguide ID.
See the URL documentation for complete details.
Are we missing some photos? Raise the issue and let us know - we welcome contributions!
Core Information
Core information for legislators, committees, and bills come from public domain scrapers and bulk data at github.com/unitedstates.
- Scrapers for bulk bill data in JSON from THOMAS.gov, 1973-present.
- Legislator and committee bulk data in YAML from various sources, 1789-present.
- Popular nicknames for bills in CSV, manually updated and unofficial (e.g. “obamacare”).
If you’ve written a client library, please tweet at @sunlightlabs or email us so we can link to it here.
- Node: Matthew Chase Whittemore’s sunlight-congress-api (unofficial)
- Ruby: Erik Michaels-Ober’s congress gem (unofficial)
- PHP: lobostome’s FurryBear (unofficial)
- Python: python-sunlight (docs)
Migrating from our old Sunlight Congress API
This Sunlight Congress API replaces and deprecates our old Sunlight Congress API. We will keep the old Congress API running until at least the end of the 113th Congress (January 2015). We advise users of the old Congress API to upgrade to this one as soon as possible.
We have prepared a migration guide that shows how to move from each method in the old API to the new API.
Congress on IFTTT
The Sunlight Foundation has an IFTTT channel that offers some “Triggers” based on events in Congress.
Check out our shared recipes and our favorite recipes for some examples of how to make use of our congressional data with IFTTT.
Planned Additions
- Draft legislation in the House, as posted to docs.house.gov.
- Reports by GAO, CBO, and Congressional committees.
To suggest new data and features, open a ticket on Github Issues.
More APIs
If the Sunlight Congress API doesn’t have what you’re looking for, check out other Congress APIs:
Or if you’re looking for other government data:
- Open States API - Legislative data for all 50 US states, DC, and Puerto Rico.
- FederalRegister.gov API - Official (government-run) JSON API for the activity of the US’ executive branch. Includes all proposed and final regulations, executive orders, and all kinds of things.
- Capitol Words API - Search speeches of members of Congress (the Congressional Record), and get all sorts of language analysis on frequently used words and phrases.
- Influence Explorer API - Data around federal lobbying, grants, contracts, and state and federal campaign contributions.
Data on members of Congress, dating back to 1789. All member information is sourced from the bulk data at github.com/unitedstates. Feel free to open a ticket with any bugs or suggestions.
Unique ID: The bioguide_id will be present and unique for all members of Congress. It is an official ID, assigned by Congress, and is the most suitable for use as a unique ID.
Find members of Congress by a latitude
and longitude
, or a zip
code.
Please use encryption (https://
) for all requests to /legislators/locate
.
There is no support for further operators, ordering, or partial responses. All you can do is filter by location.
At-large districts, which encompass an entire state, are assigned a district number of 0
.
Request parameters
latitude
longitude
zip code
Responses
Examples
This will return both representatives and senators that currently represent the given point or zip. For a given latitude
and longitude
, this should return up to 1 representative and 2 senators.
GET https://congress.api.sunlightfoundation.com/legislators/locate?latitude=42.96&longitude=-108.09 HTTP/1.1
GET https://congress.api.sunlightfoundation.com/legislators/locate?zip=11216 HTTP/1.1
Search and filter for members of Congress. All standard operators apply.
By default, all requests will return currently serving members, but you can override this by supplying all_legislators=true
.
Request parameters
First letter of the party this member belongs to. “R”, “D”, or “I”.
Whether a legislator is currently holding elected office in Congress.
First letter of this member’s gender. “M” or “F”.
Two-letter code of the state this member represents.
The full state name of the state this member represents.
(House only) The number of the district that a House member represents.
(Senate only) The seniority of that Senator for that state. “junior” or “senior”.
Title of this member. “Sen”, “Rep”, “Del”, or “Com”.
Chamber the member is in. “senate” or “house”.
Which senate “class” the member belongs to (1, 2, or 3). Every 2 years, a separate one third of the Senate is elected to a 6-year term. Senators of the same class face election in the same year. Blank for members of the House.
The date of this legislator’s birthday.
The date a member’s current term started.
The date a member’s current term will end.
Responses
Body
Examples
Search for …
GET https://congress.api.sunlightfoundation.com/legislators?in_office=true&state=VA&title=Sen HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"results" : [ {
"in_office" : true,
"party" : "D",
"gender" : "M",
"state" : "OH",
"state_name" : "Ohio",
"district" : 1,
"title" : "Sen",
"chamber" : "senate",
"senate_class" : 1,
"state_rank" : "senior",
"birthday" : "1946-12-24",
"term_start" : "2007-01-04",
"term_end" : "2012-12-31"
} ],
"count" : 1,
"page" : {
"per_page" : 1,
"page" : 1,
"count" : 1
}
}
Find a congressional district for a given coordinate, or for a zip code. Congressional districts are calculated based on data from the 2010 Census.
For zip code lookup, we use ZIP Code Tabulation Areas (ZCTAs), also published by the Census.
Find congressional districts by a latitude
and longitude
, or a zip
code. There is no support for pagination, operators, ordering, or partial responses.
Please use encryption (https://
) for all requests to /legislators/locate
.
At-large districts, which encompass an entire state, are assigned a district number of 0
.
Request parameters
latitude
longitude
zip code
Responses
Body
Examples
For a given latitude
and longitude
, this should return 1 congressional district.
GET https://congress.api.sunlightfoundation.com/districts/locate?latitude=42.96&longitude=-108.09 HTTP/1.1
GET https://congress.api.sunlightfoundation.com/districts/locate?zip=11216 HTTP/1.1
Names, IDs, contact info, and memberships of committees and subcommittees in the House and Senate.
All committee information is sourced from bulk data at github.com/unitedstates, which in turn comes from official House and Senate sources.
Feel free to open a ticket with any bugs or suggestions.
We only provide information on current committees and memberships. For historic data on committee names, IDs, and contact info, refer to the bulk data.
Filter through committees in the House and Senate. Filter by any fields below that have a star next to them. All standard operators apply.
Request parameters
Official ID of the committee, as it appears in various official sources (Senate, House, and Library of Congress).
The chamber this committee is part of. “house”, “senate”, or “joint”.
Whether or not the committee is a subcommittee.
An array of bioguide IDs of legislators that are assigned to this committee.
Responses
Body
Official name of the committee. Parent committees tend to have a prefix, e.g. “House Committee on”, and subcommittees do not, e.g. “Health”.
Official ID of the committee, as it appears in various official sources (Senate, House, and Library of Congress).
The chamber this committee is part of. “house”, “senate”, or “joint”.
The committee’s official website.
The committe’s building and room number.
The committee’s phone number.
Whether or not the committee is a subcommittee.
An array of bioguide IDs of legislators that are assigned to this committee.
Note: membership information is not returned by default for requests to /committees
. You must specifically request these fields by using the fields
parameter as documented in Partial Responses.
Whether a member is in the majority or minority of this committee.
The rank this member holds on the committee. Typically, this is calculated by seniority, but there can be exceptions.
A title, if any, the member holds on the committee. “Chair” (in the House) and “Chairman” (in the Senate) signifies the chair of the committee. “Ranking Member” (in both chambers) signifies the highest ranking minority member.
If the committee is a parent committee, the subcommittees field contains a few basic fields about its subcommittees.
If the committee is a subcommittee, the ID of its parent committee.
If the committee is a subcommittee, some basic details
Data on bills in Congress goes back to 2009, and comes from a mix of sources:
- Scrapers at github.com/unitedstates for most data, including core status and history information.
- Bulk data at GPO’s FDSys for version information, and full text.
- The House’ MajorityLeader.gov and Senate Democrats’ official site for notices of upcoming debate.
Feel free to open a ticket with any bugs or suggestions.
Filter through bills in Congress. Filter by any fields below that have a star next to them. All standard operators apply.
Responses
Body
Search the full text of legislation, and other fields.
Request parameters
This searches the bill’s full text, short_title
, official_title
, popular_title
, nicknames
, summary
, and keywords
fields.
Responses
Body
Examples
GET https://congress.api.sunlightfoundation.com/bills/search?history.enacted=true&query="health care" HTTP/1.1
Data on amendments in Congress goes back to 2009, and comes from THOMAS.gov via scrapers at the github.com/unitedstates project. Feel free to open a ticket with any bugs or suggestions.
Filter through amendments in Congress. Filter by any fields below that have a star next to them. All standard operators apply.
Responses
Body
The unique ID for this amendment. Formed from the amendment_type
, number
, and congress
.
The type for this amendment. For the amendment “H.Amdt. 10”, the amendment_type
represents the “H.Amdt.” part. Amendment types can be either hamdt or samdt.
The number for this amendment. For the amendment “H.Amdt. 10”, the number
is 10.
The Congress in which this amendment was introduced. For example, amendments introduced in the “113th Congress” have a congress
of 113.
The chamber in which the amendment was introduced.
If the amendment was introduced in the House, this is a relative amendment number, scoped to the bill or treaty the House it relates to. How this number gets assigned is complicated and involves multiple institutions within the House and the Library of Congress. You can read the gory details if you want, but this number will usually do the job of connecting to data from the House Clerk’s Electronic Voting System.
The date this amendment was introduced.
The date or time of the most recent official action on the amendment. Often, there are no official actions, in which case this field will be set to the value of introduced_on
.
If this amendment amends an amendment, this field is the ID of the amended amendment.
If this amendment amends an amendment, some basic details about that amended amendment.
If this amendment relates to a bill, this field is the ID of the related bill.
If this amendment relates to a bill, some basic details about that related bill.
If this amendment relates to a treaty, this field is the ID of the related treaty. Treaty IDs are of the form treatyX-Y
, where X is the treaty’s number, and Y is the Congress the treaty is being considered in.
Whether the amendment is sponsored by a “person” or a “committee”.
If the sponsor_type
is “person”, this will be that legislator’s bioguide ID. If the sponsor_type
is “committee”, this will be that committee’s ID.
If the sponsor_type
is “person”, some basic details about that person. If the sponsor_type
is “committee”, some basic details about that committee.
Amendments can have a purpose
and a description
. It’s not clear why there are two separate fields. When both are available, the purpose
has slightly more information, but that information may be procedural and not relevant to the content of the amendment, as in the example above.
Amendments can have neither of these two fields (very common), or only a purpose
(common), or only a description
(common), or neither (very rare). You can read further discussion if you’re interested.
Actions on an amendment are identical to actions on bills. Please refer to the documentation on bill actions for examples and details.
Nominations made by the President and referred to the Senate for consideration. This data is taken from THOMAS.gov’s nominations directory, and goes back to 2009.
Data is collected using the unitedstates/congress project. Feel free to open a ticket with any bugs or suggestions.
Search and filter through presidential nominations in Congress.
Responses
Body
The unique identifier for this nomination, taken from the Library of Congress. Of the form “PN[number]-[congress]”.
The Congress in which this nomination was presented.
The number of this nomination, taken from the Library of Congress. Can occasionally contain hyphens, e.g. “PN64-01”.
The date this nomination was received in the Senate.
The date this nomination last received action. If there are no official actions, then this field will fall back to the value of received_on
.
The organization the nominee would be appointed to, if confirmed.
An array of objects with fields (described below) about each nominee. Nominations for civil posts tend to have only one nominee. Nominations for military posts tend to have batches of multiple nominees. In either case, the nominees field will always be an array.
The name of the nominee, as it appears in THOMAS. Capitalization is not consistent.
The position the nominee is being nominated for.
The which state in the United States this nominee hails from. This field is only available for some nominees, and never for batches of multiple nominees.
An array of IDs of committees that the nomination has been referred to for consideration.
The date the action occurred.
Where the action occurred. Can be either “committee” or “floor”.
Text describing the action.
The type of action. At this time, the only value for nomination actions is “action”.
A convenience field containing only the most recent action object.
The date the action occurred.
Where the action occurred. Can be either “committee” or “floor”.
Text describing the action.
The type of action. At this time, the only value for nomination actions is “action”.
Roll call votes taken by the House and Senate. This data is taken from original House and Senate sources, and goes back to 2009.
House and Senate votes normally appear within an hour after the vote is taken. House data usually appears more quickly, since the House uses an electronic voting system.
Votes taken by voice or unanimous consent, where the votes of individual representatives and senators are not recorded, are not present here.
Search and filter through votes in Congress.
Responses
Many fields are not returned unless requested. You can request specific fields with the fields
parameter. See the partial responses documentation for more details.
* = can be used as a filter
Body
A unique identifier for a roll call vote. Made from the first letter of the chamber
, the vote number
, and the legislative year
The chamber the vote was taken in. “house” or “senate”.
The number that vote was assigned. Numbers reset every legislative year.
The “legislative year” of the vote. This is not quite the same as the calendar year - the legislative year changes at noon EST on January 3rd. A vote taken on January 1, 2013 has a “legislative year” of 2012.
The Congress this vote was taken in.
The time the vote was taken.
The type of vote being taken. This classification is imperfect and unofficial, and may change as we improve our detection. Valid types are “passage”, “cloture”, “nomination”, “impeachment”, “treaty”, “recommit”, “quorum”, “leadership”, and “other”.
The official description of the type of vote being taken.
The official full question that the vote is addressing.
The required ratio of Aye votes necessary to pass the legislation. A value of “1/2” actually means more than 1/2. Ties are not possible in the Senate (the Vice President casts a tie-breaker vote), and in the House, a tie vote means the vote does not pass.
The official result of the vote. This is not completely standardized (both “Passed” and “Bill Passed” may appear). In the case of a vote for Speaker of the House, the result field contains the name of the victor.
The original, official source XML for this vote information.
If a vote is related to a bill, the bill’s ID.
If a vote is related to a bill, some basic fields about the bill.
If a vote is related to a nomination, the nomination’s ID.
If a vote is related to a nomination, some basic fields about the nomination.
An object connecting bioguide IDs of legislators to the vote values they cast.
An object connecting bioguide IDs to their vote value, and some basic information about the voter.
The value of the vote this voter cast.
Some basic fields about the voter.
The vote breakdown gives top-level numbers about what votes were cast. Most votes are “Yea”, “Nay”, “Present”, and “Not Voting”. There are exceptions: in the Senate, impeachment votes are “Guilty” or “Not Guilty”. In the House, votes for the Speaker of the House are the name of the person being voted for (e.g. “Pelosi” or “Boehner”). There may be other exceptions. Values for “Present” and “Not Voting” will always be present, no matter what kind of vote it is. These fields are dynamic, but can all be filtered on.
The number of members who cast [vote], where [vote] is a valid vote as defined above.
The number of members of [party] who cast [vote], where [party] is one of “D”, “R”, or “I”, and [vote] is a valid vote as defined above.
Recent real time, to-the-minute updates from the House and Senate floor. House floor updates are sourced from XML at the House Clerk, and Senate updates from the Senate Periodical Press Gallery.
This endpoint focuses on the recent past. We don’t automatically delete old floor updates, but we also don’t guarantee non-recent data will remain available.
Search and filter through floor updates in the House and Senate.
Responses
Body
The chamber this update took place in. “house” or “senate”.
The time this update took place. For Senate updates, this actually means the time our system first observed the update, and is susceptible to error; the Senate does not offer precise timestamps.
The number of the Congress this update took place during.
The “legislative year” of the update. This is not quite the same as the calendar year - the legislative year changes at noon EST on January 3rd. A vote taken on January 1, 2013 has a “legislative year” of 2012.
The “legislative day” this update took place in. The “legislative day” is a formal construct that is usually, but not always, the same as the calendar day. For example, if a day’s session of Congress runs past midnight, the legislative_day will often stay the same as it was before midnight, until that session adjourns. On January 3rd, it is possible that the same legislative_day could span two Congresses. (This occurred in 2013.)
The text of the update.
An array of IDs of bills that are referenced by or associated with this floor update.
An array of IDs of roll call votes that are referenced by or associated with this floor update.
An array of bioguide IDs of legislators that are referenced by this floor update.
Search and filter through committee hearings in the House and Senate.
Responses
Body
The ID of the committee holding the hearing.
The time the hearing will occur.
The number of the Congress the committee hearing is taking place during.
The chamber of the committee holding the hearing. “house”, “senate”, or “joint”.
Whether the committee hearing is held in DC (true) or in the field (false).
If the hearing is in DC, the building and room number the hearing is in. If the hearing is in the field, the address of the hearing.
A description of the hearing.
The IDs of any bills mentioned by or associated with the hearing.
(House only) A permalink to that hearing’s description on that committee’s official website
(House only) The type of hearing this is. Can be: “Hearing”, “Markup”, “Business Meeting”, “Field Hearing”.
Basic details about the related committee
Bills that have been scheduled by party leadership for upcoming House and Senate floor action. House schedules are taken from the House Majority Leader, and Senate schedules from the Senate Democratic Caucus.
The endpoint will accrue a running history of scheduled bills. Typically, you will want to ask for the latest upcoming bills, sorted by scheduled_at
(the time at which we first spotted the bill on the calendar).
Currently, the endpoint defaults to showing only bills in the future and immediate past (7 days ago). If you want different behavior, override the legislative_day
filter.
Note: Prior to March 4, 2014, the endpoint deleted old data on scheduled bills automatically.
Filter through upcoming bills in the House and Senate.
Currently, the endpoint defaults to showing only bills in the future and immediate past (7 days ago). If you want different behavior, override the legislative_day
filter.
Responses
* = can be used as a filter
Body
The number of the Congress this bill has been scheduled in.
The chamber which has scheduled this bill.
The source for this information. “house_daily” (Majority Leader daily schedule or “senate_daily” (Senate Democrats’ Floor feed.
The legislative day this bill is scheduled for. Combine with the range
field to understand precision. May be null.
How precise this information is. “day”, “week”, or null.
range
is “day”: bill has been scheduled specifically for thelegislative_day
.range
is “week”: bill has been scheduled for the “Week of” thelegislative_day
.range
is null: bill has been scheduled at an indefinite time in the future. (legislative_day
is null.)
The “legislative day” is a formal construct that is usually, but not always, the same as the calendar day. For example, if a day’s session of Congress runs past midnight, the legislative_day will often stay the same as it was before midnight, until that session adjourns. On January 3rd, it is possible that the same legislative_day could span two Congresses. (This occurred in 2013.)
(Senate only) Some context for what kind of activity will be occurring to the bill.
A permalink for this information. For the House, this may be a PDF.
The ID of the bill that is being scheduled.
Some basic fields about the bill that is being scheduled.
If you wish to check the status of the API, visit the root (no API key required):
Responses
Body
Whether a legislator is currently holding elected office in Congress.
filter
First letter of the party this member belongs to. “R”, “D”, or “I”.
filter
First letter of this member’s gender. “M” or “F”.
filter
Two-letter code of the state this member represents.
filter
The full state name of the state this member represents.
filter
(House only) The number of the district that a House member represents.
Title of this member. “Sen”, “Rep”, “Del”, or “Com”.
Chamber the member is in. “senate” or “house”.
Which senate “class” the member belongs to (1, 2, or 3). Every 2 years, a separate one third of the Senate is elected to a 6-year term. Senators of the same class face election in the same year. Blank for members of the House.
(Senate only) The seniority of that Senator for that state. “junior” or “senior”.
The date of this legislator’s birthday.
The date a member’s current term started.
The date a member’s current term will end.
Identifier for this member in various Congressional sources. Originally taken from the Congressional Biographical Directory, but used in many places. If you’re going to pick one ID as a Congressperson’s unique ID, use this.
filter
Identifier for this member across all countries and levels of government, as defined by the Open Civic Data project.
filter
Identifier for this member as it appears on THOMAS.gov and Congress.gov.
filter
Identifier for this member as it appears on GovTrack.us.
filter
Identifier for this member as it appears on Project Vote Smart.
filter
Identifier for this member as it appears on CRP’s OpenSecrets.
filter
Identifier for this member as it appears on some of Congress’ data systems (namely Senate votes).
filter
Identifier for this member as it is maintained by the Inter-university Consortium for Political and Social Research.
filter
A list of identifiers for this member as they appear in filings at the Federal Election Commission.
filter
H2OH13033
The member’s first name. This may or may not be the name they are usually called.
filter
The member’s nickname. If present, usually safe to assume this is the name they go by.
filter
The member’s last name.
filter
The member’s middle name, if they have one.
filter
A name suffix, if the member uses one. For example, “Jr.” or “III”.
filter
Phone number of the members’s DC office.
Official legislative website.
Office number for the member’s DC office.
URL to their official contact form.
Fax number of the members’s DC office.
Social media account data is sourced from the unitedstates/congress-legislators project on Github. If you spot any missing or incorrect accounts, please file a ticket or open a pull request!
All social media account values can be turned into URLs by preceding them with the domain name of the service in question:
http://twitter.com/[username]
http://youtube.com/[username or channel ID]
http://facebook.com/[username or ID]
The Twitter username for a member’s official legislative account. This field does not contain the handles of campaign accounts.
The YouTube username or channel for a member’s official legislative account. This field does not contain the handles of campaign accounts. A few legislators use YouTube “channels” instead of regular accounts. These channels will be of the form channel/[id]
.
The Facebook username or ID for a member’s official legislative Facebook presence. ID numbers and usernames can be used interchangeably in Facebook’s URLs and APIs. The referenced account may be either a Facebook Page or a user account.
An array of information for each term the member has served, from oldest to newest.
The date this term began
.
The date this term ended, or will end.
The two-letter state code this member was serving during this term.
The party this member belonged to during this term.
The Senate class this member belonged to during this term, if they served in the Senate. Determines in which cycle they run for re-election. 1, 2, or 3.
The title this member had during this term. “Rep”, “Sen”, “Del”, or “Com”.
The chamber this member served in during this term. “house” or “senate”.
Simple district representation
The two-letter state code of the state this district is in.
The number of the congressional district. For “At Large” districts, where a state has only one representative, the district number is 0
.
The unique ID for this bill. Formed from the bill_type
, number
, and congress
.
The type for this bill. For the bill “H.R. 4921”, the bill_type
represents the “H.R.” part. Bill types can be: hr, hres, hjres, hconres, s, sres, sjres, sconres.
The number for this bill. For the bill “H.R. 4921”, the number
is 4921.
The Congress in which this bill was introduced. For example, bills introduced in the “111th Congress” have a congress
of 111.
The chamber in which the bill originated.
The date this bill was introduced.
The date or time of the most recent official action. In the rare case that there are no official actions, this field will be set to the value of introduced_on
.
The date or time of the most recent vote on this bill.
The date the last version of this bill was published. This will be set to the introduced_on date until an official version of the bill’s text is published.
An array of common nicknames for a bill that don’t appear in official data. These nicknames are sourced from a public dataset at unitedstates/bill-nicknames, and will only appear for a tiny fraction of bills. In the future, we plan to auto-generate acronyms from bill titles and add them to this array.
obamacare
A list of official keywords and phrases assigned by the Library of Congress. These keywords can be used to group bills into tags or topics, but there are many of them (1,023 unique keywords since 2009, as of late 2012), and they are not grouped into a hierarchy. They can be assigned or revised at any time after introduction.
Abortion
An official summary written and assigned at some point after introduction by the Library of Congress. These summaries are generally more accessible than the text of the bill, but can still be technical. The LOC does not write summaries for all bills, and when they do can assign and revise them at any time.
The official summary, but capped to 1,000 characters (and an ellipse). Useful when you want to show only the first part of a bill’s summary, but don’t want to download a potentially large amount of text.
An object with URLs for this bill’s landing page on Congress.gov, GovTrack.us, and OpenCongress.org.
The history field includes useful flags and dates/times in a bill’s life. The above is a real-life example of H.R. 3590 - not all fields will be present for every bill. Time fields can hold either dates or times - Congress is inconsistent about providing specific timestamps.
Whether this bill has had any action beyond the standard action all bills get (introduction, referral to committee, sponsors’ introductory remarks). Only a small percentage of bills get this additional activity.
If this bill got any action beyond initial introduction, the date or time of the first such action. This field will stay constant even as further action occurs. For the time of the most recent action, look to the last_action_at
field.
The result of the last time the House voted on passage. Only present if this vote occurred. “pass” or “fail”.
The date or time the House last voted on passage. Only present if this vote occurred.
The result of the last time the Senate voted on cloture. Only present if this vote occurred. “pass” or “fail”.
The date or time the Senate last voted on cloture. Only present if this vote occurred.
The result of the last time the Senate voted on passage. Only present if this vote occurred. “pass” or “fail”.
The date or time the Senate last voted on passage. Only present if this vote occurred.
Whether the bill has been vetoed by the President. Always present.
The date or time the bill was vetoed by the President. Only present if this happened.
The result of the last time the House voted to override a veto. Only present if this vote occurred. “pass” or “fail”.
The date or time the House last voted to override a veto. Only present if this vote occurred.
The result of the last time the Senate voted to override a veto. Only present if this vote occurred. “pass” or “fail”.
The date or time the Senate last voted to override a veto. Only present if this vote occurred.
Whether the bill is currently awaiting the President’s signature. Always present.
Whether the bill has been enacted into law. Always present.
The date or time the bill was enacted into law. Only present if this happened.
Votes actions
HSWM
referral
A list of IDs of bills that the Library of Congress has declared “related”. Relations can be pretty loose, use this field with caution.
hconres254-111
The versions field is an array of information on each version of the bill. This data is sourced from GPO, and is published on a different schedule than most other bill information.
The short-code for what stage the version of the bill is at.
The full name for the stage the version of the bill is at.
The unique ID for this bill version. It’s the bill’s bill_id
plus the version’s version_code
.
A set of HTML, PDF, and XML links (when available) for the official permanent URL of a bill version’s text. Our full text search uses the text from the HTML version of a bill.
Information for only the most recent version of a bill. Useful to limit the size of a request with partial responses.
The short-code for what stage the version of the bill is at.
The full name for the stage the version of the bill is at.
The unique ID for this bill version. It’s the bill’s bill_id
plus the version’s version_code
.
A set of HTML, PDF, and XML links (when available) for the official permanent URL of a bill version’s text. Our full text search uses the text from the HTML version of a bill.
The upcoming
field has an array of objects describing when a bill has been scheduled for future debate on the House or Senate floor. Its information is taken from party leadership websites in the House and Senate, and updated frequently throughout the day.
While this information is official, party leadership in both chambers have unilateral and immediate control over what is scheduled on the floor, and it can change at any time. We do our best to automatically remove entries when a bill has been yanked from the floor schedule.
Where this information is coming from. Currently, the only values are “senate_daily” or “house_daily”.
An official reference URL for this information.
What chamber the bill is scheduled for debate in.
What Congress this is occurring in.
How precise this information is. “day”, “week”, or null. See more details on this field in the /upcoming_bills documentation.
The date the bill is scheduled for floor debate.
Some surrounding context of why the bill is scheduled. This is only present for Senate updates right now
If a bill has been enacted into law, the enacted_as
field contains information about the law number it was assigned. The above information is for Public Law 111-148.
The Congress in which this bill was enacted into law.
Whether the law is a public or private law. Most laws are public laws; private laws affect individual citizens. “public” or “private”.
The number the law was assigned.
The current official title of a bill. Official titles are sentences. Always present. Assigned at introduction, and can be revised any time.
The current popular handle of a bill, as denoted by the Library of Congress. They are rare, and are assigned by the LOC for particularly ubiquitous bills. They are non-capitalized descriptive phrases. They can be assigned any time.
The current shorter, catchier title of a bill. About half of bills get these, and they can be assigned any time.
A list of all titles ever assigned to this bill, with accompanying data.
The state the bill was in when assigned this title.
The title given to the bill.
The type of title this is. “official”, “short”, or “popular”.
The actions has a list of all official activity that has occurred to a bill. All fields are parsed out of non-standardized sentence text, so mistakes and omissions are possible.
The most recent action.
The type of action. Always present. Can be “action” (generic), “vote” (passage vote), “vote-aux” (cloture vote), “vetoed”, “topresident”, and “enacted”. There can be other values, but these are the only ones we support.
The date or time the action occurred. Always present.
If the action is a vote, which chamber this vote occured in. “house” or “senate”.
If the action is a vote, how the vote was taken. Can be “roll”, “voice”, or “Unanimous Consent”.
If the action is a vote, this is the type of vote. “vote”, “vote2”, “cloture”, or “pingpong”.
If the action is a vote, the result. “pass” or “fail”.
If the action is a roll call vote, the ID of the roll call.
A list of subobjects containing committee_id and name fields for any committees referenced in an action. Will be missing if no committees are mentioned.
The official text that describes this action. Always present.
A list of references to the Congressional Record that this action links to.
The bioguide ID of the bill’s sponsoring legislator, if there is one. It is possible, but rare, to have bills with no sponsor.
An object with most simple legislator fields for the bill’s sponsor, if there is one.
An array of bioguide IDs for each cosponsor of the bill. Bills do not always have cosponsors.
B000287
The number of active cosponsors of the bill.
When a legislator signed on as a cosponsor of the legislation.
An array of bioguide IDs for each legislator who has withdrawn their cosponsorship of the bill.
The number of active cosponsors of the bill.
The date the legislator withdrew their cosponsorship of the bill.
The date the legislator originally cosponsored the bill.
An object with most simple legislator fields for that withdrawn cosponsor.
The number of withdrawn cosponsors of the bill.
All results in the Congress API are paginated. Set per_page
and page
to control the page size and offset. The maximum per_page
is 50.
Data container field
The total number of documents that match the query.
information about current data page
The per_page value
used to find the response. Defaults to 50.
The page
value used to find the response. Defaults to 1.
The number of actual documents in the response. Can be less than the given per_page
if there are too few documents.