Backtesting
Validate trading strategies against historical market states. Replay order books to simulate realistic execution.
GET /markets/{id}/books
Prices, liquidity metrics and full L2 order books, captured at 1-minute intervals across every category. One REST API, one Python SDK.
Every category, queryable as series, events, markets, prices, metrics and order books. A few examples below.
Election and policy-related markets.
Macro indicators and financial-event markets.
Technology and AI milestone markets.
Everything you need for professional backtesting and research, captured at 1-minute intervals across all active markets.
Bids
Asks
GET /v1/markets/{id}/books
Full bid/ask depth at every snapshot. Reconstruct the exact market state at any historical moment.
{ "bids": [{"price": "0.49", "size": "1120"}, ...], "asks": [{"price": "0.51", "size": "980"}, ...]}jsonDiscover markets, then query historical metrics, prices, and books with shared parameters. The Python SDK wraps the same API surface for faster research workflows.
Endpoint map
Discovery
/v1/series, /v1/events, /v1/markets
History
/v1/markets/{id_or_slug}/metrics, /prices, /books
Utility
/v1/health, /v1/usage
# pip install polymarketdata-sdkfrom polymarketdata import PolymarketDataClient# API key can also be set via POLYMARKETDATA_API_KEYwith PolymarketDataClient(api_key="YOUR_API_KEY") as client: health = client.utility.health() usage = client.utility.usage() print(health.status) print(usage.plan) print(usage.limits.requests_remaining)pythonValidate trading strategies against historical market states. Replay order books to simulate realistic execution.
GET /markets/{id}/books
Discover patterns in prediction market behavior. Analyze how markets price information and resolve over time.
GET /markets/{id}/prices
Study prediction market efficiency, information aggregation, and forecasting accuracy with granular data.
GET /series → /events → /markets