# FX Z-Score & Mean-Reversion API
> How statistically stretched each currency pair is right now versus its own recent average — the z-score mean-reversion gauge — computed live from Yahoo Finance daily rates (no key, nothing stored). A price alone tells you nothing about whether a pair is cheap or dear; the z-score does: it measures how many standard deviations the current rate sits above or below its rolling mean. A pair two standard deviations above its average is statistically overbought and prone to snap back; two below is oversold. The zscore endpoint returns, for a pair, the current rate, its rolling mean and standard deviation, the z-score, the percent distance from the mean and a plain overbought / oversold label. The screener endpoint scans the major and cross pairs and ranks them by how stretched they are — the most overbought and most oversold at a glance, the mean-reversion opportunity scan. The pairs endpoint lists what is covered. The statistical-stretch / mean-reversion cut for FX — distinct from the FX range, pivot-point, volatility and signals APIs. It answers how far from normal a pair is, not where its support sits or how fast it moves.

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

## Pricing
- **Free** (Free) — 900 calls/Mo, 2 req/s
- **Starter** ($10/Mo) — 22,500 calls/Mo, 6 req/s
- **Pro** ($29/Mo) — 110,000 calls/Mo, 18 req/s
- **Business** ($71/Mo) — 560,000 calls/Mo, 45 req/s

## Endpoints

### Z-Score

#### `GET /v1/zscore` — Z-score, mean, std-dev and overbought/oversold label for one pair

**Parameters:**
- `pair` (query, required, string) — FX pair (see /v1/pairs) Example: `EURUSD`
- `window` (query, optional, string) — Rolling window in trading days (20-250) Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fxzscore-api/v1/zscore?pair=EURUSD&window=100"
```

**Response:**
```json
{
    "data": {
        "base": "EUR",
        "mean": 1.169,
        "note": "z_score = (current rate - rolling mean) / rolling standard deviation over window_days. Above +2 is statistically overbought (stretched high, mean-reversion expects a pullback); below -2 is oversold. Sample standard deviation. Not financial advice.",
        "pair": "EURUSD",
        "rate": 1.15808,
        "quote": "USD",
        "signal": "neutral / fair value",
        "source": "Yahoo Finance",
        "std_dev": 0.01254,
        "z_score": -0.87,
        "window_low": 1.14351,
        "window_days": 100,
        "window_high": 1.20176,
        "observations": 100,
        "pct_from_mean": -0.93
    },
    "meta": {
        "timestamp": "2026-06-12T10:35:26.417Z",
        "request_id": "e8479c4b-a8d8-48d6-b651-3171cce3a764"
    },
    "status": "ok",
    "message": "Z-score retrieved successfully",
    "success": true
}
```

### Screener

#### `GET /v1/screener` — Major/cross pairs ranked by absolute z-score

**Parameters:**
- `window` (query, optional, string) — Rolling window (20-250) Example: `100`
- `pairs` (query, optional, string) — Optional comma list to restrict scan Example: `EURUSD,USDCAD,GBPJPY`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fxzscore-api/v1/screener?window=100&pairs=EURUSD%2CUSDCAD%2CGBPJPY"
```

**Response:**
```json
{
    "data": {
        "note": "Major and cross FX pairs ranked by absolute z-score (most statistically stretched first). A high positive z-score is overbought (mean-reversion expects a fall); a low negative one is oversold. Use most_stretched for the headline opportunities.",
        "pairs": [
            {
                "base": "USD",
                "mean": 1.37257,
                "pair": "USDCAD",
                "rate": 1.39825,
                "quote": "CAD",
                "signal": "extremely overbought (mean-reversion: likely to fall)",
                "std_dev": 0.01113,
                "z_score": 2.31,
                "window_low": 1.3492,
                "window_high": 1.39825,
                "observations": 100,
                "pct_from_mean": 1.87
            },
            {
                "base": "GBP",
                "mean": 212.59558,
                "pair": "GBPJPY",
                "rate": 214.808,
                "quote": "JPY",
                "signal": "overbought",
                "std_dev": 2.00443,
                "z_score": 1.1,
                "window_low": 207.728,
                "window_high": 216.05499,
                "observations": 100,
                "pct_from_mean": 1.04
            },
            {
                "base": "EUR",
                "mean": 1.169,
                "pair": "EURUSD",
                "rate": 1.15808,
                "quote": "USD",
                "signal": "neutral / fair value",
                "std_d
…(truncated, see openapi.json for full schema)
```

### Pairs

#### `GET /v1/pairs` — Supported FX pairs

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

**Response:**
```json
{
    "data": {
        "note": "Supported FX pairs (majors and popular crosses). Pass any of these as pair= to /v1/zscore or as a comma list to /v1/screener?pairs=.",
        "count": 25,
        "pairs": [
            {
                "base": "EUR",
                "pair": "EURUSD",
                "quote": "USD"
            },
            {
                "base": "GBP",
                "pair": "GBPUSD",
                "quote": "USD"
            },
            {
                "base": "USD",
                "pair": "USDJPY",
                "quote": "JPY"
            },
            {
                "base": "USD",
                "pair": "USDCHF",
                "quote": "CHF"
            },
            {
                "base": "AUD",
                "pair": "AUDUSD",
                "quote": "USD"
            },
            {
                "base": "USD",
                "pair": "USDCAD",
                "quote": "CAD"
            },
            {
                "base": "NZD",
                "pair": "NZDUSD",
                "quote": "USD"
            },
            {
                "base": "EUR",
                "pair": "EURGBP",
                "quote": "GBP"
            },
            {
                "base": "EUR",
                "pair": "EURJPY",
                "quote": "JPY"
            },
            {
                "base": "GBP",
                "pair": "GBPJPY",
                "quote": "JPY"
            },
            {
                "base": "EUR
…(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/fxzscore-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "pair is a supported FX pair (EURUSD, GBPJPY, ...; see /v1/pairs). window is 20-250 trading days (default 100). z-score uses the sample mean and standard deviation of the window. Read fresh per call, nothing cached.",
        "source": "Yahoo Finance daily FX rates, live",
        "service": "fxzscore-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/pairs": "The supported FX pairs.",
            "GET /v1/zscore": "Z-score, mean, std-dev and overbought/oversold label for one pair (pair=EURUSD, window=100).",
            "GET /v1/screener": "All major/cross pairs ranked by absolute z-score, with overbought/oversold counts (window=100)."
        },
        "description": "FX z-score & mean-reversion — how statistically stretched each currency pair is versus its rolling average, live from Yahoo Finance (no key, nothing stored). zscore returns a pair's current rate, rolling mean and standard deviation, the z-score, percent from mean and an overbought/oversold label. screener ranks the major and cross pairs by how stretched they are. pairs lists what is covered. The statistical-stretch / mean-reversion cut for FX — distinct from the FX range, pivot-point, volatility and signals APIs. It answers how far from normal a pair is.",
        "eurusd_z_score": -0.87,
        "pairs_supported": 25,
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-12T10:35:26.826Z",
        "r
…(truncated, see openapi.json for full schema)
```


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