# Crypto-to-Macro Correlation API
> Whether crypto is trading as a risk asset or a hedge, measured by how closely a coin moves with the stock market, gold and the dollar — computed live from Binance and Yahoo Finance, no key, nothing stored. The single most-asked macro question about crypto is whether it is "digital gold" or just high-beta tech; this answers it with numbers. The correlation endpoint returns, for a coin (BTC or ETH), its return correlation to the S&P 500, the Nasdaq 100, gold and the US dollar index over a chosen window, each with a plain-language read (risk-on if it tracks stocks, a hedge if it tracks gold or moves against the dollar) and an overall verdict. The beta endpoint returns the coin's beta to the S&P 500 — how much it amplifies equity moves — with the correlation and R-squared. This is the cross-asset / crypto-versus-traditional-markets correlation cut — distinct from the crypto-to-crypto correlation API (coins against each other), the realised-volatility and the price APIs in the catalogue. Correlations use daily log returns aligned on common trading days; coin is BTC or ETH, window 20-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/cryptomacro-api/..."
```

## Pricing
- **Free** (Free) — 400 calls/Mo, 2 req/s
- **Starter** ($12/Mo) — 11,000 calls/Mo, 6 req/s
- **Pro** ($37/Mo) — 67,000 calls/Mo, 16 req/s
- **Business** ($85/Mo) — 340,000 calls/Mo, 40 req/s

## Endpoints

### Macro

#### `GET /v1/beta` — Beta to the S&P 500

**Parameters:**
- `coin` (query, required, string) — BTC or ETH Example: `BTC`
- `window` (query, optional, string) — Lookback in days (20-365, default 90) Example: `90`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cryptomacro-api/v1/beta?coin=BTC&window=90"
```

#### `GET /v1/correlation` — Correlation to stocks, gold & the dollar

**Parameters:**
- `coin` (query, required, string) — BTC or ETH Example: `BTC`
- `window` (query, optional, string) — Lookback in days (20-365, default 90) Example: `90`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cryptomacro-api/v1/correlation?coin=BTC&window=90"
```

### Meta

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

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


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