The UK Riots API.

During this (hopefully brief) period of civil unrest in our nation’s less-pacific youth, data is being spread quite widely. To provide a nice search and list function for riots (presently, searching only by location), I’ve created the Riots API.

Please don’t lean too hard on it, because I am not an expert in scalability and it’s only running on a small server. Cache as much as you can.

Usage.

The base URL is http://dpk.org.uk/riots/. To this, you can pass the following GET query-string parameters:

page, num

The default number of returned results is 10. You can tune it up to 75 and page through results using these parameters.

near, max_dist

If you pass a comma-separated lat/long pair to near, you’ll only get riotous events that happened near that location. max_dist allows you to tune the radius allowed for this search, in miles—the default is 10.

search

Searches for the specified keyword in the description of the riot event.

Coming soon: a POST method that will actually allow you to instigate a riot in a specific location using an API call.

Result.

A JSON list. The format is obvious enough.

Examples

More to come.

Data source.

The Guardian’s spreadsheet of confirmed riot events. This is cached locally and updated manually on the server but I hope to keep it updated fairly frequently.