# Iceland Statistics API
> Official Icelandic statistics from Statistics Iceland (Hagstofa Íslands) as a clean, keyless JSON API. Get the latest Icelandic consumer price index and inflation — index level, month-on-month and year-on-year change for both the headline CPI and CPI-less-housing (base 1988=100) — pull any table in the Hagstofa PxWeb catalogue as a tidy time-series (economy, industries, population, society, environment) without wrestling with the json-stat2 format, inspect a table's variables and value codes, and browse the database tree. A thin gateway over Statistics Iceland's public PxWeb API: you supply a table path and optional dimension selection, we return the latest periods as plain period/value rows. Ideal for inflation trackers, economic dashboards and Nordic macro research.

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

## Pricing
- **Free** (Free) — 2,400 calls/Mo, 3 req/s
- **Basic** ($12/Mo) — 49,600 calls/Mo, 10 req/s
- **Pro** ($30/Mo) — 198,500 calls/Mo, 25 req/s
- **Mega** ($68/Mo) — 817,000 calls/Mo, 60 req/s

## Endpoints

### Inflation

#### `GET /v1/cpi` — Latest Icelandic CPI and inflation

**Parameters:**
- `index` (query, optional, string) — CPI or CPILH (less housing) Example: `CPI`
- `periods` (query, optional, string) — Number of recent months (1-60) Example: `12`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/iceland-stats-api/v1/cpi?index=CPI&periods=12"
```

**Response:**
```json
{
    "data": {
        "base": "1988=100",
        "latest": {
            "month": "2026M05",
            "index_value": 684.3,
            "change_annual_pct": 5.1,
            "change_monthly_pct": 0.07
        },
        "series": [
            {
                "month": "2026M05",
                "index_value": 684.3,
                "change_annual_pct": 5.1,
                "change_monthly_pct": 0.07
            },
            {
                "month": "2026M04",
                "index_value": 683.8,
                "change_annual_pct": 5.2,
                "change_monthly_pct": 0.81
            },
            {
                "month": "2026M03",
                "index_value": 678.3,
                "change_annual_pct": 5.4,
                "change_monthly_pct": 0.55
            },
            {
                "month": "2026M02",
                "index_value": 674.6,
                "change_annual_pct": 5.2,
                "change_monthly_pct": 0.94
            },
            {
                "month": "2026M01",
                "index_value": 668.3,
                "change_annual_pct": 5.2,
                "change_monthly_pct": 0.38
            },
            {
                "month": "2025M12",
                "index_value": 665.8,
                "change_annual_pct": 4.5,
                "change_monthly_pct": 1.15
            },
            {
                "month": "2025M11",
                "index_value": 658.2,
                "change_annual_pct": 3.7,
    
…(truncated, see openapi.json for full schema)
```

### Data

#### `GET /v1/series` — Any PxWeb table as a time-series

**Parameters:**
- `path` (query, required, string) — PxWeb table path (ends in .px) Example: `Efnahagur/visitolur/1_vnv/1_vnv/VIS01000.px`
- `select` (query, optional, string) — Dimension constraints "Code:Value;Code:Value" Example: `Index:CPI`
- `periods` (query, optional, string) — Recent periods (1-120) Example: `12`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/iceland-stats-api/v1/series?path=Efnahagur%2Fvisitolur%2F1_vnv%2F1_vnv%2FVIS01000.px&select=Index%3ACPI&periods=12"
```

**Response:**
```json
{
    "data": {
        "path": "Efnahagur/visitolur/1_vnv/1_vnv/VIS01000.px",
        "title": "Consumer price index by Month, Index and Item",
        "series": [
            {
                "value": 684.3,
                "period": "2026M05"
            },
            {
                "value": 683.8,
                "period": "2026M04"
            },
            {
                "value": 678.3,
                "period": "2026M03"
            },
            {
                "value": 674.6,
                "period": "2026M02"
            },
            {
                "value": 668.3,
                "period": "2026M01"
            },
            {
                "value": 665.8,
                "period": "2025M12"
            },
            {
                "value": 658.2,
                "period": "2025M11"
            },
            {
                "value": 661.4,
                "period": "2025M10"
            },
            {
                "value": 658.3,
                "period": "2025M09"
            },
            {
                "value": 657.6,
                "period": "2025M08"
            },
            {
                "value": 658.6,
                "period": "2025M07"
            },
            {
                "value": 656.5,
                "period": "2025M06"
            }
        ],
        "constrained": {
            "Item": {
                "pos": 0,
                "code": "index",
                "label": "Index"
            },
       
…(truncated, see openapi.json for full schema)
```

### Catalog

#### `GET /v1/databases` — Browse the database tree

**Parameters:**
- `path` (query, optional, string) — Sub-path to list (omit for root) Example: `Efnahagur`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/iceland-stats-api/v1/databases?path=Efnahagur"
```

**Response:**
```json
{
    "data": {
        "path": "Efnahagur",
        "count": 6,
        "items": [
            {
                "id": "fjaropinber",
                "text": "Public finance",
                "type": "l"
            },
            {
                "id": "thjodhagsreikningar",
                "text": "National accounts",
                "type": "l"
            },
            {
                "id": "thjodhagsspa",
                "text": "Economic forecast",
                "type": "l"
            },
            {
                "id": "utanrikisverslun",
                "text": "External trade",
                "type": "l"
            },
            {
                "id": "vinnumagnogframleidni",
                "text": "Employment and labour productivity",
                "type": "l"
            },
            {
                "id": "visitolur",
                "text": "Prices and consumption",
                "type": "l"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-15T11:14:46.300Z",
        "request_id": "6ad108e9-3f37-484c-89c5-065fbc27b417"
    },
    "status": "ok",
    "message": "Databases retrieved successfully",
    "success": true
}
```

#### `GET /v1/table` — Table metadata (variables and value codes)

**Parameters:**
- `path` (query, required, string) — PxWeb table path (ends in .px) Example: `Efnahagur/visitolur/1_vnv/1_vnv/VIS01000.px`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/iceland-stats-api/v1/table?path=Efnahagur%2Fvisitolur%2F1_vnv%2F1_vnv%2FVIS01000.px"
```

**Response:**
```json
{
    "data": {
        "path": "Efnahagur/visitolur/1_vnv/1_vnv/VIS01000.px",
        "title": "Consumer price index and changes, base 1988=100",
        "variables": [
            {
                "code": "Month",
                "text": "Month",
                "time": true,
                "n_values": 457,
                "sample_values": [
                    {
                        "code": "2026M01",
                        "text": "2026M01"
                    },
                    {
                        "code": "2026M02",
                        "text": "2026M02"
                    },
                    {
                        "code": "2026M03",
                        "text": "2026M03"
                    },
                    {
                        "code": "2026M04",
                        "text": "2026M04"
                    },
                    {
                        "code": "2026M05",
                        "text": "2026M05"
                    }
                ]
            },
            {
                "code": "Index",
                "text": "Index",
                "time": false,
                "n_values": 2,
                "sample_values": [
                    {
                        "code": "CPI",
                        "text": "Consumer price index"
                    },
                    {
                        "code": "CPILH",
                        "text": "Consumer price index less housing cost"
                  
…(truncated, see openapi.json for full schema)
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "source": "Statistics Iceland (Hagstofa Íslands)",
        "upstream": "https://px.hagstofa.is/pxen/api/v1/en",
        "cpi_table": "Efnahagur/visitolur/1_vnv/1_vnv/VIS01000.px",
        "databases": [
            "Atvinnuvegir (industries)",
            "Efnahagur (economy)",
            "Ibuar (population)",
            "Samfelag (society)",
            "Umhverfi (environment)"
        ],
        "endpoints": [
            "/v1/cpi",
            "/v1/series",
            "/v1/table",
            "/v1/databases",
            "/v1/meta"
        ],
        "description": "Keyless gateway over Statistics Iceland's PxWeb API. /v1/cpi gives the latest Icelandic consumer price index and inflation; /v1/series pulls any PxWeb table as a clean time-series; /v1/table and /v1/databases discover the catalog.",
        "documentation": "https://iceland-stats-api.oanor.dev"
    },
    "meta": {
        "timestamp": "2026-06-15T11:14:46.531Z",
        "request_id": "dcc89182-a503-42fc-92ab-370d76ec28a2"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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