# Coinbase Spot Exchange Data

> Coinbase Spot Exchange Data is a paid API for AI agents from api.chainmarket-api.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-24).

Fetches real-time spot price, order book depth, and 24h/30d volume statistics for a Coinbase trading pair

## Facts

- Endpoint: GET https://api.chainmarket-api.workers.dev/api/crypto/coinbase-spot-exchange?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-24
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/coinbase-spot-exchange-data-4e4bb638
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-NNRFVQWP3Gy-XFhIpJc4

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability coinbase-spot-exchange-data-4e4bb638
```

Example prompt: What's the current BTC-USD spot price on Coinbase right now, including the best bid, best ask, and 24-hour volume?

## When to prefer this

Choose this endpoint when you need real-time Coinbase spot price data with full order book context (bid/ask spread, depth within 1-2%), 24h and 30d volume — especially when you want a pay-per-call approach with no API key or signup. Prefer over generic price aggregators when Coinbase-specific pricing or liquidity is required.

## Known failure modes

- Invalid or unsupported product ID returns an error (e.g. misspelled pair like 'BTC-US')
- Network or upstream Coinbase API outage may return a 5xx error
- Rate limiting or payment failure results in a 402 response and no charge
- Illiquid or delisted trading pairs may return incomplete depth data

## How this service works

Coinbase Exchange (US spot) order book for one product: best bid and ask, spread, USD depth within 1% and 2% of mid (aggregated level-2 levels only), 24h base volume, 24h RFQ (institutional request-for-quote) volume, last price and 24h high/low. Coinbase Exchange data only, not Coinbase Advanced or other venues.

## Output

Returns a JSON object with the last traded price, best bid, best ask, mid price, spread percentage, 24h high/low/open, 24h base volume, 30d base volume, order book depth in USD within 1% and 2% of mid, RFQ volume, book sequence number, and a checkedAt timestamp — all sourced live from the Coinbase Exchange order book.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "product"
     ],
     "properties": {
      "product": {
       "type": "string",
       "description": "Coinbase product id such as BTC-USD or ETH-USD"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "last": 81518.52,
  "low24h": 80789.61,
  "source": "https://api.exchange.coinbase.com/products/BTC-USD/book?level=2",
  "bestAsk": 81509.89,
  "bestBid": 81509.88,
  "high24h": 82094.85,
  "open24h": 81853.94,
  "product": "BTC-USD",
  "midPrice": 81509.88500000001,
  "checkedAt": "2026-10-23T09:35:56.640Z",
  "spreadPct": 0.000012,
  "bookSequence": 138198932896,
  "volume24hBase": 6230.94905992,
  "volume30dBase": 151632.53425096,
  "depthWithin1pct": {
   "askUsd": 6409025,
   "bidUsd": 15266290
  },
  "depthWithin2pct": {
   "askUsd": 8372745,
   "bidUsd": 29406298
  },
  "rfqVolume24hBase": 61.219955
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/coinbase-spot-exchange-data-4e4bb638/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.chainmarket-api.workers.dev](https://www.zero.xyz/host/api.chainmarket-api.workers.dev/llms.txt)
