# Crypto Correlation & Beta API
> How crypto assets move together, computed live from Binance daily candles — no key, nothing stored. Correlation is the single most important input to diversification, pairs trading and risk: two coins with a correlation near 1 are effectively the same bet, while a low or negative correlation is genuine diversification. The matrix endpoint returns the full pairwise return-correlation matrix across a basket of coins over a chosen window, together with the average pairwise correlation — a one-number gauge of how "risk-on, all-together" the market is. The pair endpoint returns the correlation between any two coins, with the R-squared and a plain-language relationship label. The beta endpoint returns each coin's beta to BTC — how much it amplifies (beta above 1) or dampens (beta below 1) Bitcoin's moves — with its correlation and R-squared, the read altcoin traders use to size directional bets. Everything is computed from the standard deviation and covariance of daily log returns. This is the cross-asset correlation / beta analytics cut for crypto — distinct from the FX-correlation API, the single-asset realised-volatility API and the portfolio-optimiser in the catalogue. Coins are Binance bases (BTC, ETH) or full symbols (BTCUSDT); the quote defaults to USDT and the window is 14-365 days.

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

## Pricing
- **Free** (Free) — 450 calls/Mo, 2 req/s
- **Starter** ($11/Mo) — 12,500 calls/Mo, 6 req/s
- **Pro** ($35/Mo) — 70,000 calls/Mo, 16 req/s
- **Business** ($79/Mo) — 360,000 calls/Mo, 40 req/s

## Endpoints

### Correlation

#### `GET /v1/beta` — Each coin's beta to BTC

**Parameters:**
- `coins` (query, optional, string) — Comma list of coins (default top majors) Example: `ETH,SOL,DOGE`
- `window` (query, optional, string) — Lookback in days (14-365, default 90) Example: `90`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cryptocorrelation-api/v1/beta?coins=ETH%2CSOL%2CDOGE&window=90"
```

**Response:**
```json
{
    "data": {
        "note": "beta = cov(coin, BTC) / var(BTC) on daily log returns: beta > 1 amplifies BTC moves, < 1 dampens, < 0 moves against. r_squared is how much of the coin's variance BTC explains.",
        "betas": [
            {
                "beta": 1.28,
                "coin": "ETH",
                "r_squared": 0.821,
                "correlation": 0.906
            },
            {
                "beta": 1.245,
                "coin": "SOL",
                "r_squared": 0.772,
                "correlation": 0.878
            },
            {
                "beta": 0.985,
                "coin": "DOGE",
                "r_squared": 0.605,
                "correlation": 0.778
            }
        ],
        "count": 3,
        "source": "Binance",
        "benchmark": "BTC",
        "window_days": 90,
        "observations": 90
    },
    "meta": {
        "timestamp": "2026-06-12T01:41:09.338Z",
        "request_id": "9093d429-7a47-4758-82b4-d413f2f27d37"
    },
    "status": "ok",
    "message": "Beta retrieved successfully",
    "success": true
}
```

#### `GET /v1/matrix` — Pairwise correlation matrix across a basket

**Parameters:**
- `coins` (query, optional, string) — Comma list of coins (default top majors) Example: `BTC,ETH,SOL,DOGE`
- `window` (query, optional, string) — Lookback in days (14-365, default 90) Example: `90`

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

**Response:**
```json
{
    "data": {
        "note": "Pearson correlation of daily log returns over window_days; matrix[i][j] pairs coins[i] with coins[j]. average_pairwise_correlation near 1 means the market is moving as one (risk-on/off); low means real dispersion.",
        "coins": [
            "BTC",
            "ETH",
            "SOL",
            "DOGE"
        ],
        "matrix": [
            [
                1,
                0.906,
                0.878,
                0.778
            ],
            [
                0.906,
                1,
                0.868,
                0.804
            ],
            [
                0.878,
                0.868,
                1,
                0.812
            ],
            [
                0.778,
                0.804,
                0.812,
                1
            ]
        ],
        "source": "Binance",
        "window_days": 90,
        "observations": 90,
        "average_pairwise_correlation": 0.841
    },
    "meta": {
        "timestamp": "2026-06-12T01:41:09.676Z",
        "request_id": "74963a6f-2542-4d24-84dc-a1f7301716ba"
    },
    "status": "ok",
    "message": "Matrix retrieved successfully",
    "success": true
}
```

#### `GET /v1/pair` — Correlation between two coins

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

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

**Response:**
```json
{
    "data": {
        "a": "BTC",
        "b": "ETH",
        "source": "Binance",
        "r_squared": 0.8213,
        "correlation": 0.9063,
        "window_days": 90,
        "observations": 90,
        "relationship": "very high (nearly the same bet)"
    },
    "meta": {
        "timestamp": "2026-06-12T01:41:10.013Z",
        "request_id": "2aef6593-4548-4257-97f4-5db59d6f252d"
    },
    "status": "ok",
    "message": "Pair retrieved successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

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

**Response:**
```json
{
    "data": {
        "note": "coins are Binance bases (BTC, ETH) or symbols (BTCUSDT); quote defaults to USDT. matrix/beta take coins=BTC,ETH,SOL (default top majors, max 15). window is 14-365 days (default 90). pair takes a= and b=.",
        "source": "Binance public REST (api.binance.com/api/v3/klines, daily, live)",
        "service": "cryptocorrelation-api",
        "endpoints": {
            "GET /v1/beta": "Each coin's beta to BTC with correlation and R-squared (coins=ETH,SOL,DOGE, window=90).",
            "GET /v1/meta": "This document.",
            "GET /v1/pair": "Correlation between two coins (a=BTC, b=ETH, window=90).",
            "GET /v1/matrix": "Pairwise correlation matrix across a basket + average pairwise correlation (coins=BTC,ETH,SOL, window=90)."
        },
        "description": "Crypto cross-asset correlation and beta, computed live from Binance daily candles (no key, nothing stored). matrix returns the full pairwise return-correlation matrix across a basket plus the average pairwise correlation. pair returns the correlation between two coins. beta returns each coin's beta to BTC with correlation and R-squared. From the covariance of daily log returns. The correlation/beta analytics cut for crypto — distinct from the FX-correlation API, the single-asset realised-volatility API and the portfolio-optimiser.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-12T01:41:10.350Z",
        "request_id": "8e402e31-6782-4
…(truncated, see openapi.json for full schema)
```


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