# Statistics Sweden (SCB) API
> A gateway to the official Statistics Sweden (SCB) PxWeb data service. Read the latest headline Consumer Price Index and fetch the latest time-series observations for any of the thousands of SCB statistics tables by table path and dimension selections — consumer prices, population, the labour market, national accounts, housing and much more. Every observation carries its reference period, and values always resolve to the latest published release, so there are no dates to hard-code. Built for Swedish macro research, CPI and inflation tracking, and SEK currency or rates models that need authoritative national statistics. Distinct from our OECD, Statistics Canada, ABS and Statistics Norway feeds, and from central-bank FX feeds: this surfaces the official SCB data service for Sweden.

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

## Pricing
- **Free** (Free) — 2,080 calls/Mo, 2 req/s
- **Basic** ($14/Mo) — 53,100 calls/Mo, 6 req/s
- **Pro** ($36/Mo) — 212,000 calls/Mo, 16 req/s
- **Scale** ($80/Mo) — 894,000 calls/Mo, 40 req/s

## Endpoints

### Indicators

#### `GET /v1/cpi` — Latest headline Consumer Price Index

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

**Response:**
```json
{
    "data": {
        "unit": "index",
        "value": 417.96,
        "period": "2025M12",
        "source": "Statistics Sweden (SCB)",
        "country": "Sweden",
        "indicator": "Consumer Price Index (CPI), fixed index numbers (1980=100)"
    },
    "meta": {
        "timestamp": "2026-06-15T11:14:49.667Z",
        "request_id": "73eba9af-be98-4926-b036-9a4879886cfc"
    },
    "status": "ok",
    "message": "CPI retrieved successfully",
    "success": true
}
```

### Data

#### `GET /v1/series` — Latest observations for any SCB table

**Parameters:**
- `path` (query, required, string) — SCB table path Example: `PR/PR0101/PR0101A/KPItotM`
- `select` (query, required, string) — Dimension selections Code:Value;Code:Value Example: `ContentsCode:000004VU`
- `periods` (query, optional, string) — Number of recent periods (1-60) Example: `12`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/scb-api/v1/series?path=PR%2FPR0101%2FPR0101A%2FKPItotM&select=ContentsCode%3A000004VU&periods=12"
```

**Response:**
```json
{
    "data": {
        "path": "PR/PR0101/PR0101A/KPItotM",
        "count": 12,
        "label": "CPI, Fixed Index numbers by observations and month",
        "source": "Statistics Sweden (SCB)",
        "observations": [
            {
                "value": 417.96,
                "period": "2025M12",
                "period_code": "2025M12"
            },
            {
                "value": 417.83,
                "period": "2025M11",
                "period_code": "2025M11"
            },
            {
                "value": 419.35,
                "period": "2025M10",
                "period_code": "2025M10"
            },
            {
                "value": 418.26,
                "period": "2025M09",
                "period_code": "2025M09"
            },
            {
                "value": 418.13,
                "period": "2025M08",
                "period_code": "2025M08"
            },
            {
                "value": 419.75,
                "period": "2025M07",
                "period_code": "2025M07"
            },
            {
                "value": 418.94,
                "period": "2025M06",
                "period_code": "2025M06"
            },
            {
                "value": 416.95,
                "period": "2025M05",
                "period_code": "2025M05"
            },
            {
                "value": 416.69,
                "period": "2025M04",
                "period_code": "2025M04"
            },
            {
  
…(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/scb-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "name": "Statistics Sweden (SCB) API",
        "note": "For /v1/series choose selections so only the time dimension varies (one value per non-time dimension) to get a clean one-value-per-period series.",
        "source": "Statistics Sweden PxWeb API (api.scb.se)",
        "country": "Sweden",
        "endpoints": [
            {
                "path": "/v1/cpi",
                "description": "Latest headline Consumer Price Index (1980=100)"
            },
            {
                "path": "/v1/series",
                "description": "Latest observations for any table (?path=PR/PR0101/PR0101A/KPItotM&select=ContentsCode:000004VU&periods=12)"
            },
            {
                "path": "/v1/meta",
                "description": "This metadata document"
            }
        ],
        "disclaimer": "Unofficial proxy of the public Statistics Sweden PxWeb API. Not affiliated with SCB. Data only; refer to SCB for authoritative figures.",
        "description": "A gateway to the official Statistics Sweden (SCB) PxWeb data service. Read the latest headline Consumer Price Index, and fetch the latest time-series observations for any SCB statistics table by its table path and dimension selections. Values always resolve to the latest published period."
    },
    "meta": {
        "timestamp": "2026-06-15T11:14:50.357Z",
        "request_id": "94863fcd-4329-4833-94f1-e20ec14e4659"
    },
    "status": "ok",
    "message": "Meta",
    "success": tr
…(truncated, see openapi.json for full schema)
```


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