# Polymarket Prediction Market Orderbook

> Polymarket Prediction Market Orderbook is a paid API for AI agents from Nansen at api.nansen.ai, paid per call via MPP, $0.01/call, status unknown (last checked 2026-10-09).

Returns the full bid/ask orderbook with price levels, sizes, and cumulative depth for a Polymarket prediction market, polled every ~60 seconds.

## Facts

- Endpoint: POST https://api.nansen.ai/api/v1/prediction-market/orderbook?utm_source=zero.xyz
- Price: $0.01/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-09
- Activations on Zero: 0
- Provider: Nansen
- Docs: https://docs.nansen.ai
- Website: https://nansen.ai
- Tags: blockchain, smart-money, wallet, tokens, defi, analytics, profiler, dex, pnl, onchain, prediction-market, data
- Canonical page: https://www.zero.xyz/c/nansen-orderbook-71d2fdce
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_CM1it80sCGLYQ4jwXYeMP

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 nansen-orderbook-71d2fdce -d '<json body>'
```

Example prompt: Can you pull the full orderbook for Polymarket market ID 654412 — I want to see all the bid and ask price levels, how much size is at each level, and the cumulative depth for both Yes and No outcomes?

## When to prefer this

Use this endpoint when you need the full bid/ask depth and liquidity profile for a specific Polymarket prediction market, including cumulative order sizes and price levels for each outcome. Prefer this over generic DEX trade endpoints when you specifically want prediction market orderbook structure rather than executed trade history.

## Known failure modes

- Invalid or non-existent market_id returns empty data array
- Market not yet indexed returns empty result
- Pagination page beyond last page returns empty data
- Rate limit or authentication failure returns HTTP 4xx error
- Stale data up to ~60 seconds old due to polling interval

## How this service works

Get the full bid/ask orderbook for a Polymarket prediction market. Data is
polled from the Polymarket CLOB API every ~60 seconds with MD5 change detection.

**What it helps to answer:**

1. **What is the current bid/ask depth for a prediction market?**
2. **How much liquidity is available at each price level?**
3. **What is the current spread?**

## Output

A paginated list of orderbook levels, each containing the side (buy/sell), price, size, cumulative size, outcome label (e.g. Yes/No), asset ID, event ID, market ID, outcome index, and a snapshot timestamp indicating when the data was last polled from Polymarket.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "title": "OrderbookRequest",
 "required": [
  "market_id"
 ],
 "properties": {
  "market_id": {
   "type": "string",
   "title": "Market Id",
   "examples": [
    "654412"
   ],
   "maxLength": 100,
   "minLength": 1,
   "description": "Polymarket market ID"
  },
  "pagination": {
   "type": "object",
   "title": "PaginationRequest",
   "properties": {
    "page": {
     "type": "integer",
     "title": "Page",
     "default": 1,
     "minimum": 1,
     "description": "Page number (1-based)"
    },
    "per_page": {
     "type": "integer",
     "title": "Per Page",
     "default": 10,
     "maximum": 1000,
     "minimum": 1,
     "description": "Number of records per page (max 1000)"
    }
   },
   "description": "Pagination parameters for API requests."
  }
 },
 "description": "Request for orderbook endpoint.",
 "additionalProperties": false
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "title": "OrderbookResponse",
 "required": [
  "data"
 ],
 "properties": {
  "data": {
   "type": "array",
   "items": {
    "type": "object",
    "title": "OrderbookLevel",
    "required": [
     "market_id"
    ],
    "properties": {
     "side": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Side",
      "examples": [
       "buy"
      ],
      "description": "buy or sell"
     },
     "size": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Size",
      "examples": [
       1000
      ],
      "description": "Size at level"
     },
     "price": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Price",
      "examples": [
       0.52
      ],
      "description": "Price level"
     },
     "outcome": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Outcome",
      "examples": [
       "Yes"
      ],
      "description": "Outcome label"
     },
     "asset_id": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Asset Id",
      "examples": [
       "71321045679252212"
      ],
      "description": "CLOB token ID"
     },
     "event_id": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Event Id",
      "description": "Event ID"
     },
     "market_id": {
      "type": "string",
      "title": "Market Id",
      "examples": [
       "654412"
      ],
      "description": "Market ID"
     },
     "outcome_index": {
      "anyOf": [
       {
        "type": "integer"
       }
      ],
      "title": "Outcome Index",
      "examples": [
       1
      ],
      "description": "Outcome index"
     },
     "cumulative_size": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Cumulative Size",
      "examples": [
       5000
      ],
      "description": "Cumulative size"
     },
     "snapshot_timestamp": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       }
      ],
      "title": "Snapshot Timestamp",
      "examples": [
       "2024-11-01T12:00:00"
      ],
      "description": "Snapshot timestamp"
     }
    },
    "description": "Orderbook level from ch_api_pm_orderbook."
   },
   "title": "Data",
   "description": "List of orderbook level records"
  },
  "pagination": {
   "type": "object",
   "title": "PaginationInfo",
   "properties
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/nansen-orderbook-71d2fdce/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.nansen.ai](https://www.zero.xyz/host/api.nansen.ai/llms.txt)
