Use Sunlight’s APIs for your own project!

by
Some statistics about Sunlight APIs as of May 28th, 2014.
API stats as of May 28, 2014.

It’s no secret Sunlight loves open data, so we’re quite eager to share and learn more tomorrow at TransparencyCamp. In addition to our advocacy getting government to improve their data policies, a significant part of our work revolves around providing anyone with free, reliable access to information about government through our APIs.

While we use these streams of data to power our own projects, seeing others use the data is especially rewarding. We know you can use this data in exciting and interesting ways we hadn’t even considered.

If you are interested in learning more about these APIs: sign up here to dive right in; head over to Sunlight Academy for a brief explainer; come to TransparencyCamp and the Sandbox to chat with our developers; or join the Sunlight Labs Google Group to discuss your project/idea. Below are some of the major streams of data, along with brief mentions of how others use it in new ways.

Capitol Words API

This data built on the Congressional Record allows anyone to plug into floor statements from both chambers of Congress. You can easily query the API based on state, party, date, word frequency, specific words or lawmakers and much more — all explained in the documentation.

The results of searching 'green energy' in the Congress Words project using the Sunlight Foundation's Capitol Words API.
The map resulting from a search of ‘green energy’ in Congress Words.

Sunlight used this data to power our Capitol Words project to visualize and compare what lawmakers are saying, but other folks not affiliated with Sunlight have done great things with the data too. For example, Roberto Gobbetti made a project visible here on Github called “Congress Words” that “[t]akes data from congress speeches and creates a map of the US showing how many times each state speaks a particular sentence of your choice.” The straightforward project generates a colored map based on word frequency normalized by the number of members of Congress in each state.

Another fun and simple project that uses Capitol Words data is the Twitter bot @CongressSays built by Carter Wang that shares the “most unique words from yesterday’s Congressional Session.” Journalists often utilize the Capitol Words API for stories such as this recent piece about Earth Day from the National Journal and this story in the New York Times about members of Congress discussing Benghazi.

Congress API

This live JSON API with great documentation provides a broad swath of information about Congress including details about legislators, committees, votes, bills, floor activity and more. We use this API in quite a few of our own projects and it’s our most popular API in terms of calls. It’s also used by many high-profile organizations, such as Greenpeace, the Wikimedia Foundation, the Campaign for America’s Future and the Free Enterprise Network.

A screenshot of PostCongress.io, the site to send real postcards to your member of Congress using the Sunlight Foundation's Congress API.
Screenshot of PostCongress.io.

This API is particularly helpful to connect users with their members of Congress. One example is how Peace Action West connected it with voting records to pair member lookups with votes and the organization’s scoring. Participant Media’s digital venture, TakePart, recently incorporated the Congress API into their action center based on a recent film, A Place at the Table, to enable fans to call or tweet at their members of Congress.

Scott Motte even used the Congress API to make a little site called PostCongress.io to convert brief comments to real postcards sent to your representative (for a $2 fee).

The logo and screenshots for the BizVizz app that uses data from the Sunlight Foundation's Influence Explorer API.

Influence Explorer API

This API tracks money in politics and allows queries on influence data in the aggregate, itemized or on individual entities. It is immensely useful for research projects on campaign contributions and lobbying records so if this strikes your fancy, head over to the full documentation to learn more.

One example of utilizing this information is BizVizz, a “corporate accountability app” for the iPhone powered by the Influence Explorer API that allows anyone to scan a barcode of a product and see the company’s associated campaign contributions. Another project building on this influence data is Shut that Down, whose goal is “to make sure politicians and media figures can’t get away with misogyny, racism, xenophobia, homophobia, and transphobia.”

Open States API

The Open States API is one of our fastest growing projects and APIs, which is hardly a surprise as it has information on the legislators and activities across all 50 state legislatures, Washington, D.C. and Puerto Rico. This data is the result of many years of effort by both full-time Sunlight staff and volunteers around the country and is well documented here.

A screenshot of the MinnPost's review of the 2014 legislative session using the Sunlight Foundation's Open States API.
Screenshot via MinnPost.

While we incorporate the Open States data across a number of our projects, it also powers some interesting work from others. The Center for the New Energy Economy at Colorado State University built a state energy policy legislation database and Bill Moyers & Company created an interactive map of state legislators matched up with a list of alleged members of American Legislative Exchange Council. The Minnesota Post uses our Open States API to power a beautiful visualization of the activities of their state legislature and have made versions for 2014, 2013 and 2012.

These are just a sampling of a the many projects that have taken advantage of Sunlight’s free APIs. Please register for an API key to start playing around, and, if you’re coming to TCamp, swing by the Sandbox with questions, comments or just an appreciative hug — the feeling is mutual.