# Coinbase Exchange API
> Live market data straight from Coinbase's public Exchange API — one of the largest and most trusted regulated crypto venues, exposed as clean JSON with no key and nothing cached. The products endpoint lists Coinbase's roughly 800 trading pairs with their base and quote currency, price and size increments, minimum order size and trading status, filterable by quote currency. The ticker endpoint returns a pair's live snapshot: the last trade price, the best bid and ask, the bid-ask spread in absolute and percentage terms, and the 24-hour base volume — BTC-USD trading around $63,300 with a one-cent spread. The stats endpoint returns the rolling 24-hour open, high, low and last with the 24-hour and 30-day volume and the computed 24-hour percentage change. The orderbook endpoint returns the top of book — the best bid and ask at level 1, or the aggregated top of the book at level 2 with configurable depth — together with the spread. The candles endpoint returns recent OHLC candles at a granularity you choose, from one minute to one day, for charting and backtesting. Everything is Coinbase's live venue data, nothing stored. This is the Coinbase price-and-liquidity layer for any trading, charting, arbitrage, portfolio or market-data app. Live from Coinbase Exchange. Distinct from Binance and Kraken venue APIs and from aggregated price feeds — this is Coinbase's own order book and tape. 6 endpoints, no key on our side, real-time.

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

## Pricing
- **Free** (Free) — 5,000 calls/Mo, 5 req/s
- **Starter** ($13/Mo) — 120,000 calls/Mo, 12 req/s
- **Pro** ($35/Mo) — 750,000 calls/Mo, 30 req/s
- **Mega** ($84/Mo) — 4,000,000 calls/Mo, 80 req/s

## Endpoints

### Coinbase

#### `GET /v1/candles` — Recent OHLC candles

