Resolved Markets logoResolved Markets logo
Developer Guide

How to access Polymarket historical orderbook data

Polymarket exposes live market state, but researchers often need the orderbook as it looked yesterday, last week, or during a specific event. Resolved Markets stores point-in-time Polymarket orderbook snapshots with full bid/ask depth and exposes them through REST, OpenAPI, CLI export, and MCP.

Last updated:

  • Full depthSnapshot contents
  • MillisecondsTimestamp precision
  • Up to 500REST page size
  • CLI CSV exportBulk workflow

Three-step REST workflow

  1. Find a market. Use /v1/markets/live for active markets or /v1/markets/history/recent for closed ones (filter by crypto, timeframe, category, since and before).
  2. Query snapshots. Use /v1/markets/:id/snapshots with from, to, side and limit; add includebook=true for the full bid and ask ladders.
  3. Analyze the book. Use best_bid, best_ask, mid, spread, bids, asks, and sequence_number for replay or backtesting.
# 1. Find a live BTC 1-hour market
curl -s "https://api.resolvedmarkets.com/v1/markets/live?crypto=BTC&timeframe=1h" \
  -H "X-API-Key: rm_your_key" | jq '.[0] | {conditionId, slug, question}'

# 2. Or the most recently settled one, with its active time range
curl -s "https://api.resolvedmarkets.com/v1/markets/history/recent?crypto=BTC&timeframe=1h&status=closed&limit=1" \
  -H "X-API-Key: rm_your_key" | jq '.markets[0] | {market_id, first_seen, last_seen}'

# 3. Pull its order-book snapshots with full depth
curl -s "https://api.resolvedmarkets.com/v1/markets/<market_id>/snapshots?side=UP&includebook=true&limit=500" \
  -H "X-API-Key: rm_your_key" | jq '.data[0] | {timestamp, best_bid, best_ask, mid_price}'

# 4. Export a whole market to CSV with the CLI
npm install -g @elcara-hq/resolvedmarkets-cli
rm-api download -m <market_id> --from 2026-09-01 --to 2026-09-02 --format csv -o ./market.csv

Snapshot fields that matter

  • Full depth: bids and asks arrays, not just top-of-book.
  • Derived prices: best_bid, best_ask, mid, and spread.
  • Replay safety: sequence_number — a per-token count of applied book events, so you can tell how much activity each stored row skipped.
  • Timing: event and capture timestamps for latency-sensitive research.
  • Context: paired spot crypto fields where applicable.

Frequently asked questions