Projects that Hack using Sunlight APIs
In the past few months we have had the pleasure of partnering with Hack Reactor, an honors-level, immersive coding academy in San Francisco. As part of its 12-week intensive course, we mentored three of their talented burgeoning developers on a Product Development Sprint where they developed professional grade client work. In our case, we were able to channel their developing skills to civic-minded projects using Sunlight’s open APIs. Here’s what they came up with and their experience using our data in their own words. Hope this inspires you to learn to code in 2014 (and if it does, you should sign up for a free API key, check out our Codecademy track and browse project ideas using our APIs).
Info Extender Extension by Patrick Stanger
Being an avid reader of news and technical articles, I understand how not knowing the prescribed lingo can affect a reader’s experience. The fact is that modern readers have a fairly short attention span and most will get frustrated by having to divert their attention away from their read in order to look up tangential facts and technical terms.
With this in mind and armed with the arsenal of political data provided by the Sunlight Foundation’s expansive API collection, I built the Sunlight Info Extender, a Google Chrome extension that assists readers to digest and comprehend articles dealing with government and politics without the need to open up multiple tabs. Once the extension is installed on a reader’s computer, all the user needs to do is start browsing the web. The extension automatically and continuously scans the page for bill names, key terms and congressional members. The extension icon will also continually display the number of matches that were found on any given page. To learn more, a user can simply click the extension icon in their browser to display a window where relevant information is immediately accessible.
Developing an extension that puts pertinent information immediately in the hands of a reader was greatly simplified by utilizing data APIs that Sunlight either maintains or greatly contributed to such as the UnitedStates project on Github. Containing a wealth of useful data and having an easily discernable interface, Sunlight’s APIs were instrumental in developing this extension on such a short timeframe for my personal project at Hack Reactor. Feel free to browse the source code on Github. I look forward to both seeing what clever ideas the Sunlight Foundation enables and to continue working with them in future projects.
Influence Explorer Extension by Bradford Cook
The second project is a browser extension that helps users quickly view a company’s historical political campaign contributions. The Influence Explorer extension lets you seamlessly access a company’s campaign contributions based on your current URL or search ad-hoc for contributions made by other companies. The extension uses a crowdsourced approach to link URLs to a specific company. It incorporates user feedback in real time to detect new mappings as well as incorrect mappings that need to be removed. If you are interested in learning more, click through to the Chrome Web Store to give the extension a try!
On a more technical note, I approached this project as being essentially a single page web applications with certain restrictions brought on by the fact that it is a browser extension. The front end is created using D3.js and AngularJS, and it is supported by a backend comprised of Node.js, MySQL and Python. Given the fast response times provided by the Influence Explorer API, I only needed to store a small amount of information in my own database, and I was able to access most of the content dynamically through Sunlight’s API. Also, it was important to keep the backend portion of this project simple in order to meet the short development timeline. This is something future hackathon participants should keep in mind when trying to rapidly prototype an idea.
This project was made possible by the guidance from engineers at Sunlight and the Influence Explorer API that they have built.
Live Capitol Hill by Rick Cerf
I strongly believe the United States government should be accountable to the people of the United States. Increased government transparency is one way to increase this sense of accountability between a government and it’s people.
The Sunlight Foundation also believes in the importance of government transparency and one way the Foundation enlivens this vision is by maintaining a live data set on the activities of the United States legislative branch. This dataset, the Congress API v3, is freely available to web developers in the form of a RESTful API. For my project, I chose to utilize this API on a web app titled Live Capitol Hill, which displays active federal bills and enables individuals to search for federal legislatures by ZIP code.
My goal in building Live Capitol Hill was to bring focus to information about our federal government that would be both pertinent and meaningful to a citizen. The best way to make sure the information was pertinent was to report timely information with the greatest possible geographic specificity. For the federal government, this meant reporting the legislative branches most recent voting activity.
I wanted this information to be easily read and absorbed so I designed the app with the intent of keeping the information as focused as possible. What emerged is a simple stream of bill titles, their respective voting histories, and the date/time of when each vote took place. This stream utilizes the practices of responsive design and displays well on either desktop, tablet, or mobile device.
The stack, like the aesthetic design, was kept simple and streamlined for Live Capitol Hill. The app uses a Node.js server with the Express framework. The data is directly queried from the Sunlight API to keep application costs and maintenance down. I used handlebars to template the pages themselves, which are rendered server side. The source code for Live Capitol Hill can be found here on Github. Live Capitol Hill is licensed under the MIT License.
It was a pleasure working with the Sunlight Foundation’s Congress API. The resources for using the API include both thorough documentation and an active google group. I look forward to using the Sunlight Foundations APIs again in the future.
Interested in partnering with us on a data project? Send us an email. Want to learn more about Hack Reactor contact Adrian.