ProPublica

Journalism in the Public Interest

The ProPublica Nerd Blog

New in Our Congress API: Bill Subjects, Personal Explanations and Sunsetting Sunlight

.

The U.S. Capitol (Tom Williams/CQ Roll Call)

We've got a few updates to the ProPublica Congress API to tell you about.

First, and most importantly, if you're a user of the Sunlight Congress API, you need to change your code to point to the ProPublica Congress API soon. The Sunlight API URLs will no longer work after Aug. 31, 2017. Changing your code is easy. You just need to get a ProPublica Congress API key and make the necessary changes to your code to keep anything you built running after the switchover. We'll be publishing a guide that helps with the transition by identifying common endpoints between the two APIs.

As a reminder, we are no longer supporting the legislative boundary service that the Sunlight API supported. If your code used the Sunlight API to find legislators using a postal address, we're recommending that you switch to the Google Civic Information API for that task.

Since our last update to the ProPublica Congress API, we've made several fixes and added new responses. These include two new endpoints:

The floor updates endpoint contains descriptions of legislative activity that are updated in near real-time throughout the day. This endpoint exists for both the House and the Senate.

The House and Senate committee hearings endpoint details recent and upcoming meetings.

Both of these are similar to what the Sunlight Congress API has now.

We're also creating two new responses for bill subjects, which are assigned by the Congressional Research Service for most bills. Users can now retrieve recent bills for a given subject. For example, it's now possible to retrieve recently updated bills with the subject of “taxation,” like so (using Python):

Code:

import requests
r = requests.get("https://api.propublica.org/congress/v1/bills/subjects/taxation.json", headers={'X-API-Key': 'PROPUBLICA CONGRESS API KEY'})
print r.json()['results'][0]

Result:

{u'latest_major_action': u'Referred to the House Committee on Ways and Means.', u'committees': u'House Ways and Means Committee', u'title': u'Layoff Prevention Extension Act of 2016', u'sponsor_uri': u'https://api.propublica.org/congress/v1/members/D000216.json', u'number': u'H.R.5408', u'introduced_date': u'2016–06–08', u'bill_uri': u'https://api.propublica.org/congress/v1/114/bills/hr5408.json', u'latest_major_action_date': u'2016–06–08', u'sponsor_id': u'D000216', u'cosponsors': 6}

Because our data spans many years and indexing systems, there are more than 6,000 potential subjects. Since 2009 the CRS has used about 1,000 subjects; more information about those subjects and a list of terms is available at Congress.gov. To help users find the subjects they are interested in we've provided a keyword search endpoint.

We hope that search-by-subject will allow developers to make it easier for users to find and track legislation on topics they are interested in.

We've also added a pair of responses for “personal explanations,” which are statements inserted into the Congressional Record explaining why lawmakers missed votes and what their votes would have been (the statements are merely explanations and have no effect on the vote itself).

A database we launched last year called Personal Explanations listed these statements for every lawmaker, although they are most used by members of the House of Representatives. That interactive database app will be folded into Represent, our main congressional database.

The explanations in the Congress API are exactly as filed in the Congressional Record, with two additions: Included is a categorization of the explanation and, if the explanation concerns only a single vote, a link to the API URL for that vote. The new responses will be for recently filed explanations and explanations for a given lawmaker. Here's an example of what that data looks like:

{
	member: "D000598",api_uri: "https://api.propublica.org/congress/v1/members/D000598.json",
	name: "Susan A. Davis",
	state: "CA",
	year: 2017,
	roll_call: 284,
	party: "D",
	date: "2017–06–06",
	url: "https://www.congress.gov/congressional-record/2017/06/06/extensions-of-remarks-section/article/E768–3",
	text: "Mr. Speaker, on Thursday, May 25, 2017, my vote was not recorded due to a technical error. I intended to vote YES on H.R. 1761 the Protecting Against Child Exploitation Act.",
	category: "Vote not recorded",
	parsed: true,
	vote_api_uri: "https://api.propublica.org/congress/v1/115/house/sessions/1/votes/284.json"
}

Finally, we've added two attributes to member list responses: They now have lawmakers' dates of birth and, for House members, a geoid attribute based on a format used by the Census Bureau that can help developers displaying congressional data on a map. For bill actions, we've changed the individual action response to use a date, not a datetime. Bills can now be filtered by two additional types: “enacted” and “vetoed.”

One last change worth mentioning: For all JSON responses, we're now displaying integers, boolean and null values as native data types rather than as strings. XML responses remain unchanged.

The next steps for the ProPublica Congress API are to make the full text of bills searchable and to add more attributes to some bill responses. With that, we'll have merged as much of the functionality of the Sunlight Congress API as we can, and we'll be ready to shut it down

We encourage users to report errors or to request features on GitHub or by emailing apihelp@propublica.org.