The REST request

The structure to build a REST request is:

{host_url}/rest/data/{version}/{format}/{lang}/{datasetCode}?{filters}

  • host_url : fixed part of the request related to our website
  • service : fixed part of the request related to the service
  • version : fixed part of the request related to the version of the service
  • format : data format to be returned (json or unicode)
  • lang : language used for metadata (en/fr/de)
  • datasetCode : unique code identifier of the queried dataset
  • filters : specify the scope of the query (optional). There is a threshold of maximum 50 sub-indicators per query. The filters are specific to a dataset, depending on dataset dimensions.
    • precision : the number of decimals for the values returned by the request
    • unit : filter on the dataset's UNIT dimension

The previous version of the JSON requests (version number 1.1 in the URL) is still available. Please use the new version (2.1), in order to benefit from future improvements.

JSON example

This request http://ec.europa.eu/eurostat/wdds/rest/data/v2.1/json/en/nama_10_gdp?geo=EU28&precision=1&na_item=B1GQ&unit=CP_MEUR&time=2010&time=2011 queries dataset "nama_10_gdp" for

  • Time: 2010 and 2011
  • Geo: European Union (28 countries)
  • Unit : CP_MEUR - Current prices, million euro
  • National Account indicator : B1GQ – Gross domestic product at market prices

and returns

{"version":"2.0","label":"GDP and main components (output, expenditure and income)","href":"http://ec.europa.eu/eurostat/wdds/rest/data/v2.1/json/en/nama_10_gdp?geo=EU28&precision=1&na_item=B1GQ&unit=CP_MEUR&time=2010&time=2011","source":"Eurostat","updated":"2018-03-14","extension":{"datasetId":"nama_10_gdp","lang":"EN","description":null,"subTitle":null},"class":"dataset","value":{"0":12827959.8,"1":13200971.1},"dimension":{"unit":{"label":"unit","category":{"index":{"CP_MEUR":0},"label":{"CP_MEUR":"Current prices, million euro"}}},"na_item":{"label":"na_item","category":{"index":{"B1GQ":0},"label":{"B1GQ":"Gross domestic product at market prices"}}},"geo":{"label":"geo","category":{"index":{"EU28":0},"label":{"EU28":"European Union (current composition)"}}},"time":{"label":"time","category":{"index":{"2010":0,"2011":1},"label":{"2010":"2010","2011":"2011"}}}},"id":["unit","na_item","geo","time"],"size":[1,1,1,2]}

 

UNICODE example

This request http://ec.europa.eu/eurostat/wdds/rest/data/v2.1/unicode/en/nama_10_gdp?geo=EU28&precision=1&na_item=B1GQ&unit=CP_MEUR&time=2010&time=2011 queries dataset "nama_10_gdp" for

  • Time: 2010 and 2011
  • Geo: European Union (28 countries)
  • Unit : CP_MEUR - Current prices, million euro
  • National Account indicator : B1GQ – Gross domestic product at market prices

and returns

META CODE Name GDP and main components (output, expenditure and income), Gross domestic product at market prices GDP and main components (output, expenditure and income), Gross domestic product at market prices ID nama_10_gdpCP_MEURB1GQ nama_10_gdpCP_MEURB1GQ DESCRIPTION Code: nama_10_gdp
Data last updated on: 14.03.2018 Code: nama_10_gdp
Data last updated on: 14.03.2018 UNIT Current prices, million euro Current prices, million euro PARSETYPE S S F F PRECISION 1 1 SLICE NA NA 2010 2011 EU28 European Union (current composition) 12827959.8 13200971.1