1407.0.55.002 - ABS.Stat - Beta: Web Services User Guide , User Guide  
Latest ISSUE Released at 11:30 AM (CANBERRA TIME) 07/10/2016   
   Page tools: Print Print Page Print all pages in this productPrint All RSS Feed RSS Bookmark and Share Search this Product

ABS.Stat Developer API (JSON)

About the ABS.Stat JSON API

The ABS provides access to datasets in ABS.Stat through a RESTful application programming interface (API) based on the SDMX-JSON standard. This allows anyone to easily call the API using a simple RESTful URL.

The SDMX-JSON protocol has been developed by the OECD and other international organisations as a new format of statistical data for use in internet-based electronic communications with users and third parties. One of the main aims is to provide web developers easy access to statistical databases using common formats they may already be familiar with.

Build a query from the web browser interface

One way to use the API is to select data as normal in the ABS.Stat web browser interface. Once you have made your selection go to:

  1. Export - Developer API
  2. Click Generate API queries (Note you are not required to fill in the contact form to generate your query)
  3. Copy and paste the Data or Structure query into your own application or a new tab in your web browser

For example: http://stat.data.abs.gov.au/sdmx-json/data/BOP/1.170.20.Q/all?detail=Full&dimensionAtObservation=AllDimensions&startPeriod=2015-Q2

The query is generated based on all the data currently selected in the web browser interface. To change the selection go to Customise - Selection and chose the data you want.

Build a query from the query builder interface

ABS.Stat includes a dedicated JSON query builder user interface (UI). This interface allows you to select the dataset and data dimensions you are interested in and generate a query URL or JSON response.
  1. Open the query builder UI: http://stat.data.abs.gov.au/sdmx-json
  2. Select a dataset from the drop down menu at the top
  3. Select dimension values from the menus below, all dimensions are selected by default
  4. Use the Start and End date menus to select an observation period
  5. Select the data observation level and detail, by default these are set to All Dimensions and Full respectively
  6. Copy the Request URL into your own application or a new tab in your web browser OR
  7. Click Render the SDMX-Json data to view the JSON response

Graphic: The query builder user interface with menus to select observations, time etc. Below the options is a ‘Request URL’ that can be copied into your own application and a ‘Render data’ button to deliver the data directly.
The SDMX-JSON query builder user interface

Once you have generated a URL using Export or the Query builder you can manually edit it if required. For example, in the exemplar above if you were to select all dimension members for ‘Data Item’ the API string would exceed the maximum number of characters allowed in a URL (1,000). If you want all members of the Data Item dimension you can simply delete all Data Item codes from the string which will return all data by default.

For example, here is the same query as above but requesting all members of the Data Item dimension: