Skill Tracer
Skills › Scientific Agent Skills › database-lookup › eurostat.md

eurostat.md

215 lines · skills/database-lookup/references/eurostat.md at 5f2bc03

Open on GitHub
1# Eurostat API Reference
2

Eurostat API Reference

Raw lines 1 to 2
3## Overview
4Eurostat is the statistical office of the European Union, providing statistics on economy, population, trade, labor, environment, and more for EU/EEA member states and partner countries. The API follows the SDMX (Statistical Data and Metadata Exchange) standard.
5

Overview

Eurostat is the statistical office of the European Union, providing statistics on economy, population, trade, labor, environment, and more for EU/EEA member states and partner countries. The API follows the SDMX (Statistical Data and Metadata Exchange) standard.

Raw lines 3 to 5
6## Base URL
7```
8https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1
9```
11An older JSON-stat endpoint also exists:
12```
13https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0
14```

Base URL

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

An older JSON-stat endpoint also exists:

https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0
Raw lines 6 to 15
16## Authentication
17**No API key required.** The API is fully open and free.

Authentication

No API key required. The API is fully open and free.

Raw lines 16 to 18
19## Rate Limits
20- No formal rate limits documented.
21- Eurostat may throttle aggressive scraping. Keep automated requests to 1-2 per second.
22- Large datasets may time out; use filters to reduce response size.
24---

Rate Limits

  • No formal rate limits documented.
  • Eurostat may throttle aggressive scraping. Keep automated requests to 1-2 per second.
  • Large datasets may time out; use filters to reduce response size.

Raw lines 19 to 25
26## Key Endpoints (SDMX 2.1 API)

Key Endpoints (SDMX 2.1 API)

Raw lines 26 to 27
28### 1. Get Dataset (Observations)
30```
31GET /data/{datasetCode}/{filter}
32```
34| Parameter | Required | Description |
35|-----------|----------|-------------|
36| `datasetCode` | Yes | Eurostat dataset code (e.g., `nama_10_gdp`, `demo_pjan`) |
37| `filter` | No | Dot-separated dimension filter. Use `+` for multiple values in a dimension, `.` to separate dimensions, empty segment for "all". |
39**Query parameters:**
40| Parameter | Required | Description |
41|-----------|----------|-------------|
42| `format` | No | `sdmx+json` (default), `sdmx+csv`, `sdmx+xml`, `TSV` |
43| `startPeriod` | No | Start year/quarter/month: `2015`, `2020-Q1`, `2020-01` |
44| `endPeriod` | No | End year/quarter/month |
45| `detail` | No | `full` (default), `dataonly`, `serieskeysonly`, `nodata` |
46| `lang` | No | `en` (default), `fr`, `de` |
48**Example (GDP at market prices for Germany and France, annual, 2018-2023):**
49```
50https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/nama_10_gdp/A.CP_MEUR.B1GQ.DE+FR?startPeriod=2018&endPeriod=2023
51```
53**Example (total population by country, annual):**
54```
55https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/demo_pjan/A.NR.T.TOTAL.DE+FR+IT+ES?startPeriod=2015&endPeriod=2023
56```
58**Example (unemployment rate, seasonally adjusted, monthly):**
59```
60https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/une_rt_m/M.SA.TOTAL.PC_ACT.T.EA20?startPeriod=2023-01&endPeriod=2024-12
61```
63**Example (HICP inflation, all items, monthly):**
64```
65https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/prc_hicp_mmor/M.RCH_M.CP00.DE+FR+IT?startPeriod=2023-01&endPeriod=2024-06&format=JSON
66```

1. Get Dataset (Observations)

GET /data/{datasetCode}/{filter}
ParameterRequiredDescription
datasetCodeYesEurostat dataset code (e.g., nama_10_gdp, demo_pjan)
filterNoDot-separated dimension filter. Use + for multiple values in a dimension, . to separate dimensions, empty segment for "all".

Query parameters:

ParameterRequiredDescription
formatNosdmx+json (default), sdmx+csv, sdmx+xml, TSV
startPeriodNoStart year/quarter/month: 2015, 2020-Q1, 2020-01
endPeriodNoEnd year/quarter/month
detailNofull (default), dataonly, serieskeysonly, nodata
langNoen (default), fr, de

