# FX Range API
> A live forex analytic that tells you where a currency pair is trading inside its recent range, computed from European Central Bank daily reference rates. For any pair it returns the period high and low (and the dates they happened), the current rate, and the percentile position in the range (0% = sitting on the low, 100% = sitting on the high) plus the distance from each extreme — the context traders use for mean-reversion and breakout calls. Get a pair's range over a month, quarter, half-year or year, or scan a basket to find what is pinned near its highs or lows. Built for forex, trading and dashboard apps. Live, no key. Distinct from rate, strength, volatility, correlation and signal 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/fxrange-api/..."
```

## Pricing
- **Free** (Free) — 350 calls/Mo, 3 req/s
- **Trader** ($11/Mo) — 10,500 calls/Mo, 10 req/s
- **Pro** ($23/Mo) — 52,000 calls/Mo, 25 req/s
- **Business** ($54/Mo) — 265,000 calls/Mo, 45 req/s

## Endpoints

### Range

#### `GET /v1/range` — A pair's high/low/current/percentile

**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/fxrange-api/v1/range?base=EUR&quote=USD&period=1y"
```

**Response:**
```json
{
    "data": {
        "low": 1.1404,
        "base": "EUR",
        "high": 1.1974,
        "pair": "EURUSD",
        "quote": "USD",
        "period": "1y",
        "current": 1.154,
        "to_date": "2026-06-08",
        "low_date": "2025-08-01",
        "from_date": "2025-06-05",
        "high_date": "2026-01-28",
        "observations": 257,
        "pct_above_low": 1.19,
        "pct_below_high": -3.62,
        "percentile_pct": 23.86
    },
    "meta": {
        "timestamp": "2026-06-09T03:03:20.606Z",
        "request_id": "3d9b31e6-ccc4-44d2-b13e-f0c18c4ab6ef"
    },
    "status": "ok",
    "message": "Range retrieved successfully",
    "success": true
}
```

#### `GET /v1/scan` — Scan a basket for range position

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

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

**Response:**
```json
{
    "data": {
        "base": "USD",
        "as_of": "2026-06-08",
        "count": 7,
        "pairs": [
            {
                "low": 142.845047,
                "high": 159.965338,
                "pair": "USDJPY",
                "quote": "JPY",
                "current": 159.965338,
                "percentile_pct": 100
            },
            {
                "low": 0.835143,
                "high": 0.876885,
                "pair": "USDEUR",
                "quote": "EUR",
                "current": 0.866551,
                "percentile_pct": 75.24
            },
            {
                "low": 1.35244,
                "high": 1.412983,
                "pair": "USDCAD",
                "quote": "CAD",
                "current": 1.393674,
                "percentile_pct": 68.11
            },
            {
                "low": 0.723763,
                "high": 0.76662,
                "pair": "USDGBP",
                "quote": "GBP",
                "current": 0.748354,
                "percentile_pct": 57.38
            },
            {
                "low": 1.63624,
                "high": 1.784722,
                "pair": "USDNZD",
                "quote": "NZD",
                "current": 1.715078,
                "percentile_pct": 53.1
            },
            {
                "low": 0.767025,
                "high": 0.822619,
                "pair": "USDCHF",
                "quote": "CHF",
                "current": 0.796101,
            
…(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/fxrange-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": "fxrange-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/scan": "Scan a basket vs a base for range position (base=USD, period=, near=high|low).",
            "GET /v1/range": "A pair's high/low/current/percentile in its range (base=EUR&quote=USD, period=1m|3m|6m|1y)."
        },
        "description": "Live FX range-position analytic from ECB reference rates (Frankfurter): for any currency pair, the period high/low (with dates), current rate, and percentile position in the range (0%=on the low, 100%=on the high) plus distance from each extreme. Get a pair's range or scan a basket for what's near its highs/lows. Live, no key. Distinct from rate, strength, volatility, correlation and signal APIs.",
        "scan_basket": [
            "USD",
            "EUR",
            "JPY",
            "GBP",
            "AUD",
            "CAD",
            "CHF",
            "NZD"
        ]
    },
    "meta": {
        "timestamp": "2026-06-09T03:03:20.816Z",
        "request_id": "67bc6d43-b5a3-43a5-9f48-19dc338a08e3"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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