Beginning today, ProPublica is launching a Campaign Finance API to help researchers, journalists and software developers cover election fundraising and expenditures.
An API, or Application Programming Interface, is a language that two programs can use to communicate and trade data. Programmers can use it to access data from a website or Internet service more easily.
We’re assuming responsibility of an API that was previously published by The New York Times. If you used the previous Campaign Finance API published by the New York Times, your code will continue to work for a short time, but you should migrate immediately. Keep reading for details on how.
New users can sign up for a free API key by emailing email@example.com. The API provides information on committees and candidates that file records with the Federal Election Commission, with an emphasis on those committees that file electronically (almost every federal committee except most Senate campaigns).
The API is updated with new electronic filings every 15 minutes and with summary data published by the FEC once a day.
The ProPublica Campaign Finance API powers our FEC Itemizer database, which non-programmers can use to find and browse electronic campaign finance filings as soon as they’re filed. Taking over the API will help us add new features to this project.
The API includes information about electronic filings, which are submitted to the FEC on nearly every day of the year. The API provides details about specific types of filings, filings for a specific date and a summary of financial information in each filing.
The API does not include itemized contribution records except in some specific circumstances. If you’re looking to search for contributors, the FEC and the Center for Responsive Politics make bulk data available, and the FEC’s new beta site also has an individual search.
The FEC has provided this data in bulk for decades, and has recently launched a beta API of its own that has includes candidates, committees, filings and some itemized transactions. There is some overlap between the FEC’s API and ProPublica’s: both offer users the ability to search for candidates or committees and summary financial information, while both offer information that the other does not.
One big difference is timeliness: the FEC API is updated nightly, while ours will be updated throughout each day. For many users of campaign finance data, that distinction may not be a big deal, but on filing days, when thousands of filings are submitted to the FEC, timeliness can matter a lot. Another is the source data: the FEC considers electronic filings to be “unofficial” in the sense that data from them is then brought into agency databases before being published as bulk data. The FEC API publishes data only from those official tables, while the ProPublica API has data from both the official tables and the raw electronic filings. As the FEC API develops, we may move to incorporate aspects of it into the ProPublica API, or to remove clearly duplicative offerings.
If you are a current user of The New York Times Campaign Finance API, we want to make this transition as easy as possible. The Times’ API will be shut down in a few days, so we encourage you to sign up for a new API key to use the ProPublica API. Requests will look similar, but not identical, to the previous ones. For example, to search for committees with the word “tomorrow” in the name, The Times API call would have been:
The URL structure for that request using the ProPublica Campaign Finance API is:
There are a couple of important changes to requests: First, the version is “v1” rather than the previous “v3” since this is the first iteration of the API under ProPublica. Second, the API key isn’t passed as a query string; instead it is sent as a header with the request. From a command line interface using curl, it would look like this:
curl “https://api.propublica.org/campaign-finance/v1/2016/committees/search.json?query=TOMORROW” -H “X-API-Key: PROPUBLICA_API_KEY”
The API will continue to return JSON and XML formats for requests, and callbacks will be supported for JSON responses. Documentation of all available requests is here.
We’re grateful to Chase Davis of The Times for his help in making it possible for ProPublica to acquire and host the API. We’re planning on adding some new data points and enhancing others, particularly where we can add value through custom calculations or categorization. If you have questions or comments about the transition, or the API going forward, please don’t hesitate to let us know. We’d also love to hear your ideas and requests, either in the comments below or at firstname.lastname@example.org.