About the App

Some public data is managed on the Socrata open data platform including the open data from city of Chicago, Cook County, state of Illinois, and many other governments and agencies. Many datasets can be used simply by downloading the file from the government site but in order to access the data programmatically Socrata has provided the SODA API.

The documentation for the API is helpful but not complete. It provides only a few examples of their JSON equivalent of a WHERE clause. The format of the JSON filter is not easy to get right especially since it uses numeric column IDs rather than column names. The column IDs can change frequently as datasets are updated.

This web app can be used to generate the JSON filter as well as the complete curl command or other query components to be pasted into your own app. It is reasonably complete and accurate but you may find that you need to do some minor edits to the JSON. And as always, be sure to test your queries thoroughly!

You will need to enter the repository name which can be found in the URL for your dataset. For example, the Chicago crime data for 2011 is at URL http://data.cityofchicago.org/Public-Safety/Crimes-2011/qnrb-dui6 and its repository name is data.cityofchicago.org

You will also need to enter the view ID which can be found in the URL for your specific dataset. For example, the Chicago crime data for 2011 is at URL http://data.cityofchicago.org/Public-Safety/Crimes-2011/qnrb-dui6 and the view ID is qnrb-dui6 or the last nine characters of that URL. View IDs are always composed of two alphanumeric fields four characters long, separated by a dash.

You may also enter your app token. This app makes one API call to collect the column names and IDs so enter the token if you have one. It should work with or without a token.

Once again, be sure to test your queries before using them in production. Most open data publishers allow manually entered filters on their web page that you can use to check your results. Contact me if you find any errors or omissions.

Privacy Policy

All data entered into this web page except for app tokens is public and visible to anyone anywhere. If any of your data is confidential, including repository name, view ID, and search terms, do NOT use this app.

If you enter an app token, it will be obfuscated with asterisks on the web page and in the query JSON. Please note that this is not complete protection as the app token is sent in clear text when originally entered so any halfway competent hacker could intercept it. You will need to edit the JSON before using it by changing the asterisks back to your app token.

Your data, including app token, repository name, view ID, and search terms will be stored in my database. I will not disclose your app token to anyone.