Via the @ONSDigital blog (http://blog.ons.digital/2016/02/25/new-ons-website-launched/, it seems that the new Office for National Statistics website, which publishes the UK’s official government statistics, has just been released in all its glory.
One thing I noticed was that it’s now trivial to get hold of data, in JSON format, from a statistics page by adding /data to the end of a stats page URL.
For example, the data behind the Consumer Price Index page:
can be found at:
Data can also be downloaded in CSV and XLS formats using another derivable URL. For example, to download the data as CSV:
Use the value xls rather than csv to get the spreadsheet file.
Another nice feature is that the alphabetic listing of statistics:
can also be accessed in a JSON data format by adding the /data path element:
(Paged) search results can also be returned in JSON format:
Search results can also be narrowed down (following the tabs on the search results HTML page) from All to Data or Publications:
It’s also possible to get time series charts as image URLs of the form:
(The date range filters don’t seem to work if applied to the /data URLs?)
Now I just need some time to play!
PS I’ve just popped a gist containing some python code that represents a first start at grabbing the data from the JSON feeds here: https://gist.github.com/psychemedia/ca7b981f2bbd45377b44