Example (GDP at market prices for Germany and France, annual, 2018-2023):

https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/nama_10_gdp/A.CP_MEUR.B1GQ.DE+FR?startPeriod=2018&endPeriod=2023

Example (total population by country, annual):

https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/demo_pjan/A.NR.T.TOTAL.DE+FR+IT+ES?startPeriod=2015&endPeriod=2023

Example (unemployment rate, seasonally adjusted, monthly):

https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/une_rt_m/M.SA.TOTAL.PC_ACT.T.EA20?startPeriod=2023-01&endPeriod=2024-12

Example (HICP inflation, all items, monthly):

https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/prc_hicp_mmor/M.RCH_M.CP00.DE+FR+IT?startPeriod=2023-01&endPeriod=2024-06&format=JSON
Raw lines 28 to 67
68### 2. Get Dataset as CSV
70Append `?format=SDMX-CSV` to any data request for a flat CSV response that is easier to parse.
72**Example:**
73```
74https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/nama_10_gdp/A.CP_MEUR.B1GQ.DE+FR?startPeriod=2018&endPeriod=2023&format=SDMX-CSV
75```

2. Get Dataset as CSV

Append ?format=SDMX-CSV to any data request for a flat CSV response that is easier to parse.

Example:

https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/nama_10_gdp/A.CP_MEUR.B1GQ.DE+FR?startPeriod=2018&endPeriod=2023&format=SDMX-CSV
Raw lines 68 to 76
77### 3. Get Dataset Structure (Dimensions and Code Lists)
79```
80GET /datastructure/ESTAT/{datasetCode}
81```
83**Example:**
84```
85https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/datastructure/ESTAT/nama_10_gdp
86```
88Returns dimension names, positions, and code list references.

3. Get Dataset Structure (Dimensions and Code Lists)

GET /datastructure/ESTAT/{datasetCode}

Example:

https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/datastructure/ESTAT/nama_10_gdp

Returns dimension names, positions, and code list references.

Raw lines 77 to 89
90### 4. Get Code List (Dimension Values)
92```
93GET /codelist/ESTAT/{codelistId}
94```
96**Example:**
97```
98https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/codelist/ESTAT/GEO
99```

4. Get Code List (Dimension Values)

GET /codelist/ESTAT/{codelistId}

Example:

https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/codelist/ESTAT/GEO
Raw lines 90 to 100
101### 5. Search/Browse Datasets (Dataflows)
103```
104GET /dataflow/ESTAT/all
105```
107Returns all available Eurostat datasets. Add `?detail=allstubs` for a lighter listing.
109**Example:**
110```
111https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/dataflow/ESTAT/all?detail=allstubs
112```
114---

5. Search/Browse Datasets (Dataflows)

GET /dataflow/ESTAT/all

Returns all available Eurostat datasets. Add ?detail=allstubs for a lighter listing.

Example:

https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/dataflow/ESTAT/all?detail=allstubs

Raw lines 101 to 115
116## JSON-stat API (Simpler Alternative)

JSON-stat API (Simpler Alternative)

Raw lines 116 to 117
118### Base URL
119```
120https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data
121```

Base URL

https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data
Raw lines 118 to 122
123### Get Data
124```
125GET /data/{datasetCode}?{dimension_filters}
126```
128Dimensions are passed as query parameters using their dimension name.
130**Example (GDP for DE and FR):**
131```
132https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/nama_10_gdp?geo=DE&geo=FR&unit=CP_MEUR&na_item=B1GQ&freq=A&time=2020&time=2021&time=2022&lang=en
133```
135**Response (JSON-stat format):**
136```json
138 "version": "2.0",
139 "label": "GDP and main components (output, expenditure and income)",
140 "id": ["freq", "unit", "na_item", "geo", "time"],
141 "size": [1, 1, 1, 2, 3],
142 "dimension": {
143 "geo": {
144 "label": "Geopolitical entity",
145 "category": {
146 "index": {"DE": 0, "FR": 1},
147 "label": {"DE": "Germany", "FR": "France"}
148 }
149 },
150 "time": {
151 "label": "Time",
152 "category": {
153 "index": {"2020": 0, "2021": 1, "2022": 2}
154 }
155 }
156 },
157 "value": [3336010.0, 3601750.0, 3876810.0, 2310420.0, 2500870.0, 2639090.0],
158 "status": {}
160```
162Values are in a flat array; use dimension sizes to reshape.
164---

