Questions tagged [ons-api]

The Office for National Statistics (ONS) OpenAPI (Beta) is a RESTful web service which returns UK statistical data as XML or JSON. At the time of launch it only has Census 2011 data, but more data will be added over time.

The Office for National Statistics (ONS) OpenAPI (Beta) was launched on 28th October 2013.

Its home page is http://www.ons.gov.uk/ons/apiservice/web/apiservice/home

It is a RESTful web service which returns UK statistical data as XML or JSON. At the time of launch it only has Census 2011 data, but more data will be added over time and it will eventually replace the NeSS and NOMIS services.

The service is free but developers have to register for an API key.

From the home page above, developers can access example client code, sample outputs, how to guides and reference material.

Example applications are currently supplied for AJAX (HTML/JavaScript), Java, Visual Basic, Excel, D3 (SVG), Mapping (OS OpenSpace and Google), Adobe Flex (Flash) and Android. This code is provided under the Open Government Licence.

11 questions
3
votes
0 answers

Automatically Get the Latest Version of a Shapefile From ONS Open Geography Portal

I am trying to automate a data pipeline in Python. Currently I manually download the latest version of the Local Authority Districts UK BUC shapefile from:…
mmTmmR
  • 573
  • 2
  • 8
  • 20
3
votes
2 answers

UK Postcode to Census Data using the API

Using the Office for National Statistics website I can get a census summary for a UK postcode. https://neighbourhood.statistics.gov.uk/dissemination/ I expected that I should be able to do the same thing using the…
Joe
  • 91
  • 7
1
vote
0 answers

How can I preserve / recreate correct order in json-stat data imported to R from ONS API

I'm just beginning to use the ONS API, and have managed to request specific data from R using rjstat::fromjsonstat to generate a nested list. I'm aware that json data is not ordered, but I cannot see any indexing with which to recreate a data…
1
vote
2 answers

Getting data for LSOA via the ons API

I have been able to get valid data for electoral wards for a range of census concepts. e.g.…
1
vote
1 answer

Retrieving summary data from ONS API throughout hierarchy

I'm successfully traversing the ONS API, and can retrieve values from the terminal leaves of the API such as Religion By Sex By Age > 2011WARDH > Wales > Ceredigion > Aberystwyth Rheidol If I try to pull a larger data set such as at Wales level I…
1
vote
1 answer

How to convert ONS API Java example to Tomcat

I've just downloaded the Java example for the new ONS OpenAPI from http://www.ons.gov.uk/ons/apiservice/java and it's configured for WebLogic and gives me errors in Eclipse. How do I change it to use Tomcat and get rid of the errors?
0
votes
1 answer

Using ONS API for Electoral Ward & Constituency

Need the functionality on a site I'm making to get a user's electoral ward & constituency from a UK postcode which has been entered. I have been using https://www.uk-postcodes.com/ where you'd make a simple file_get_contents() call like…
Chris98
  • 567
  • 1
  • 4
  • 16
0
votes
1 answer

Retrieving unemployment figures using ons-api

I have created two functions, one that builds the endpoint, and another that sends the request. Much of the docs speak of the Census, but I am looking for a different type of data. To begin with I am looking to find unemployment figures from…
BadAddy
  • 346
  • 1
  • 4
  • 12
0
votes
1 answer

UK postcode to Index of Multiple deprivation

I want to get the Index of Multiple Deprivation value for a given (UK) postcode. It can be done using the tool developed by an Oxford group (link below) http://tools.npeu.ox.ac.uk/imd/ I want to know what the conversion process is. I know the iMDs…
wildcolor
  • 564
  • 1
  • 9
  • 23
0
votes
1 answer

Can I get GDP history in JSON format from ONS API?

I'd like to create some dynamic graphs charting UK GDP movements over the last couple of years with a library such as D3. Is it possible to get GDP related info via the ONS API ?
0
votes
1 answer

Using the ONS JSON-stat Viewer on non-ONS JSON-stat responses

The JSON-stat viewer won't work on non-ONS JSON-stat responses. The problem seems to be generated by the fixGeocount function. Couldn't the line jsonstat2 = fixGeocount(jsonstat); be removed (jsonstat2 is never used), or at least conditionally…