# Czech National Bank (CNB) FX API
> Live official Czech foreign-exchange fixing, served straight from the Czech National Bank's open API — no key, nothing cached. The CNB declares one official rate per currency every working day. The rates endpoint returns the whole daily fixing — around 30 world currencies against the koruna (CZK), each with the country, the unit amount it is quoted per and the rate — and accepts a date so you can pull the official fixing for any past working day. The currency endpoint returns one currency's rate, normalised to the koruna value of a single unit, for the latest day or a chosen date — the US dollar fixed around 21 koruna in mid-2026. The convert endpoint turns an amount from any currency into any other, crossed through the koruna at the official fixing, on the latest day or a historical date. The history endpoint returns a currency's official rate over the last several working days. Everything is the central bank's own published fixing, live, nothing stored. This is the Czech koruna FX layer for any forex, payments, e-commerce, accounting or treasury app operating in Czechia and Central Europe — and a clean source of historical FX by date. Distinct from the ECB, Fed, Bank of Canada, Norges Bank, Bank of England, Brazil and Poland central-bank APIs — this is the koruna and the CNB daily fixing, queryable by date. 5 endpoints, no key on our side.

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

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 30,000 calls/Mo, 6 req/s
- **Pro** ($23/Mo) — 170,000 calls/Mo, 15 req/s
- **Mega** ($56/Mo) — 900,000 calls/Mo, 40 req/s

## Endpoints

### CNB

#### `GET /v1/convert` — Convert between currencies via CZK

**Parameters:**
- `from` (query, required, string) — Source currency Example: `USD`
- `to` (query, required, string) — Target currency Example: `EUR`
- `amount` (query, optional, string) — Amount (default 1) Example: `100`
- `date` (query, optional, string) — YYYY-MM-DD (optional)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cnb-api/v1/convert?from=USD&to=EUR&amount=100"
```

**Response:**
```json
{
    "data": {
        "to": "EUR",
        "via": "CZK",
        "from": "USD",
        "note": "crossed through CZK at the CNB official fixing",
        "rate": 0.866749,
        "amount": 100,
        "result": 86.674917,
        "source": "Česká národní banka",
        "to_czk": 24.24,
        "from_czk": 21.01,
        "valid_for": "2026-06-08"
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:19.897Z",
        "request_id": "a1ca005d-507e-4c87-b5cf-a40c18f716c8"
    },
    "status": "ok",
    "message": "Conversion retrieved successfully",
    "success": true
}
```

#### `GET /v1/currency` — One currency rate (latest or by date)

**Parameters:**
- `code` (query, required, string) — Currency code Example: `USD`
- `date` (query, optional, string) — YYYY-MM-DD for a past working day

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cnb-api/v1/currency?code=USD"
```

**Response:**
```json
{
    "data": {
        "base": "CZK",
        "code": "USD",
        "note": "USD in CZK: 1 USD = unit_rate CZK",
        "rate": 21.01,
        "amount": 1,
        "source": "Česká národní banka",
        "country": "USA",
        "currency": "dollar",
        "unit_rate": 21.01,
        "valid_for": "2026-06-08"
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:20.037Z",
        "request_id": "c9db97bc-2480-491e-84a9-a4c2c3d6833c"
    },
    "status": "ok",
    "message": "Currency retrieved successfully",
    "success": true
}
```

#### `GET /v1/history` — A currency rate over recent days

**Parameters:**
- `code` (query, required, string) — Currency code Example: `USD`
- `days` (query, optional, string) — Calendar days back (1-21, default 7) Example: `7`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cnb-api/v1/history?code=USD&days=7"
```

**Response:**
```json
{
    "data": {
        "base": "CZK",
        "code": "USD",
        "count": 4,
        "source": "Česká národní banka",
        "history": [
            {
                "date": "2026-06-03",
                "unit_rate": 20.829
            },
            {
                "date": "2026-06-04",
                "unit_rate": 20.81
            },
            {
                "date": "2026-06-05",
                "unit_rate": 20.759
            },
            {
                "date": "2026-06-08",
                "unit_rate": 21.01
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:20.388Z",
        "request_id": "0f4b171d-0795-4f15-bc97-6e191fedc1db"
    },
    "status": "ok",
    "message": "History retrieved successfully",
    "success": true
}
```

#### `GET /v1/rates` — CNB daily fixing (all currencies)

**Parameters:**
- `date` (query, optional, string) — YYYY-MM-DD for a past working day

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

**Response:**
```json
{
    "data": {
        "base": "CZK",
        "note": "rate = CZK per `amount` units of the currency; unit_rate = CZK per 1 unit",
        "count": 30,
        "rates": [
            {
                "code": "AUD",
                "rate": 14.856,
                "amount": 1,
                "country": "Australia",
                "currency": "dollar",
                "unit_rate": 14.856
            },
            {
                "code": "BRL",
                "rate": 4.082,
                "amount": 1,
                "country": "Brazil",
                "currency": "real",
                "unit_rate": 4.082
            },
            {
                "code": "CAD",
                "rate": 15.079,
                "amount": 1,
                "country": "Canada",
                "currency": "dollar",
                "unit_rate": 15.079
            },
            {
                "code": "CNY",
                "rate": 3.098,
                "amount": 1,
                "country": "China",
                "currency": "renminbi",
                "unit_rate": 3.098
            },
            {
                "code": "DKK",
                "rate": 3.243,
                "amount": 1,
                "country": "Denmark",
                "currency": "krone",
                "unit_rate": 3.243
            },
            {
                "code": "EUR",
                "rate": 24.24,
                "amount": 1,
                "country": "EMU",
                "currency": "euro
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Spec

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

**Response:**
```json
{
    "data": {
        "source": "Česká národní banka cnbapi (live)",
        "service": "cnb-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/rates": "The CNB daily fixing — all currencies vs CZK (date=YYYY-MM-DD for a past day).",
            "GET /v1/convert": "Convert between any two currencies via CZK (from=USD&to=EUR&amount=100&date=).",
            "GET /v1/history": "A currency's official rate over recent working days (code=USD&days=7).",
            "GET /v1/currency": "One currency's rate (code=USD, date= optional)."
        },
        "description": "Live official Czech foreign-exchange fixing from the Czech National Bank's open API: the whole daily fixing of ~30 world currencies against the koruna (CZK), queryable for any past working day by date; one currency's rate normalised to the koruna value of a single unit; currency conversion between any two currencies crossed through the koruna, on the latest or a historical date; and a currency's official rate over recent working days. Live, no key, nothing stored. Distinct from the ECB, Fed, Bank of Canada, Norges Bank, Bank of England, Brazil and Poland central-bank APIs — this is the koruna and the CNB daily fixing, queryable by date.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:20.660Z",
        "request_id": "4edd7740-6eaa-486f-bb3f-f8e1f7365bba"
    },
    "status": "ok",
    "message": "Meta",
    "success": t
…(truncated, see openapi.json for full schema)
```


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