# National Bank of Hungary FX API
> Live official exchange-rate data from the National Bank of Hungary (Magyar Nemzeti Bank, MNB), the central bank of Hungary, for the forint (HUF) — straight from the MNB's own public SOAP web service, decoded for you as clean JSON. Get the MNB's official daily rate for every published currency against the forint, normalised to one unit; pull a single currency's forint-per-unit rate and its inverse; retrieve a currency's daily MNB rate over any date range from the bank's own time-series method; or convert an amount between any two published currencies (including HUF) cross-computed through the forint. Read live from the MNB, nothing cached. This is the official Hungarian-forint central-bank rate — distinct from the ECB, SNB, BNR, NBU, HNB, NBG, NBRB and other central-bank feeds and from market mid-rates: the Magyar Nemzeti Bank's own published forint rate.

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

## Pricing
- **Free** (Free) — 500 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 25,000 calls/Mo, 8 req/s
- **Pro** ($26/Mo) — 125,000 calls/Mo, 20 req/s
- **Business** ($61/Mo) — 600,000 calls/Mo, 40 req/s

## Endpoints

### Rates

#### `GET /v1/rates` — Official MNB rate for every currency vs the forint

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

**Response:**
```json
{
    "data": {
        "base": "HUF",
        "date": "2026-06-10",
        "count": 32,
        "rates": [
            {
                "unit": 1,
                "value": 215.89,
                "currency": "AUD",
                "huf_per_unit": 215.89
            },
            {
                "unit": 1,
                "value": 59.54,
                "currency": "BRL",
                "huf_per_unit": 59.54
            },
            {
                "unit": 1,
                "value": 221.04,
                "currency": "CAD",
                "huf_per_unit": 221.04
            },
            {
                "unit": 1,
                "value": 385.51,
                "currency": "CHF",
                "huf_per_unit": 385.51
            },
            {
                "unit": 1,
                "value": 45.44,
                "currency": "CNY",
                "huf_per_unit": 45.44
            },
            {
                "unit": 1,
                "value": 14.72,
                "currency": "CZK",
                "huf_per_unit": 14.72
            },
            {
                "unit": 1,
                "value": 47.61,
                "currency": "DKK",
                "huf_per_unit": 47.61
            },
            {
                "unit": 1,
                "value": 355.84,
                "currency": "EUR",
                "huf_per_unit": 355.84
            },
            {
                "unit": 1,
                "value": 412.29,
                "curr
…(truncated, see openapi.json for full schema)
```

### Rate

#### `GET /v1/rate` — One currency's official forint rate and inverse

**Parameters:**
- `currency` (query, required, string) — ISO 4217 currency code Example: `USD`

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

**Response:**
```json
{
    "data": {
        "base": "HUF",
        "date": "2026-06-10",
        "unit": 1,
        "source": "Magyar Nemzeti Bank",
        "currency": "USD",
        "huf_per_unit": 307.98,
        "unit_per_huf": 0.00324696
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:44.153Z",
        "request_id": "f59d1b98-5c91-4354-b199-d2ac7f6c292b"
    },
    "status": "ok",
    "message": "Rate retrieved successfully",
    "success": true
}
```

### History

#### `GET /v1/history` — A currency's daily MNB rate over a date range

**Parameters:**
- `currency` (query, required, string) — ISO 4217 currency code Example: `USD`
- `from` (query, optional, string) — Start date YYYY-MM-DD Example: `2026-05-01`
- `to` (query, optional, string) — End date YYYY-MM-DD Example: `2026-05-31`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mnb-api/v1/history?currency=USD&from=2026-05-01&to=2026-05-31"
```

**Response:**
```json
{
    "data": {
        "to": "2026-05-31",
        "base": "HUF",
        "from": "2026-05-01",
        "count": 19,
        "source": "Magyar Nemzeti Bank",
        "history": [
            {
                "date": "2026-05-04",
                "unit": 1,
                "huf_per_unit": 309.77
            },
            {
                "date": "2026-05-05",
                "unit": 1,
                "huf_per_unit": 311.28
            },
            {
                "date": "2026-05-06",
                "unit": 1,
                "huf_per_unit": 305.55
            },
            {
                "date": "2026-05-07",
                "unit": 1,
                "huf_per_unit": 303
            },
            {
                "date": "2026-05-08",
                "unit": 1,
                "huf_per_unit": 301.89
            },
            {
                "date": "2026-05-11",
                "unit": 1,
                "huf_per_unit": 301.71
            },
            {
                "date": "2026-05-12",
                "unit": 1,
                "huf_per_unit": 303.7
            },
            {
                "date": "2026-05-13",
                "unit": 1,
                "huf_per_unit": 306.96
            },
            {
                "date": "2026-05-14",
                "unit": 1,
                "huf_per_unit": 305.67
            },
            {
                "date": "2026-05-15",
                "unit": 1,
                "huf_per_unit": 309.23
         
…(truncated, see openapi.json for full schema)
```

### Convert

#### `GET /v1/convert` — Convert an amount between two currencies at MNB rates

**Parameters:**
- `from` (query, required, string) — Source currency Example: `USD`
- `to` (query, required, string) — Target currency Example: `EUR`
- `amount` (query, optional, string) — Amount to convert Example: `100`

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

**Response:**
```json
{
    "data": {
        "to": "EUR",
        "date": "2026-06-10",
        "from": "USD",
        "rate": 0.86550135,
        "amount": 100,
        "result": 86.550135,
        "source": "Magyar Nemzeti Bank",
        "huf_per_to": 355.84,
        "huf_per_from": 307.98
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:44.449Z",
        "request_id": "5f8fdc1b-0401-4008-9d09-941a32159cea"
    },
    "status": "ok",
    "message": "Conversion completed successfully",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "date": "2026-06-10",
        "source": "MNB SOAP web service arfolyamok.asmx (mnb.hu, live)",
        "service": "mnb-api",
        "usd_huf": 307.98,
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/rate": "One currency's official rate, forint-per-unit and inverse (currency=USD).",
            "GET /v1/rates": "The MNB official daily rate for every currency vs the forint.",
            "GET /v1/convert": "Convert an amount between two currencies at MNB rates (from=USD, to=EUR, amount=100).",
            "GET /v1/history": "A currency's daily MNB rate over a date range (currency=USD, from=2026-05-01, to=2026-05-31)."
        },
        "description": "Live official exchange-rate data from the National Bank of Hungary (Magyar Nemzeti Bank, MNB), the central bank of Hungary, for the forint (HUF), via the MNB's public SOAP web service. The rates endpoint returns the MNB's official daily rate for every published currency against the forint, normalised to one unit; the rate endpoint returns a single currency's forint-per-unit rate and the inverse; the history endpoint returns a currency's daily MNB rate over a date range from the MNB's own time-series method; the convert endpoint converts an amount between any two published currencies (including HUF) at the MNB's official rates, cross-computed through the forint. Live, no key, nothing stored. Distinct from the ECB, SNB, BNR, NBU, HNB, NBG, NBRB, CBU, CBAR, BOI, NBK,
…(truncated, see openapi.json for full schema)
```


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