Last week we celebrated our billionth API call by announcing a giveaway, and Tuesday we went ahead and pulled the name of a random API user who had made at least one successful query. I've been emailing with him since, and am please so say that Matt Gabrenya is our winner! You can find his Github profile here, and his business site, Boston TechCollective, here. Matt used our APIs to power his BillTrack project, which aims to make it easier to run advocacy campaigns on issues like SOPA and the Keystone XL pipeline. We're delighted that Matt found our APIs useful, and thrilled that thousands of you have as well. We're going to keep making them better, deeper and more powerful; we're counting on all of you to put them to good use.Continue reading
Disclaimer: The opinions expressed by the guest blogger and those providing comments are theirs alone and do not reflect the opinions of the Sunlight Foundation or any employee thereof. Sunlight Foundation is not responsible for the accuracy of any of the information within the guest blog.
Tom Meagher is the co-founder of Hack Jersey and the data editor at Digital First Media's Project Thunderdome in New York City. Follow Hack Jersey at @hackjersey or www.hackjersey.com. Reach Tom at @ultracasual.
A few weeks ago, Hack Jersey brought a group of journalists and developers together to wrestle with campaign finance data. We thought it would be a good opportunity for many to get their hands dirty and to start thinking about new ways of reporting and building with the data.
In one room of our event at the New Jersey Institute of Technology, a group of journalists went on a data expedition, learning how to explore reports from the state's Election Law Enforcement Commission. In another, we gathered developers to try to build a campaign finance app for New Jersey using the Sunlight Foundation's APIs in a single work session.Continue reading
Last week was dominated by news of the first government shutdown in seventeen years. But at Sunlight it also marked a different, more cheerful milestone. Last week, Sunlight's APIs served their billionth request!Continue reading
When the government shuts down and takes most of its data with it, the public needs to have a backup plan.Continue reading
In January, Sunlight [released a new Congress API](https://groups.google.com/forum/#!topic/sunlightlabs/r-evxgtFXRw). It's been a huge help to [our own products](http://congress.sunlightfoundation.com/), and seen a great deal of use by the community (such as today's [DefundTheNSA campaign](http://defundthensa.com/)). In the time since, we've released some new data, some new developer-friendly features, and seen lots of community contribution. Here's what's been added over the last few months:Continue reading
At Sunlight we're immensely proud of our community of API users and today we're launching a new section of our website to learn more about them, see how others use the data and use the snazzy query builder.Continue reading
We’re excited to announce that we’ve partnered with Codecademy to make our Capitol Words API easier to learn and use.... View ArticleContinue reading
‘Tis the season for application programming interfaces. Sunlight is in a festive mood. Not only are we hosting a pretty... View ArticleContinue reading
It’s no secret that we’re dataphiles here at Sunlight, or that we want everyone to have access to the underlying... View ArticleContinue reading
Call on Congress is the Sunlight Foundation's new free service to help anyone with a telephone connect with and learn about their lawmakers. Simply dial 1-888-907-6886 to find out how your representatives are voting on bills and raising campaign money and learn about upcoming bills in Congress.
While Sunlight prides itself on creating powerful, online tools that make government more transparent and accountable, we do so knowing that there is a segment of the public without access to the internet that we will never reach. Call on Congress is our attempt to bring information about Congress to anyone that can use a phone.
The service is built on top of Twilio, a simple cloud communications API that enables us to create interactive phone and SMS applications. Users can navigate through a series of menus, be connected directly to the office of their representatives, and even leave us voice messages.
I can't express how awesome it is to work with their service. They have made it incredibly easy to do things that would otherwise be quite difficult to create. We can generate dynamic responses that are spoken back to the user using Twilio's text-to-speech feature. We can have recordings of a spoken script play for static content or even play music, if we had the need. We can even forward phone calls so that users can be connected directly to the office of their representative without having to write down the phone number and dial the call.
i18n and the Google Translate API
Call on Congress is Sunlight's first multilingual project. The service is available in English, Spanish, and Esperanto... yes, Esperanto. This posed some unique challenges as we had to deal with both a static spoken script and dynamic text that would be read using Twilio's text-to-speech feature.
Dan created an amazing, multi-tiered solution for this problem. Each bit of text used in the application is run through a series of steps to determine the proper response. All of the text is written in English in the code, but is internationalized by:
- creating an MD5 hash of the text
- determining the response language
- checking for a cached translated copy of the text if it is not in English
- generating a translated copy of the text using the Google Translate API
- generating an audio file name based on the MD5 hash and a slugged chunk of the text
- doing a HEAD request to S3 to see if an audio file exists for the chunk of text
- responding either with a Twilio Say command using the translated chunk of text or a Play command with the S3 URL of the audio file, if one exists
This method allows us to basically drop in new languages as we create the audio for them. We can launch a new language and have the text-to-speech render the Google translated text until we drop language audio files into the application.
Dan is smart.
One of the most exciting aspects about this project, at least for us internally, is that almost all of the features of this service are powered by our existing APIs:
- Member lookup by ZIP code and contact information is powered by our Congress API.
- Bill information comes from the Real Time Congress API.
- Campaign contributions and member biographies are provided by the Influence Explorer API.
Our friends at TurboVote are responsible for the API that allows us to provide information about local election offices.
Call on Congress is a great example of what can be done using our API offerings. We were able to create this application without having to do any scraping or collecting of data of our own. In fact, it's a great example of what can be done entirely with APIs. Call on Congress is nothing more than a cache and the logic that combines the Twilio, Google Translate, and Sunlight APIs into a single application.
Give it a try! 1-888-907-6886
Call on Congress is open source and available on GitHub.Continue reading