# Crypto History API
> Live historical price data and analytics for any crypto coin, from the public CoinGecko feed. Get open/high/low/close candles over a date range; the price, market cap and volume time series; the move over a period with its high and low; and a coin's multi-period performance with all-time-high and all-time-low. Works for thousands of coins in any quote currency. A crypto history-and-analytics layer — distinct from spot-price and whole-market feeds: it turns the price archive into the candles, time series and moves a trader studies. Live, with a short upstream cache.

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

## Pricing
- **Free** (Free) — 4,250 calls/Mo, 2 req/s
- **Starter** ($8/Mo) — 92,000 calls/Mo, 6 req/s
- **Pro** ($22/Mo) — 475,000 calls/Mo, 15 req/s
- **Business** ($53/Mo) — 2,850,000 calls/Mo, 40 req/s

## Endpoints

### Crypto History

#### `GET /v1/change` — Move over a period with high and low

**Parameters:**
- `coin` (query, required, string) — CoinGecko id or ticker alias Example: `bitcoin`
- `days` (query, optional, string) — Range in days (default 30) Example: `30`
- `vs` (query, optional, string) — Quote currency (default usd) Example: `usd`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cryptohistory-api/v1/change?coin=bitcoin&days=30&vs=usd"
```

**Response:**
```json
{
    "data": {
        "vs": "usd",
        "low": 59353.42034891,
        "coin": "bitcoin",
        "days": 30,
        "high": 81823.28617528,
        "source": "CoinGecko",
        "end_price": 61396.18758123,
        "change_abs": -20427.09859404,
        "change_pct": -24.9649,
        "start_price": 81823.28617528,
        "high_low_range_pct": 37.8577
    },
    "meta": {
        "timestamp": "2026-06-10T22:56:12.793Z",
        "request_id": "5edeb82c-8562-48d1-91b7-e33047b6f778"
    },
    "status": "ok",
    "message": "Change computed",
    "success": true
}
```

#### `GET /v1/chart` — Price, market-cap & volume time series

**Parameters:**
- `coin` (query, required, string) — CoinGecko id or ticker alias Example: `bitcoin`
- `days` (query, optional, string) — Range in days (default 30) Example: `30`
- `vs` (query, optional, string) — Quote currency (default usd) Example: `usd`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cryptohistory-api/v1/chart?coin=bitcoin&days=30&vs=usd"
```

**Response:**
```json
{
    "data": {
        "vs": "usd",
        "coin": "bitcoin",
        "days": 30,
        "count": 721,
        "series": [
            {
                "time": 1778540447829,
                "price": 81823.28617527579,
                "volume": 35994421743.647064,
                "market_cap": 1638861626907.0112
            },
            {
                "time": 1778544027362,
                "price": 81725.20771701908,
                "volume": 33905980449.09922,
                "market_cap": 1636812805155.4443
            },
            {
                "time": 1778547646949,
                "price": 81530.92615591706,
                "volume": 32357071143.705776,
                "market_cap": 1633256705574.8726
            },
            {
                "time": 1778551232124,
                "price": 81170.30460840944,
                "volume": 32123103097.100742,
                "market_cap": 1625949895005.1477
            },
            {
                "time": 1778554842009,
                "price": 81222.304124304,
                "volume": 31974743138.338326,
                "market_cap": 1626708971977.3086
            },
            {
                "time": 1778558445205,
                "price": 81026.2679937985,
                "volume": 30369778396.694324,
                "market_cap": 1622846674684.4128
            },
            {
                "time": 1778562052161,
                "price": 81199.57392751012,
                "volume": 30947302102.3
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/meta` — Service metadata and endpoint list

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

