# FX History API
> Live historical foreign-exchange rates and analytics from the European Central Bank's daily reference rates — no key, nothing cached. Get the daily rate of a currency pair over any date range; the absolute and percentage move between two dates with its high and low; min, max, average, volatility and the best and worst day over a range; and every rate on a specific date. An FX history-and-analytics layer, distinct from spot-conversion feeds — it turns the ECB rate archive into the time series, moves and volatility a trader or analyst studies. Around 30 currencies, weekdays, back to 1999.

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

## Pricing
- **Free** (Free) — 5,400 calls/Mo, 3 req/s
- **Starter** ($6/Mo) — 116,000 calls/Mo, 10 req/s
- **Pro** ($17/Mo) — 560,000 calls/Mo, 25 req/s
- **Business** ($42/Mo) — 3,400,000 calls/Mo, 55 req/s

## Endpoints

### FX History

#### `GET /v1/change` — Absolute & percent move between two dates + high/low

**Parameters:**
- `symbol` (query, required, string) — Quote currency 3-letter code Example: `EUR`
- `start` (query, required, string) — Start date YYYY-MM-DD Example: `2024-01-01`
- `end` (query, optional, string) — End date YYYY-MM-DD (default latest) Example: `2024-12-31`
- `base` (query, optional, string) — Base currency (default USD) Example: `USD`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fxhistory-api/v1/change?symbol=EUR&start=2024-01-01&end=2024-12-31&base=USD"
```

**Response:**
```json
{
    "data": {
        "low": 0.89318,
        "base": "USD",
        "days": 257,
        "high": 0.96256,
        "source": "ECB (Frankfurter)",
        "symbol": "EUR",
        "end_date": "2024-12-31",
        "end_rate": 0.96256,
        "change_abs": 0.05758,
        "change_pct": 6.3626,
        "start_date": "2023-12-29",
        "start_rate": 0.90498,
        "high_low_range_pct": 7.7678
    },
    "meta": {
        "timestamp": "2026-06-10T22:56:19.146Z",
        "request_id": "bd694cac-4daf-42fd-93a6-fd4fee1c234a"
    },
    "status": "ok",
    "message": "Change computed",
    "success": true
}
```

#### `GET /v1/historical` — Every rate on a specific date

**Parameters:**
- `date` (query, required, string) — Date YYYY-MM-DD Example: `2020-03-16`
- `base` (query, optional, string) — Base currency (default USD) Example: `USD`
- `symbols` (query, optional, string) — Comma-separated quote currencies (omit for all) Example: `EUR,GBP,JPY`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fxhistory-api/v1/historical?date=2020-03-16&base=USD&symbols=EUR%2CGBP%2CJPY"
```

**Response:**
```json
{
    "data": {
        "base": "USD",
        "date": "2020-03-16",
        "rates": {
            "EUR": 0.8963,
            "GBP": 0.8149,
            "JPY": 105.55
        },
        "source": "ECB (Frankfurter)"
    },
    "meta": {
        "timestamp": "2026-06-10T22:56:19.244Z",
        "request_id": "ceae0b97-0106-4ab9-b3bb-1c302170b4bd"
    },
    "status": "ok",
    "message": "Historical rates retrieved successfully",
    "success": true
}
```

#### `GET /v1/meta` — Service metadata and endpoint list

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

