# Denmark Statistics API
> Official Danish economic statistics straight from Statistics Denmark's Statbank (api.statbank.dk), the national statistical agency. The cpi endpoint returns the Danish Consumer Price Index for the latest month — the headline index (base 2015=100), the month-on-month change and the year-on-year inflation rate — for the all-items total or any six-digit COICOP commodity group. The cpi/series endpoint returns the historical monthly CPI index and year-on-year inflation for a chosen group over the last N months, ready to chart. The cpi/groups endpoint breaks the latest CPI down across all twelve COICOP divisions (food, housing, transport, recreation and so on) with index and annual change for each, so you can see where inflation is concentrated. The table endpoint exposes the metadata (variables and their values) of any Statbank table by id, so you can discover the full Danish statistics catalogue. Live data is read directly from Statbank and updated as Statistics Denmark publishes; Danish decimal commas are normalised to points. Live. 5 endpoints. This serves Danish national price statistics; for euro-area or other countries use the matching national-statistics API.

## 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/denmark-stats-api/..."
```

## Pricing
- **Free** (Free) — 220 calls/Mo, 2 req/s
- **Basic** ($9/Mo) — 19,000 calls/Mo, 6 req/s
- **Pro** ($26/Mo) — 96,000 calls/Mo, 22 req/s
- **Mega** ($61/Mo) — 430,000 calls/Mo, 55 req/s

## Endpoints

### Inflation

#### `GET /v1/cpi` — Danish CPI (latest month): index, MoM and YoY

**Parameters:**
- `group` (query, optional, string) — 6-digit COICOP group; 000000 = all-items total (default) Example: `000000`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/denmark-stats-api/v1/cpi?group=000000"
```

**Response:**
```json
{
    "data": {
        "base": "2015=100",
        "index": 121.2,
        "period": "2025M12",
        "source": "Statistics Denmark (Statbank, table PRIS111)",
        "country": "Denmark",
        "indicator": "Consumer Price Index",
        "period_iso": "2025-12",
        "group_label": "00 Forbrugerprisindekset i alt",
        "coicop_group": "000000",
        "last_updated": "2026-01-12T08:00:00",
        "change_mom_pct": -0.4,
        "change_yoy_pct": 1.9
    },
    "meta": {
        "timestamp": "2026-06-15T20:41:05.377Z",
        "request_id": "17e9683f-6e7f-41f2-92a4-6f70ce248f67"
    },
    "status": "ok",
    "message": "Danish CPI retrieved",
    "success": true
}
```