**Parameters:**
- `pair` (query, required, string) — Trading pair (base-quote) Example: `BTC-USD`
- `granularity` (query, optional, string) — Seconds: 60,300,900,3600,21600,86400 Example: `3600`
- `limit` (query, optional, string) — Max candles (default 100, max 300) Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/coinbase-api/v1/candles?pair=BTC-USD&granularity=3600&limit=50"
```

**Response:**
```json
{
    "data": {
        "pair": "BTC-USD",
        "count": 50,
        "source": "Coinbase Exchange",
        "candles": [
            {
                "iso": "2026-06-09T11:00:00.000Z",
                "low": 62455.96,
                "high": 62776.37,
                "open": 62748.74,
                "time": 1781002800,
                "close": 62556.32,
                "volume": 207.78066303
            },
            {
                "iso": "2026-06-09T10:00:00.000Z",
                "low": 62553.79,
                "high": 62800.36,
                "open": 62681.91,
                "time": 1780999200,
                "close": 62748.74,
                "volume": 234.38910067
            },
            {
                "iso": "2026-06-09T09:00:00.000Z",
                "low": 62551.08,
                "high": 62920.55,
                "open": 62808.18,
                "time": 1780995600,
                "close": 62681.91,
                "volume": 300.26431333
            },
            {
                "iso": "2026-06-09T08:00:00.000Z",
                "low": 62714.7,
                "high": 63176.99,
                "open": 63158.51,
                "time": 1780992000,
                "close": 62808.18,
                "volume": 280.63284017
            },
            {
                "iso": "2026-06-09T07:00:00.000Z",
                "low": 62948.88,
                "high": 63408,
                "open": 63263.99,
                "time": 1780988400,
              
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/orderbook` — Top of order book

**Parameters:**
- `pair` (query, required, string) — Trading pair (base-quote) Example: `BTC-USD`
- `level` (query, optional, string) — 1 (best) or 2 (aggregated) Example: `2`
- `depth` (query, optional, string) — Levels to return at level 2 (max 50) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/coinbase-api/v1/orderbook?pair=BTC-USD&level=2&depth=10"
```

**Response:**
```json
{
    "data": {
        "asks": [
            {
                "size": 0.03999441,
                "price": 62529.73
            },
            {
                "size": 0.01673402,
                "price": 62529.78
            },
            {
                "size": 0.03272435,
                "price": 62529.79
            },
            {
                "size": 0.17920124,
                "price": 62530.99
            },
            {
                "size": 0.12793451,
                "price": 62532
            },
            {
                "size": 0.0299697,
                "price": 62532.59
            },
            {
                "size": 0.15991317,
                "price": 62533.94
            },
            {
                "size": 0.0076,
                "price": 62534
            },
            {
                "size": 0.01354882,
                "price": 62534.41
            },
            {
                "size": 0.00119942,
                "price": 62534.42
            }
        ],
        "bids": [
            {
                "size": 0.00030188,
                "price": 62529.72
            },
            {
                "size": 1.76e-6,
                "price": 62529.69
            },
            {
                "size": 0.01789955,
                "price": 62526.9
            },
            {
                "size": 0.12794521,
                "price": 62526.76
            },
            {
                "size": 0.0177,
                "pric
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/products` — All trading pairs

**Parameters:**
- `quote` (query, optional, string) — Filter by quote currency (e.g. USD) Example: `USD`
- `status` (query, optional, string) — all to include offline pairs
- `limit` (query, optional, string) — Max pairs (default 500)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/coinbase-api/v1/products?quote=USD"
```

**Response:**
```json
{
    "data": {
        "count": 396,
        "source": "Coinbase Exchange",
        "products": [
            {
                "base": "00",
                "pair": "00-USD",
                "quote": "USD",
                "status": "online",
                "display": "00-USD",
                "min_order": 1,
                "base_increment": 0.01,
                "quote_increment": 0.0001,
                "trading_disabled": false
            },
            {
                "base": "1INCH",
                "pair": "1INCH-USD",
                "quote": "USD",
                "status": "online",
                "display": "1INCH-USD",
                "min_order": 1,
                "base_increment": 0.01,
                "quote_increment": 0.001,
                "trading_disabled": false
            },
            {
                "base": "2Z",
                "pair": "2Z-USD",
                "quote": "USD",
                "status": "online",
                "display": "2Z/USD",
                "min_order": 1,
                "base_increment": 0.01,
                "quote_increment": 1.0e-5,
                "trading_disabled": false
            },
            {
                "base": "A8",
                "pair": "A8-USD",
                "quote": "USD",
                "status": "online",
                "display": "A8/USD",
                "min_order": 1,
                "base_increment": 0.01,
                "quote_increment": 0.0001,
                "trading_disab
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/stats` — 24h stats for a pair

**Parameters:**
- `pair` (query, required, string) — Trading pair (base-quote) Example: `ETH-USD`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/coinbase-api/v1/stats?pair=ETH-USD"
```

**Response:**
```json
{
    "data": {
        "last": 1668.74,
        "pair": "ETH-USD",
        "source": "Coinbase Exchange",
        "low_24h": 1653.68,
        "high_24h": 1714.19,
        "open_24h": 1682.3,
        "change_24h": -13.56,
        "volume_24h": 203905.92270048,
        "volume_30day": 4089316.37507375,
        "change_24h_pct": -0.806
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:33.895Z",
        "request_id": "06b62e7d-8ad6-472f-b9fb-65ca207af400"
    },
    "status": "ok",
    "message": "Stats retrieved successfully",
    "success": true
}
```

#### `GET /v1/ticker` — Live ticker for a pair

**Parameters:**
- `pair` (query, required, string) — Trading pair (base-quote) Example: `BTC-USD`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/coinbase-api/v1/ticker?pair=BTC-USD"
```

**Response:**
```json
{
    "data": {
        "ask": 62529.73,
        "bid": 62529.72,
        "pair": "BTC-USD",
        "time": "2026-06-09T11:38:32.504190595Z",
        "price": 62529.72,
        "source": "Coinbase Exchange",
        "spread": 0.01,
        "spread_pct": 0,
        "volume_24h": 9959.80876656,
        "last_trade_id": 1034968658
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:34.001Z",
        "request_id": "2c4849c7-fdba-4e5d-a9c8-8fe2cc97ec37"
    },
    "status": "ok",
    "message": "Ticker retrieved successfully",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "source": "Coinbase Exchange public API (live)",
        "service": "coinbase-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/stats": "A pair's 24h open/high/low/last + 24h/30d volume + 24h % change (pair=BTC-USD).",
            "GET /v1/ticker": "A pair's live ticker (pair=BTC-USD): price, bid/ask, spread, 24h volume.",
            "GET /v1/candles": "Recent OHLC candles (pair=BTC-USD; granularity=60..86400 seconds).",
            "GET /v1/products": "All Coinbase trading pairs (quote=USD to filter, status=all to include offline).",
            "GET /v1/orderbook": "Top of book (pair=BTC-USD; level=1 best, level=2 aggregated with depth)."
        },
        "description": "Live market data from Coinbase's public Exchange API: ~800 trading pairs with increments, minimum order size and status; a pair's live ticker (price, best bid/ask, spread, 24h volume); rolling 24h open/high/low/last with 24h and 30d volume and 24h % change; the top of the order book at level 1 or 2 with the spread; and recent OHLC candles at a chosen granularity (1m to 1d). Live venue data, no key, nothing stored. Distinct from Binance and Kraken venue APIs and from aggregated price feeds — this is Coinbase's own order book and tape.",
        "upstream_status": "ok",
        "products_available": 824
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:34.149Z",
        "request_id": "b1299361-69ae-4a97-be99-e5373a79f4e9"
   
…(truncated, see openapi.json for full schema)
```


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