# FX Drawdown API
> A live forex risk analytic that measures the worst peak-to-trough decline a currency pair has suffered, computed from European Central Bank daily reference rates. For any pair it returns the maximum drawdown over the period — the deepest drop from a high to a later low, with the dates it happened — how far the pair is currently below its period high, and whether it has recovered. Get a pair's drawdown over a month, quarter, half-year or year, or scan a basket to rank pairs by worst-case risk. Position-sizing and risk input for forex, trading and research apps. Live, no key. Distinct from rate, strength, volatility, correlation, signal, range and seasonality APIs.

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

## Pricing
- **Free** (Free) — 360 calls/Mo, 3 req/s
- **Trader** ($11/Mo) — 9,400 calls/Mo, 10 req/s
- **Pro** ($25/Mo) — 46,500 calls/Mo, 25 req/s
- **Business** ($56/Mo) — 232,000 calls/Mo, 45 req/s

## Endpoints

### Drawdown

#### `GET /v1/drawdown` — A pair's max + current drawdown

**Parameters:**
- `base` (query, required, string) — Base currency Example: `EUR`
- `quote` (query, required, string) — Quote currency Example: `USD`
- `period` (query, optional, string) — 1m | 3m | 6m | 1y Example: `1y`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fxdrawdown-api/v1/drawdown?base=EUR&quote=USD&period=1y"
```

**Response:**
```json
{
    "data": {
        "base": "EUR",
        "pair": "EURUSD",
        "quote": "USD",
        "period": "1y",
        "current": 1.154,
        "to_date": "2026-06-08",
        "from_date": "2025-06-05",
        "peak_date": "2026-01-28",
        "recovered": false,
        "peak_value": 1.1974,
        "trough_date": "2026-03-13",
        "observations": 257,
        "trough_value": 1.1476,
        "max_drawdown_pct": -4.16,
        "current_drawdown_pct": -3.62
    },
    "meta": {
        "timestamp": "2026-06-09T03:03:06.698Z",
        "request_id": "9cd56537-e4c0-4ed5-9b5a-865f34136f93"
    },
    "status": "ok",
    "message": "Drawdown retrieved successfully",
    "success": true
}
```

#### `GET /v1/scan` — Scan a basket ranked by drawdown

**Parameters:**
- `base` (query, optional, string) — Base currency Example: `USD`
- `period` (query, optional, string) — 1m | 3m | 6m | 1y Example: `1y`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fxdrawdown-api/v1/scan?base=USD&period=1y"
```

**Response:**
```json
{
    "data": {
        "base": "USD",
        "as_of": "2026-06-08",
        "count": 7,
        "pairs": [
            {
                "pair": "USDAUD",
                "quote": "AUD",
                "recovered": false,
                "max_drawdown_pct": -11.99,
                "current_drawdown_pct": -9.73
            },
            {
                "pair": "USDNZD",
                "quote": "NZD",
                "recovered": false,
                "max_drawdown_pct": -7.82,
                "current_drawdown_pct": -3.9
            },
            {
                "pair": "USDCHF",
                "quote": "CHF",
                "recovered": false,
                "max_drawdown_pct": -6.76,
                "current_drawdown_pct": -3.22
            },
            {
                "pair": "USDGBP",
                "quote": "GBP",
                "recovered": false,
                "max_drawdown_pct": -5.59,
                "current_drawdown_pct": -2.38
            },
            {
                "pair": "USDEUR",
                "quote": "EUR",
                "recovered": false,
                "max_drawdown_pct": -4.76,
                "current_drawdown_pct": -1.18
            },
            {
                "pair": "USDCAD",
                "quote": "CAD",
                "recovered": false,
                "max_drawdown_pct": -4.28,
                "current_drawdown_pct": -1.37
            },
            {
                "pair": "USDJPY",
                "quote"
…(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/fxdrawdown-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "as_of": "2026-06-08",
        "source": "ECB daily reference rates via Frankfurter (live)",
        "periods": [
            "1m",
            "3m",
            "6m",
            "1y"
        ],
        "service": "fxdrawdown-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/scan": "Scan a basket vs a base, ranked by worst drawdown (base=USD, period=).",
            "GET /v1/drawdown": "A pair's max drawdown + current drawdown (base=EUR&quote=USD, period=1m|3m|6m|1y)."
        },
        "description": "Live FX drawdown (worst-case risk) analytic from ECB reference rates (Frankfurter): for any currency pair, the maximum peak-to-trough decline over the period (with dates), the current drawdown from the period high, and whether it has recovered. Get a pair's drawdown or scan a basket by risk. Live, no key. Distinct from rate, strength, volatility, correlation, signal, range and seasonality APIs.",
        "scan_basket": [
            "USD",
            "EUR",
            "JPY",
            "GBP",
            "AUD",
            "CAD",
            "CHF",
            "NZD"
        ]
    },
    "meta": {
        "timestamp": "2026-06-09T03:03:07.013Z",
        "request_id": "24ae4bbe-f083-4ffb-bf0e-514ac0ce9ff7"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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