APIs
APIs in 15 Minutes
Submitted by jturk on Fri, 2008-10-24 10:33.There is a lot of talk about making data accessible via APIs, but there is also a lot of confusion about what this means, how to do it, and why it is beneficial when the average citizen cannot make heads or tails of an API.
API stands for "Application Programming Interface" but typically what we are discussing when we talk about APIs around data is a way to access data in a machine readable format. A machine readable format is something that is more or less understandable by a computer program, so that it may be used to present data in new and interesting ways.
The house.gov website has a listing of all representatives by state but a computer program has no way of knowing how to understand this listing. A more useful listing might look like an excel (or CSV) file that listed each congressperson's name in the first column, state in the second, and so on.
This is the fundamental advantage of an API, it makes data available in a way that a computer program can understand so that more complicated things can be done by such a program. (eg. draw a map with states colored according to their representatives' party affiliations)
A side effect of this computer readable format is that it is possible to ask more useful and specific questions of the data. When you go to the above house.gov site it is possible to get a listing of all Representatives, but it is impossible to say "show me all representatives that are Democrats from North Carolina" or "show me all representatives named John." With an API this kind of query is typically very simple, as an example in the Sunlight Labs API this could be done by going to a URL like http://services.sunlightfoundation.com/api/legislators.get?state=NC&part....
It is the availability of these APIs that have allowed all sorts of interesting sites that combine data from multiple sources known as "mashups." One of the earliest and most popular examples was a site called HousingMaps that combines Craigslist housing data with Google maps.
A handful of APIs exist to help make government data more accessible, through which it is now possible to make mashups using government data.
A rich sampling of them includes:
- Sunlight Labs API
- Capitol Words API
- FollowTheMoney API
- GovTrack.us API
- MapLight.org API
- NYTimes Campaign Finance API
- OpenSecrets API
- Project Vote Smart API
- Watchdog.net API
All of these can be used to pull the information available from these sites and do new and interesting things with it and even combine it with data from other sites to provide a more in-depth view than any single site or dataset can hope to offer.
- jturk's blog
- 1 comment
- Email this blog
- 321 reads
NYTimes Announces Campaign Finance API
Submitted by jturk on Tue, 2008-10-14 18:24.The New York Times has just announced an API that makes available the data they have gleaned from the Federal Election Commission's electronic filings for the presidential candidates.
"The initial version of the Campaign Finance API offers overall figures for presidential candidates, as well as state-by-state and ZIP code totals for specific candidates. In addition, the API supports a contributor name search using any of the following parameters: first name, last name and ZIP code."
This allows people with the appropriate technical skills to build mashups and other web services that take a look at donations by individual or by area with relative ease. In essence it is now possible for web developers to create views on this valuable data that previously would have involved digging through millions of FEC electronic filings.
It should also be possible for researchers with moderate technical knowledge to analyze the individual contributions going to candidates to perform statistical and other analysis on what makes for a very interesting dataset.
The New York times providing this service is certainly a positive step towards helping people make use of what is one of the richest (pun not intended) datasets the federal government has to offer.
- jturk's blog
- Add new comment
- Email this blog
- 344 reads
FEC data available as a widget and API!
Submitted by jajacobs on Fri, 2007-08-24 10:44.No, The FEC isn't doing this; MAPLight.org is. But, the FEC is providing the data in an an open format with detailed documentation which makes this all possible (see Files by Election Cycle at the FEC site).
MAPLight.org is providing access to Federal Elections Commission (FEC) data through an API (application programming interface) that makes it easy for any Web developer to build their own site or software program that displays or shares up-to-date campaign contributions from the FEC (www.maplight.org/widgets/apis) and through widgets (www.maplight.org/widgets) that allow anyone to track presidential fundraising on their own blogs, social media sites, and personal Web sites.
Both services, the widgets and the API, are free and open source, so anyone can use or modify them as they see fit.
Here is an example of a widget (but you can customize for your own site, of course!).
The MAPLight.org presidential widget is the first of several more widgets that the organization will release. By September 15, MAPLight.org will release a widget for U.S. Congress, showing total campaign contributions for each candidate for Congress. By September 30, MAPLight.org will release its "Money and Votes" widget, revealing correlations between campaign contributions and votes for any bill in U.S. Congress. To be notified when MAPLight.org releases these widgets, visit www.maplight.org/participate/signup. MAPLight.org is a nonprofit, nonpartisan organization based in Berkeley, California. Its search engine at MAPLight.org illuminates the connection between money and politics (MAP) via an unprecedented database of campaign contributions and legislative outcomes.
- jajacobs's blog
- Add new comment
- Email this blog
- 752 reads



Recent comments
7 min 2 sec ago
35 min 12 sec ago
51 min 44 sec ago
5 hours 4 min ago
5 hours 8 min ago
17 hours 32 min ago
17 hours 59 min ago
1 day 14 hours ago
2 days 1 hour ago
2 days 2 hours ago