Application Integration

Real Time Streaming 311 Incidents In Chicago

chicago-311 incidentsStudying the 311 landscape is part of our smart city research

After discovering a handful of Open311 API feeds, we wanted to develop some prototypes that demonstrate how you can quickly make 311 incidents data streaming using Server-Sent Events (SSE) in any browser, or mobile device. Not every city supports Open311, making non-emergency incidents available in an easy-to-use API, using a common format, but Chicago is one major city that does—providing an example of one city that is ahead of the curve with the smart city journey.

To get started,  we signed up for an API key within the Chicago 311 developer portal, and we took the API path for Chicago 311 requests

And created a simple streaming web page using the JavaScript SDK. All you have to do is take the HTML page below, plug in your own API key, and you have a real-time streaming version of the Chicago 311 incidents feed.

In addition to having a account and API key. You are going to need to sign up for your own Chicago API key, which you can then add as a parameter to your settings. We recommend putting it in your application settings and keeping out of the script code to minimize the secrets you are publishing on any web page. You can head over to the Chicago 311 API page to sign up for your own API key, and get more information about their API, including documentation, FAQs, and other resources.

This same setup will work for any of the cities that support Open311 including San Francisco, Washington DC, Boston, and others. We just wanted to show what is possible with Chicago. Eventually, we’ll create real-time streaming versions of all the available 311 APIs and add them to a real-time streaming API gallery we are building. If you would like to see a real-time streaming version of 311 in your city but aren’t sure where to start, reach out and we’ll see what we can do to help.

You can find the demo for this project over at Github or get at the scripts behind it with the Github repository. It is a pretty basic example of a listing page, but it gets the point across what you can do when streaming 511 traffic data.

**Original source: blog