# CoinGecko Market Depth by Coin

> CoinGecko Market Depth by Coin 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).

Returns order book depth data (bid/ask spread, cost-to-move, volume, trust score) for a cryptocurrency across all exchanges tracked by CoinGecko

## Facts

- Endpoint: GET https://api.chainmarket-api.workers.dev/api/crypto/coingecko-market-depth?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/coingecko-market-depth-by-coin-0cae45b1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qZZlaMuDRj8vbq8uox6bS

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 coingecko-market-depth-by-coin-0cae45b1
```

Example prompt: Pull the full market depth data for Bitcoin from CoinGecko — I need the bid-ask spreads, cost-to-move figures, and 24h volumes across all exchanges.

## When to prefer this

Choose this endpoint when you need per-exchange order book depth metrics — bid-ask spreads, cost-to-move-up/down, and volume — for a specific cryptocurrency, sourced from CoinGecko's aggregated ticker data. It is ideal for market microstructure analysis, liquidity comparison, arbitrage research, or pre-trade impact estimation. Prefer it over generic price endpoints when spread or market depth context is required, and over building your own CoinGecko integration when you want pay-per-call access with no API key.

## Known failure modes

- Invalid or unknown CoinGecko coin ID returns an error or empty result
- Coin with no depth data on CoinGecko returns empty rows array
- Network or upstream CoinGecko API outage causes request failure
- Missing required 'coin' query parameter causes validation error
- Payment failure (insufficient USDC balance) results in 402 response with no charge

## How this service works

CoinGecko per-exchange market depth for one coin: USD cost to move price up 2% and down 2% (liquidity), 24h volume in USD, last price and bid-ask spread, for the 15 highest-volume trading pairs. Each row is one exchange pair, not a merged order book. Data is CoinGecko's, updated on its own schedule.

## Output

A JSON object containing the coin ID and name, and an array of rows — one per exchange — each with the trading pair, last price, last price in USD, 24h volume in USD, bid-ask spread percentage, cost to move up/down in USD, trust score, exchange ID and name, stale flag, anomaly flag, and last traded timestamp. Also includes the CoinGecko source URL and a checkedAt timestamp.

## 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": [
      "coin"
     ],
     "properties": {
      "coin": {
       "type": "string",
       "description": "CoinGecko coin id, e.g. bitcoin, ethereum, solana"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "coin": "bitcoin",
  "name": "Bitcoin",
  "rows": [
   {
    "last": 81663.71,
    "pair": "BTC/USDT",
    "isStale": false,
    "lastUsd": 81573,
    "exchange": "CoinUp.io",
    "isAnomaly": false,
    "exchangeId": "coinup",
    "trustScore": null,
    "lastTradedAt": "2026-10-23T09:33:56+00:00",
    "volumeUsd24h": 4120838850,
    "bidAskSpreadPct": 0.010037,
    "costToMoveUpUsd": 32160158.37931772,
    "costToMoveDownUsd": 9693135.711770184
   },
   {
    "last": 81590.15,
    "pair": "BTC/USDT",
    "isStale": false,
    "lastUsd": 81499,
    "exchange": "BTCC",
    "isAnomaly": false,
    "exchangeId": "btcc",
    "trustScore": null,
    "lastTradedAt": "2026-10-23T09:31:46+00:00",
    "volumeUsd24h": 2229198782,
    "bidAskSpreadPct": 0.010012,
    "costToMoveUpUsd": 11905314.86741312,
    "costToMoveDownUsd": 16685188.18960241
   }
  ],
  "source": "https://api.coingecko.com/api/v3/coins/bitcoin/tickers?depth=true",
  "checkedAt": "2026-10-23T09:35:55.313Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/coingecko-market-depth-by-coin-0cae45b1/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)
