# Crypto Pairs Trading & Spread API
> The statistical-arbitrage signal between two coins — how stretched their price ratio is versus its own recent average, computed live from Binance daily candles (no key, nothing stored). Pairs traders do not bet on direction; they bet on the spread between two correlated coins reverting to its mean. When ETH/BTC (or any ratio) runs two standard deviations above its average, the spread is stretched — short the rich leg, long the cheap one, and profit when it snaps back. The spread endpoint takes two coins and returns the current price ratio, its rolling mean and standard deviation, the z-score (how many standard deviations stretched), the return correlation of the two coins (pairs trading works on correlated pairs) and a long/short mean-reversion signal. The screener endpoint scans every pair in a liquid basket and ranks them by absolute z-score — the most stretched, most tradeable spreads right now. The coins endpoint lists what is covered. The pairs-trading / relative-value spread cut for crypto — distinct from the correlation-&-beta API (which gives the correlation matrix, not the tradeable spread), the single-coin momentum, the funding-arbitrage and the price APIs. It answers whether a spread is stretched, not whether two coins move together.

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

## Pricing
- **Free** (Free) — 640 calls/Mo, 2 req/s
- **Starter** ($12/Mo) — 16,400 calls/Mo, 6 req/s
- **Pro** ($35/Mo) — 86,500 calls/Mo, 18 req/s
- **Business** ($82/Mo) — 455,000 calls/Mo, 45 req/s

## Endpoints

### Spread

#### `GET /v1/spread` — Two coins ratio z-score, correlation and mean-reversion signal

**Parameters:**
- `a` (query, required, string) — First coin (numerator) Example: `ETH`
- `b` (query, required, string) — Second coin (denominator) Example: `BTC`
- `window` (query, optional, string) — Lookback in days (20-365) Example: `90`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cryptopairs-api/v1/spread?a=ETH&b=BTC&window=90"
```

**Response:**
```json
{
    "data": {
        "base": "ETH",
        "mean": 0.02923691,
        "note": "z_score = (current ratio - rolling mean) / rolling std-dev of the ETH/BTC price ratio. |z|>=2 is a stretched spread (mean-reversion setup); correlation is the return correlation of the two coins (pairs trading works best on highly correlated pairs). Not financial advice.",
        "pair": "ETH/BTC",
        "quote": "BTC",
        "ratio": 0.02629968,
        "action": "mildly cheap: watch for a long-ETH / short-BTC setup",
        "signal": "lean_long",
        "source": "Binance",
        "std_dev": 0.00160348,
        "z_score": -1.83,
        "window_low": 0.02578139,
        "correlation": 0.906,
        "window_days": 90,
        "window_high": 0.03183988,
        "observations": 91
    },
    "meta": {
        "timestamp": "2026-06-12T10:35:19.991Z",
        "request_id": "b173f89e-1008-448a-97f6-d1a6e46a3dc5"
    },
    "status": "ok",
    "message": "Spread retrieved successfully",
    "success": true
}
```

### Screener

#### `GET /v1/screener` — Every pair in a basket ranked by absolute z-score

**Parameters:**
- `window` (query, optional, string) — Lookback in days (20-365) Example: `90`
- `coins` (query, optional, string) — Optional basket (2-15 coins) Example: `BTC,ETH,SOL,AVAX`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cryptopairs-api/v1/screener?window=90&coins=BTC%2CETH%2CSOL%2CAVAX"
```

**Response:**
```json
{
    "data": {
        "note": "Every pair in the basket ranked by absolute z-score of its price ratio — the most stretched (most tradeable) spreads first. A high |z| with a high correlation is the classic mean-reversion pairs-trade setup. Default basket is 12 liquid majors (66 pairs); pass coins=BTC,ETH,... to customise.",
        "coins": 4,
        "pairs": [
            {
                "base": "SOL",
                "pair": "SOL/AVAX",
                "quote": "AVAX",
                "signal": "short_spread",
                "z_score": 3.33,
                "correlation": 0.906
            },
            {
                "base": "BTC",
                "pair": "BTC/AVAX",
                "quote": "AVAX",
                "signal": "short_spread",
                "z_score": 2.68,
                "correlation": 0.822
            },
            {
                "base": "BTC",
                "pair": "BTC/ETH",
                "quote": "ETH",
                "signal": "lean_short",
                "z_score": 1.93,
                "correlation": 0.906
            },
            {
                "base": "BTC",
                "pair": "BTC/SOL",
                "quote": "SOL",
                "signal": "lean_short",
                "z_score": 1.52,
                "correlation": 0.878
            },
            {
                "base": "ETH",
                "pair": "ETH/AVAX",
                "quote": "AVAX",
                "signal": "lean_short",
                "z_sco
…(truncated, see openapi.json for full schema)
```

### Coins

#### `GET /v1/coins` — Supported coins

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

**Response:**
```json
{
    "data": {
        "note": "Supported coins (Binance USDT pairs). Pass any two as a= and b= to /v1/spread, or a comma list as coins= to /v1/screener.",
        "coins": [
            "BTC",
            "ETH",
            "SOL",
            "XRP",
            "BNB",
            "DOGE",
            "ADA",
            "AVAX",
            "LINK",
            "DOT",
            "LTC",
            "BCH",
            "TRX",
            "NEAR",
            "ATOM",
            "UNI",
            "FIL",
            "ETC",
            "XLM",
            "APT",
            "INJ",
            "OP",
            "ARB",
            "SUI",
            "AAVE"
        ],
        "count": 25,
        "source": "Binance",
        "default_basket": [
            "BTC",
            "ETH",
            "SOL",
            "XRP",
            "BNB",
            "DOGE",
            "ADA",
            "AVAX",
            "LINK",
            "DOT",
            "LTC",
            "BCH"
        ]
    },
    "meta": {
        "timestamp": "2026-06-12T10:35:20.490Z",
        "request_id": "39e0b013-0524-491b-a87d-9abbc28cba3c"
    },
    "status": "ok",
    "message": "Coins retrieved successfully",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "note": "spread takes a= and b= (any two supported coins). window is 20-365 days (default 90). z-score is on the price-ratio series. screener default basket is 12 majors (66 pairs). Read fresh per call, nothing cached.",
        "source": "Binance daily klines (USDT pairs), live",
        "service": "cryptopairs-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/coins": "The supported coins.",
            "GET /v1/spread": "Two coins' ratio z-score, correlation and mean-reversion signal (a=ETH, b=BTC, window=90).",
            "GET /v1/screener": "Every pair in a basket ranked by absolute z-score, most stretched first (window=90)."
        },
        "description": "Crypto pairs trading & spread — the statistical-arbitrage signal between two coins: how stretched their price ratio is versus its rolling average, live from Binance (no key, nothing stored). spread returns the ratio, its mean/std-dev, the z-score, the coins' correlation and a long/short mean-reversion signal. screener ranks every pair in a basket by absolute z-score. coins lists the universe. The pairs-trading / relative-value spread cut for crypto — distinct from the correlation-&-beta API (the matrix, not the tradeable spread), single-coin momentum, funding-arbitrage and price APIs.",
        "coins_supported": 25,
        "eth_btc_z_score": -1.83,
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-12T10:35:2
…(truncated, see openapi.json for full schema)
```


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