**Response:**
```json
{
    "data": {
        "source": "ECB reference rates via Frankfurter (api.frankfurter.dev, live)",
        "service": "fxhistory-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/stats": "Min/max/avg/volatility + best & worst day over a range (base=USD, symbol=EUR, start=..., end=...).",
            "GET /v1/change": "Absolute & percent move between two dates + high/low (base=USD, symbol=EUR, start=..., end=...).",
            "GET /v1/historical": "Every rate on a specific date (date=2020-03-16, base=USD, symbols=EUR,GBP optional).",
            "GET /v1/timeseries": "Daily rate of a pair over a range (base=USD, symbol=EUR, start=2024-01-01, end=optional)."
        },
        "description": "Live historical foreign-exchange rates and analytics from the European Central Bank's daily reference rates. The timeseries endpoint returns the daily rate of a currency pair over any date range; the change endpoint returns the absolute and percentage move between two dates with high and low; the stats endpoint returns min, max, average, volatility and the best and worst day over a range; the historical endpoint returns every rate on a specific date. Live from the ECB, nothing stored. An FX history-and-analytics layer, distinct from spot-conversion feeds — it turns the ECB rate archive into the time series, moves and volatility a trader or analyst studies. ~30 currencies, weekdays, back to 1999.",
        "latest_date": "2026-06-10",
    
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/stats` — Min/max/avg/volatility + best & worst day over a range

**Parameters:**
- `symbol` (query, required, string) — Quote currency 3-letter code Example: `EUR`
- `start` (query, required, string) — Start date YYYY-MM-DD Example: `2024-01-01`
- `end` (query, optional, string) — End date YYYY-MM-DD (default latest) Example: `2024-12-31`
- `base` (query, optional, string) — Base currency (default USD) Example: `USD`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fxhistory-api/v1/stats?symbol=EUR&start=2024-01-01&end=2024-12-31&base=USD"
```

**Response:**
```json
{
    "data": {
        "max": 0.96256,
        "min": 0.89318,
        "base": "USD",
        "days": 257,
        "stdev": 0.01493221,
        "source": "ECB (Frankfurter)",
        "symbol": "EUR",
        "average": 0.924053,
        "best_day": {
            "date": "2024-11-06",
            "change_pct": 1.8895
        },
        "end_date": "2024-12-31",
        "worst_day": {
            "date": "2024-08-05",
            "change_pct": -1.194
        },
        "start_date": "2023-12-29",
        "annualized_volatility": 0.06008
    },
    "meta": {
        "timestamp": "2026-06-10T22:56:19.471Z",
        "request_id": "7e3828a5-7f83-463b-9c91-1d12bf4f5b14"
    },
    "status": "ok",
    "message": "Stats computed",
    "success": true
}
```

#### `GET /v1/timeseries` — Daily rate of a pair over a date range

**Parameters:**
- `symbol` (query, required, string) — Quote currency 3-letter code Example: `EUR`
- `start` (query, required, string) — Start date YYYY-MM-DD Example: `2024-01-01`
- `base` (query, optional, string) — Base currency (default USD) Example: `USD`
- `end` (query, optional, string) — End date YYYY-MM-DD (default latest) Example: `2024-01-31`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fxhistory-api/v1/timeseries?symbol=EUR&start=2024-01-01&base=USD&end=2024-01-31"
```

**Response:**
```json
{
    "data": {
        "end": "2024-01-31",
        "base": "USD",
        "count": 23,
        "start": "2024-01-01",
        "series": [
            {
                "date": "2023-12-29",
                "rate": 0.90498
            },
            {
                "date": "2024-01-02",
                "rate": 0.91274
            },
            {
                "date": "2024-01-03",
                "rate": 0.91583
            },
            {
                "date": "2024-01-04",
                "rate": 0.91299
            },
            {
                "date": "2024-01-05",
                "rate": 0.91567
            },
            {
                "date": "2024-01-08",
                "rate": 0.91358
            },
            {
                "date": "2024-01-09",
                "rate": 0.91408
            },
            {
                "date": "2024-01-10",
                "rate": 0.91358
            },
            {
                "date": "2024-01-11",
                "rate": 0.91017
            },
            {
                "date": "2024-01-12",
                "rate": 0.91391
            },
            {
                "date": "2024-01-15",
                "rate": 0.91366
            },
            {
                "date": "2024-01-16",
                "rate": 0.91895
            },
            {
                "date": "2024-01-17",
                "rate": 0.91937
            },
            {
                "date": "2024-01-18",
                "rate
…(truncated, see openapi.json for full schema)
```


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