#### `GET /v1/cpi/groups` — Latest CPI across all 12 COICOP divisions

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/denmark-stats-api/v1/cpi/groups"
```

**Response:**
```json
{
    "data": {
        "base": "2015=100",
        "count": 12,
        "period": "2025M12",
        "source": "Statistics Denmark (Statbank, PRIS111)",
        "country": "Denmark",
        "divisions": [
            {
                "index": 134.3,
                "label": "Food & non-alcoholic beverages",
                "coicop_group": "010000",
                "change_yoy_pct": 3.5,
                "statbank_label": "01 Fødevarer og ikke-alkoholiske drikkevarer"
            },
            {
                "index": 135.3,
                "label": "Alcoholic beverages & tobacco",
                "coicop_group": "020000",
                "change_yoy_pct": 2.1,
                "statbank_label": "02. Alkoholiske drikkevarer og tobak"
            },
            {
                "index": 98.3,
                "label": "Clothing & footwear",
                "coicop_group": "030000",
                "change_yoy_pct": -0.2,
                "statbank_label": "03. Beklædning og fodtøj"
            },
            {
                "index": 122.2,
                "label": "Housing, water, electricity & fuels",
                "coicop_group": "040000",
                "change_yoy_pct": 1.2,
                "statbank_label": "04. Boligbenyttelse, elektricitet og opvarmning"
            },
            {
                "index": 102.8,
                "label": "Furnishings & household equipment",
                "coicop_group": "050000",
                "change_yoy_pct": -1.2,
    
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/cpi/series` — Historical CPI index + YoY for a group

**Parameters:**
- `group` (query, optional, string) — 6-digit COICOP group (default 000000) Example: `000000`
- `months` (query, optional, string) — Number of recent months (default 24, max 120) Example: `24`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/denmark-stats-api/v1/cpi/series?group=000000&months=24"
```

**Response:**
```json
{
    "data": {
        "base": "2015=100",
        "count": 24,
        "series": [
            {
                "index": 117.8,
                "period": "2024M01",
                "period_iso": "2024-01",
                "change_yoy_pct": 1.2
            },
            {
                "index": 118.4,
                "period": "2024M02",
                "period_iso": "2024-02",
                "change_yoy_pct": 0.8
            },
            {
                "index": 118.4,
                "period": "2024M03",
                "period_iso": "2024-03",
                "change_yoy_pct": 0.9
            },
            {
                "index": 118.5,
                "period": "2024M04",
                "period_iso": "2024-04",
                "change_yoy_pct": 0.8
            },
            {
                "index": 118.5,
                "period": "2024M05",
                "period_iso": "2024-05",
                "change_yoy_pct": 2.2
            },
            {
                "index": 118.5,
                "period": "2024M06",
                "period_iso": "2024-06",
                "change_yoy_pct": 1.8
            },
            {
                "index": 119.8,
                "period": "2024M07",
                "period_iso": "2024-07",
                "change_yoy_pct": 1.1
            },
            {
                "index": 119.3,
                "period": "2024M08",
                "period_iso": "2024-08",
                "change_yoy_pct": 1.4
            },
…(truncated, see openapi.json for full schema)
```

### Catalogue

#### `GET /v1/table` — Statbank table metadata (variables + values)

**Parameters:**
- `id` (query, optional, string) — Statbank table id (default PRIS111) Example: `PRIS111`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/denmark-stats-api/v1/table?id=PRIS111"
```

**Response:**
```json
{
    "data": {
        "id": "PRIS111",
        "text": "Forbrugerprisindeks",
        "unit": "-",
        "source": "Statistics Denmark (Statbank)",
        "updated": "2026-01-12T08:00:00",
        "variables": [
            {
                "id": "VAREGR",
                "text": "varegruppe",
                "time": false,
                "sample": [
                    {
                        "id": "000000",
                        "text": "00 Forbrugerprisindekset i alt"
                    },
                    {
                        "id": "010000",
                        "text": "01 Fødevarer og ikke-alkoholiske drikkevarer"
                    },
                    {
                        "id": "011000",
                        "text": "01.1 Fødevarer"
                    },
                    {
                        "id": "011100",
                        "text": "01.1.1 Brød og kornprodukter"
                    },
                    {
                        "id": "011110",
                        "text": "01.1.1.1 Ris"
                    }
                ],
                "elimination": true,
                "values_count": 385
            },
            {
                "id": "ENHED",
                "text": "enhed",
                "time": false,
                "sample": [
                    {
                        "id": "100",
                        "text": "Indeks"
                    },
                    {
                     
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — API metadata

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

**Response:**
```json
{
    "data": {
        "api": "Statistics Denmark (Statbank) API",
        "notes": "Live data straight from Statistics Denmark's Statbank; CPI updates monthly. Decimal comma normalised to point.",
        "units": {
            "100": "Index",
            "200": "Change vs previous month (%)",
            "300": "Change vs same month previous year (%)"
        },
        "source": "Statistics Denmark — Statbank REST API (api.statbank.dk/v1)",
        "country": "Denmark",
        "endpoints": [
            "/v1/cpi",
            "/v1/cpi/series",
            "/v1/cpi/groups",
            "/v1/table",
            "/v1/meta"
        ],
        "documentation": "https://denmark-stats-api.oanor.dev",
        "primary_table": "PRIS111 — Consumer Price Index (monthly, COICOP, base 2015=100)"
    },
    "meta": {
        "timestamp": "2026-06-15T20:41:05.766Z",
        "request_id": "8f347247-1e2b-4338-917c-78d9bb43252c"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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