Child pages
  • API - Detailed guidelines - API Statistics

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • provides data in JSON-stat 2.0 format;

  • supports only REpresentation State Transfer (REST) protocol;

  • delivers responses in English, French or German.


Excerpt

The structure of the REST request

The structure to build the REST request is a URL: {host_url}/{service}/{version}/{response_type}/{datasetCode}?{format}&{lang}&{filters}

Image Modified

URL part

Example

Comment


Fixed part


{host_url}/

https://ec.europa.eu/eurostat/api/dissemination/

https://ec.europa.eu/eurostat/api/comext/dissemination (Comext and Prodcom datasets)

Fixed part of the request related to our website

{service}/

statistics/

Fixed part of the request related to the service

{version}/

1.0/

Fixed part of the request related to the version of the service


Dynamic part


{response_type}/

data/

Only statistical data are currently returned

{datasetCode}

nama_10_gdp

Unique code identifier of the queried data product (either a dataset or a predefined extraction)

?{format}

?format=JSON

Optional parameter

&{lang}

&lang=EN

Optional parameter

&{filters}

&time=2019

Optional parameters

The parameters defined in the REST request

...

Error messages returned in case of invalid queries

Fault Code

HTTP Status

Description

Client Errors



100 No results found

400 Bad request

The result from the query is empty.

100 No results found

404 Not Found

The requested resource is not available.

140 Syntax error

400 Bad request

The query is invalid.

150 Semantic error

400 Bad request

The request is syntactically correct but fails a semantic validation, business rules.

Server errors



500 Internal Server error

500 Internal server error

The webservice should return this error code when none of the other error codes better describes the reason for the failure of the service to provide a meaningful response.

Also used in case of request not respecting the xsd definition.

Asynchronous response in case of big extractions

...