Get Data

GET /data/{datasetCode}?{dimension_filters}

Dimensions are passed as query parameters using their dimension name.

Example (GDP for DE and FR):

https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/nama_10_gdp?geo=DE&geo=FR&unit=CP_MEUR&na_item=B1GQ&freq=A&time=2020&time=2021&time=2022&lang=en

Response (JSON-stat format):

{
  "version": "2.0",
  "label": "GDP and main components (output, expenditure and income)",
  "id": ["freq", "unit", "na_item", "geo", "time"],
  "size": [1, 1, 1, 2, 3],
  "dimension": {
    "geo": {
      "label": "Geopolitical entity",
      "category": {
        "index": {"DE": 0, "FR": 1},
        "label": {"DE": "Germany", "FR": "France"}
      }
    },
    "time": {
      "label": "Time",
      "category": {
        "index": {"2020": 0, "2021": 1, "2022": 2}
      }
    }
  },
  "value": [3336010.0, 3601750.0, 3876810.0, 2310420.0, 2500870.0, 2639090.0],
  "status": {}
}

Values are in a flat array; use dimension sizes to reshape.


Raw lines 123 to 165
166## Common Dataset Codes
168| Code | Description |
169|------|-------------|
170| `nama_10_gdp` | GDP and main components |
171| `nama_10_pc` | GDP per capita |
172| `namq_10_gdp` | GDP quarterly |
173| `demo_pjan` | Population on 1 January |
174| `demo_gind` | Population change (births, deaths, migration) |
175| `une_rt_m` | Unemployment rate (monthly) |
176| `une_rt_a` | Unemployment rate (annual) |
177| `lfsi_emp_a` | Employment rate (annual) |
178| `prc_hicp_manr` | HICP inflation (annual rate of change, monthly) |
179| `prc_hicp_mmor` | HICP inflation (monthly rate of change) |
180| `ext_lt_maineu` | EU trade by partner (main partners) |
181| `ext_st_27_2020sitc` | International trade by SITC |
182| `bop_c6_q` | Balance of payments (quarterly) |
183| `gov_10dd_edpt1` | Government deficit/surplus |
184| `gov_10a_main` | Government revenue, expenditure and main aggregates |
185| `sts_inpr_m` | Industrial production (monthly) |
186| `tour_occ_nim` | Tourism (nights spent at accommodation) |
187| `env_air_gge` | Greenhouse gas emissions |
188| `tec00114` | GDP growth rate (percentage change) |
189| `tec00118` | Government debt as % of GDP |

Common Dataset Codes

CodeDescription
nama_10_gdpGDP and main components
nama_10_pcGDP per capita
namq_10_gdpGDP quarterly
demo_pjanPopulation on 1 January
demo_gindPopulation change (births, deaths, migration)
une_rt_mUnemployment rate (monthly)
une_rt_aUnemployment rate (annual)
lfsi_emp_aEmployment rate (annual)
prc_hicp_manrHICP inflation (annual rate of change, monthly)
prc_hicp_mmorHICP inflation (monthly rate of change)
ext_lt_maineuEU trade by partner (main partners)
ext_st_27_2020sitcInternational trade by SITC
bop_c6_qBalance of payments (quarterly)
gov_10dd_edpt1Government deficit/surplus
gov_10a_mainGovernment revenue, expenditure and main aggregates
sts_inpr_mIndustrial production (monthly)
tour_occ_nimTourism (nights spent at accommodation)
env_air_ggeGreenhouse gas emissions
tec00114GDP growth rate (percentage change)
tec00118Government debt as % of GDP
Raw lines 166 to 190
191## Common Country Codes (ISO 2-letter, Eurostat uses uppercase)
193`AT` Austria, `BE` Belgium, `BG` Bulgaria, `CY` Cyprus, `CZ` Czechia, `DE` Germany, `DK` Denmark, `EE` Estonia, `EL` Greece, `ES` Spain, `FI` Finland, `FR` France, `HR` Croatia, `HU` Hungary, `IE` Ireland, `IT` Italy, `LT` Lithuania, `LU` Luxembourg, `LV` Latvia, `MT` Malta, `NL` Netherlands, `PL` Poland, `PT` Portugal, `RO` Romania, `SE` Sweden, `SI` Slovenia, `SK` Slovakia
195Aggregates: `EU27_2020` (EU-27), `EA20` (Euro area 20), `EA19` (Euro area 19), `EEA30_2007` (EEA)
197**Note:** Greece uses `EL` (not `GR`) in Eurostat.

