# Polymarket Order Book

> Polymarket Order Book is a paid API for AI agents from agent-data-tools.revmesh2074.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-11-06).

Returns the live CLOB order book (bids, asks, mid, spread, USD depth) for a specific Polymarket prediction market outcome

## Facts

- Endpoint: GET https://agent-data-tools.revmesh2074.workers.dev/polymarket/orderbook?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-06
- Activations on Zero: 0
- Provider: agent-data-tools.revmesh2074.workers.dev
- Website: https://agent-data-tools.revmesh2074.workers.dev
- Canonical page: https://www.zero.xyz/c/agent-data-tools-revmesh2074-workers-dev-polymarket-order-book-08a75e11
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NsNPQudYPWdSbU8sDa_L-

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 agent-data-tools-revmesh2074-workers-dev-polymarket-order-book-08a75e11
```

Example prompt: Pull up the Polymarket order book for the Yes outcome on the 'will-the-fed-cut-rates-in-2025' market — show me 20 levels on each side so I can see the spread and USD liquidity before I trade.

## When to prefer this

Use this endpoint when you need live order book data for a Polymarket prediction market — specifically to assess liquidity, calculate expected slippage before trading, or get a more accurate current price than the last-trade price. Prefer it over last-trade price endpoints when market microstructure matters (thin books, wide spreads). Use the token_id parameter when you already have the CLOB token from another Polymarket endpoint, or use slug+outcome for a more human-readable query.

## Known failure modes

- Invalid or unknown market slug returns an error — use polymarket_markets to find valid slugs
- Unknown outcome name returns an error — verify exact outcome string (e.g. 'Yes' vs 'yes')
- Invalid token_id returns an error or empty book
- Depth out of range (not 1–50) returns a validation error
- Market with no open orders returns empty bids or asks arrays
- CLOB API downtime may cause timeouts or stale data

## How this service works

Polymarket order book for one market outcome from the CLOB: bids and asks (price and size) up to 50 levels, best bid and ask, mid, spread and USD depth within 5 cents of the mid on each side. Give the market slug and outcome, or a CLOB token id. Use to check liquidity and slippage before a trade, or to read a sharper price than the last trade.

## Output

Returns a JSON object with: arrays of bid and ask levels each containing price and size, best bid and ask prices, mid price, spread, USD depth within 5 cents of mid on bid and ask sides, the market slug, outcome name, CLOB token ID, condition ID, market question text, and a timestamp of when the book was read. Optionally includes a note field for warnings or context.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "slug": {
   "type": "string",
   "description": "The market's Polymarket slug (from polymarket_markets) or its polymarket.com URL"
  },
  "depth": {
   "type": "integer",
   "description": "Levels per side, 1-50 (default 10)"
  },
  "outcome": {
   "type": "string",
   "description": "Outcome name, e.g. Yes or No (default the first outcome)"
  },
  "token_id": {
   "type": "string",
   "description": "Instead of slug: the CLOB token id of one outcome"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mid": {
   "type": "number"
  },
  "asks": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "size": {
      "type": "number"
     },
     "price": {
      "type": "number"
     }
    }
   }
  },
  "bids": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "size": {
      "type": "number"
     },
     "price": {
      "type": "number"
     }
    }
   }
  },
  "note": {
   "type": "string"
  },
  "slug": {
   "type": "string"
  },
  "spread": {
   "type": "number"
  },
  "bestAsk": {
   "type": "number"
  },
  "bestBid": {
   "type": "number"
  },
  "outcome": {
   "type": "string"
  },
  "tokenId": {
   "type": "string"
  },
  "bookTime": {
   "type": "string"
  },
  "question": {
   "type": "string"
  },
  "askDepthUsd": {
   "type": "number"
  },
  "bidDepthUsd": {
   "type": "number"
  },
  "conditionId": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-data-tools-revmesh2074-workers-dev-polymarket-order-book-08a75e11/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-data-tools.revmesh2074.workers.dev](https://www.zero.xyz/host/agent-data-tools.revmesh2074.workers.dev/llms.txt)
