# Eurostat API
> Official European Union statistics as an API, powered by Eurostat — the statistical office of the EU. Eurostat publishes harmonised data across every EU and EFTA country and region: population and demography, GDP and national accounts, employment and unemployment, inflation (HICP), trade, energy, migration, education, health and thousands more datasets. This API wraps Eurostat's JSON-stat dissemination service into clean, decoded rows, and adds friendly named indicators so you don't have to learn dataset codes. /v1/indicator?indicator=population&geo=DE&year=2023 returns a named statistic — population, gdp, gdp_per_capita, unemployment, inflation or employment — for one or more countries (2-letter codes such as DE, FR, IT, or aggregates like EU27_2020 and EA20) and one or more years, with no need to know the underlying dataset or dimension codes. /v1/data?dataset=demo_pjan&geo=DE&sex=T&age=TOTAL&time=2023 gives direct access to any of Eurostat's thousands of datasets by its code, with arbitrary dimension filters passed as query parameters — every dataset has its own dimensions (geo, time, sex, age, unit, na_item, coicop and so on). Both endpoints decode Eurostat's JSON-stat format automatically: single-value dimensions are lifted into a `fixed` context block, and each row carries the dimensions that actually vary (with both a human-readable label and the underlying code) alongside the numeric value, the dataset label and the last-update date. Ideal for economic dashboards, country comparison tools, research, data journalism and policy analysis. Country codes are 2-letter ISO; aggregates include EU27_2020 and EA20. Data © European Union, free to reuse with attribution.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/eurostat-api/..."
```

## Pricing
- **Free** (Free) — 1,500 calls/Mo, 2 req/s
- **Starter** ($10/Mo) — 40,000 calls/Mo, 5 req/s
- **Pro** ($30/Mo) — 170,000 calls/Mo, 12 req/s
- **Mega** ($75/Mo) — 680,000 calls/Mo, 35 req/s

## Endpoints

### Indicators

#### `GET /v1/indicator` — A named EU statistic for a country & year

**Parameters:**
- `indicator` (query, required, string) — population, gdp, gdp_per_capita, unemployment, inflation, employment Example: `population`
- `geo` (query, optional, string) — Country code(s), comma-separated, e.g. DE,FR Example: `DE`
- `year` (query, optional, string) — Year(s), e.g. 2023 Example: `2023`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/eurostat-api/v1/indicator?indicator=population&geo=DE&year=2023"
```

**Response:**
```json
{
    "data": {
        "rows": [
            {
                "value": 83118501
            }
        ],
        "about": "Population on 1 January (persons)",
        "count": 1,
        "fixed": {
            "age": "Total",
            "geo": "Germany",
            "sex": "Total",
            "freq": "Annual",
            "time": "2023",
            "unit": "Number"
        },
        "label": "Population on 1 January by age and sex",
        "source": "ESTAT",
        "dataset": "demo_pjan",
        "updated": "2026-05-30T11:00:00+0200",
        "indicator": "population"
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:50.273Z",
        "request_id": "94357300-a566-4e63-b156-51b74b04f6fe"
    },
    "status": "ok",
    "message": "Indicator retrieved",
    "success": true
}
```

### Data

#### `GET /v1/data` — Any Eurostat dataset by code + filters

**Parameters:**
- `dataset` (query, required, string) — Eurostat dataset code, e.g. demo_pjan Example: `demo_pjan`
- `geo` (query, optional, string) — Country code, e.g. DE Example: `DE`
- `time` (query, optional, string) — Year, e.g. 2023 Example: `2023`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/eurostat-api/v1/data?dataset=demo_pjan&geo=DE&time=2023"
```

**Response:**
```json
{
    "data": {
        "rows": [
            {
                "age": "Total",
                "sex": "Total",
                "value": 83118501,
                "age_code": "TOTAL",
                "sex_code": "T"
            },
            {
                "age": "Total",
                "sex": "Males",
                "value": 40919705,
                "age_code": "TOTAL",
                "sex_code": "M"
            },
            {
                "age": "Total",
                "sex": "Females",
                "value": 42198796,
                "age_code": "TOTAL",
                "sex_code": "F"
            },
            {
                "age": "Less than 1 year",
                "sex": "Total",
                "value": 724711,
                "age_code": "Y_LT1",
                "sex_code": "T"
            },
            {
                "age": "Less than 1 year",
                "sex": "Males",
                "value": 371620,
                "age_code": "Y_LT1",
                "sex_code": "M"
            },
            {
                "age": "Less than 1 year",
                "sex": "Females",
                "value": 353091,
                "age_code": "Y_LT1",
                "sex_code": "F"
            },
            {
                "age": "1 year",
                "sex": "Total",
                "value": 786020,
                "age_code": "Y1",
                "sex_code": "T"
            },
            {
                "age": "1 year",
             
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Usage notes, indicators & example datasets

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/eurostat-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Official EU statistics, harmonised across all EU/EFTA countries. Two ways in: (1) /v1/indicator?indicator=population&geo=DE&year=2023 = a friendly named statistic — population, gdp, gdp_per_capita, unemployment, inflation, employment — for one or more countries (geo, comma-separated 2-letter codes like DE,FR,IT or EU27_2020) and year(s); no need to know dataset codes. (2) /v1/data?dataset=demo_pjan&geo=DE&sex=T&age=TOTAL&time=2023 = any of Eurostat's thousands of datasets by its code, with arbitrary dimension filters passed as query parameters (each dataset has its own dimensions such as geo, time, sex, age, unit, na_item, coicop). Both decode Eurostat's JSON-stat into readable rows — single-value dimensions are lifted into a `fixed` block and each row carries the varying dimensions (with both human label and code) plus the value. Example datasets: demo_pjan (population), nama_10_gdp (GDP), une_rt_a (unemployment), prc_hicp_aind (HICP inflation), migr_imm8 (immigration), nrg_pc_204 (energy prices). Find dataset codes & dimension values in the Eurostat data browser. Country codes are 2-letter (plus EU27_2020, EA20 aggregates). Data © European Union, free to reuse with attribution.",
        "source": "Eurostat — statistical office of the European Union (ec.europa.eu/eurostat)",
        "endpoints": [
            "/v1/indicator",
            "/v1/data",
            "/v1/meta"
        ],
        "indicators": {
            "gdp": "Gross 
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/eurostat-api
OpenAPI spec: https://www.oanor.com/api/eurostat-api/openapi.json