**Response:**
```json
{
    "data": {
        "note": "coin = CoinGecko id (bitcoin, ethereum, solana...); common tickers (btc, eth, sol) are aliased. days snaps to 1/7/14/30/90/180/365.",
        "source": "CoinGecko API (api.coingecko.com, live)",
        "service": "cryptohistory-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/ohlc": "OHLC candles (coin=bitcoin, days=30, vs=usd).",
            "GET /v1/chart": "Price, market-cap & volume time series (coin=bitcoin, days=30, vs=usd).",
            "GET /v1/change": "Move over a period + high/low (coin=bitcoin, days=30, vs=usd).",
            "GET /v1/performance": "Multi-period performance + ATH/ATL (coin=bitcoin, vs=usd)."
        },
        "description": "Live historical price data and analytics for any crypto coin, from the public CoinGecko feed. The ohlc endpoint returns open/high/low/close candles over a date range; the chart endpoint returns the price, market cap and volume time series; the change endpoint returns the move over a period with high and low; the history endpoint returns a coin's price, market cap and volume on a specific date. Works for thousands of coins in any quote currency. A crypto history-and-analytics layer, distinct from spot-price and whole-market feeds. Live, with a short 60-second upstream cache.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-10T22:56:13.012Z",
        "request_id": "ccbfdae7-3d0c-43c6-83f9-660ff34c996c"
    },
  
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/ohlc` — OHLC candles over a date range

**Parameters:**
- `coin` (query, required, string) — CoinGecko id (bitcoin) or ticker alias (btc) Example: `bitcoin`
- `days` (query, optional, string) — Range: 1/7/14/30/90/180/365 (default 30) Example: `30`
- `vs` (query, optional, string) — Quote currency (default usd) Example: `usd`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cryptohistory-api/v1/ohlc?coin=bitcoin&days=30&vs=usd"
```

**Response:**
```json
{
    "data": {
        "vs": "usd",
        "coin": "bitcoin",
        "days": 30,
        "count": 180,
        "source": "CoinGecko",
        "candles": [
            {
                "low": 81584,
                "high": 82027,
                "open": 81971,
                "time": 1778544000000,
                "close": 81725
            },
            {
                "low": 80882,
                "high": 81735,
                "open": 81735,
                "time": 1778558400000,
                "close": 81065
            },
            {
                "low": 80834,
                "high": 81264,
                "open": 81026,
                "time": 1778572800000,
                "close": 80862
            },
            {
                "low": 80487,
                "high": 80910,
                "open": 80846,
                "time": 1778587200000,
                "close": 80746
            },
            {
                "low": 80189,
                "high": 80921,
                "open": 80749,
                "time": 1778601600000,
                "close": 80351
            },
            {
                "low": 79880,
                "high": 80800,
                "open": 80337,
                "time": 1778616000000,
                "close": 80788
            },
            {
                "low": 80441,
                "high": 80811,
                "open": 80810,
                "time": 1778630400000,
                "close": 80481
            },
     
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/performance` — Multi-period performance + ATH/ATL

**Parameters:**
- `coin` (query, required, string) — CoinGecko id or ticker alias Example: `bitcoin`
- `vs` (query, optional, string) — Quote currency (default usd) Example: `usd`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cryptohistory-api/v1/performance?coin=bitcoin&vs=usd"
```

**Response:**
```json
{
    "data": {
        "vs": "usd",
        "ath": 126080,
        "atl": 67.81,
        "coin": "bitcoin",
        "name": "Bitcoin",
        "price": 61397,
        "source": "CoinGecko",
        "symbol": "btc",
        "low_24h": 60882,
        "ath_date": "2025-10-06T18:57:42.558Z",
        "atl_date": "2013-07-06T00:00:00.000Z",
        "high_24h": 62624,
        "change_pct": {
            "d7": -5.3676,
            "h1": 0.2722,
            "y1": -44.1439,
            "d14": -17.3908,
            "d30": -24.938,
            "h24": -0.4087,
            "d200": -27.2482
        },
        "market_cap": 1230488358299,
        "volume_24h": 27675393556,
        "ath_change_pct": -51.303,
        "atl_change_pct": 90444.2801,
        "market_cap_rank": 1
    },
    "meta": {
        "timestamp": "2026-06-10T22:56:13.349Z",
        "request_id": "db6c5c89-dbd1-490e-93e8-f6b0b330efd0"
    },
    "status": "ok",
    "message": "Performance retrieved successfully",
    "success": true
}
```


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