Common Country Codes (ISO 2-letter, Eurostat uses uppercase)

AT Austria, BE Belgium, BG Bulgaria, CY Cyprus, CZ Czechia, DE Germany, DK Denmark, EE Estonia, EL Greece, ES Spain, FI Finland, FR France, HR Croatia, HU Hungary, IE Ireland, IT Italy, LT Lithuania, LU Luxembourg, LV Latvia, MT Malta, NL Netherlands, PL Poland, PT Portugal, RO Romania, SE Sweden, SI Slovenia, SK Slovakia

Aggregates: EU27_2020 (EU-27), EA20 (Euro area 20), EA19 (Euro area 19), EEA30_2007 (EEA)

Note: Greece uses EL (not GR) in Eurostat.

Raw lines 191 to 198
199## Format and dimension handling
201The SDMX 2.1 API defaults to SDMX-ML Generic XML. Supported `format` values
202include `SDMX_2.1_STRUCTURED`, `SDMX-CSV`, `JSON` (JSON-stat), and `TSV`.
203Do not parse `format=JSON` as a SDMX-JSON dataSets/structure envelope.
204For JSON-stat, use `id`, `size`, and each dimension's category index to reshape
205`value`; values may be an array or a sparse index-keyed object. Missing cells
206are not zero. Preserve observation flags and dataset update time.

Format and dimension handling

The SDMX 2.1 API defaults to SDMX-ML Generic XML. Supported format values include SDMX_2.1_STRUCTURED, SDMX-CSV, JSON (JSON-stat), and TSV. Do not parse format=JSON as a SDMX-JSON dataSets/structure envelope. For JSON-stat, use id, size, and each dimension's category index to reshape value; values may be an array or a sparse index-keyed object. Missing cells are not zero. Preserve observation flags and dataset update time.

Raw lines 199 to 207
208## Notes
209- Dimension order in the filter path depends on the dataset structure. Always check `/datastructure/ESTAT/{code}` first.
210- Use `+` to select multiple values in one dimension (e.g., `DE+FR+IT`).
211- Leave a dimension segment empty (consecutive dots `..`) to select all values.
212- CSV format (`?format=SDMX-CSV`) is recommended for easier parsing -- it returns flat rows with labeled columns.
213- The JSON-stat API is simpler for quick queries but the SDMX API is more powerful and complete.
214- Dataset codes can be found at https://ec.europa.eu/eurostat/databrowser/ by browsing themes.
215- Large unrestricted queries may time out. Always filter by country and time period.

Notes

  • Dimension order in the filter path depends on the dataset structure. Always check /datastructure/ESTAT/{code} first.
  • Use + to select multiple values in one dimension (e.g., DE+FR+IT).
  • Leave a dimension segment empty (consecutive dots ..) to select all values.
  • CSV format (?format=SDMX-CSV) is recommended for easier parsing -- it returns flat rows with labeled columns.
  • The JSON-stat API is simpler for quick queries but the SDMX API is more powerful and complete.
  • Dataset codes can be found at https://ec.europa.eu/eurostat/databrowser/ by browsing themes.
  • Large unrestricted queries may time out. Always filter by country and time period.
Raw lines 208 to 215