The Polymarket API, explained
Polymarket has four public APIs: Gamma for finding markets, the CLOB for live order books and trading, the Data API for trades and price history, and WebSockets for streaming. Reading market data is free and needs no key. None of them return a past order book: for historical depth you need a separate archive.
Last updated:
The four APIs and what each is for
Gamma API: find markets and events
https://gamma-api.polymarket.com returns events, markets and their metadata: questions, slugs, outcomes, token IDs, end dates and resolution status. Start here to turn a market name or slug into the token IDs every other API needs.
CLOB API: live prices, order books and orders
https://clob.polymarket.com serves the current order book (GET /book?token_id=, or POST /books for up to 500 tokens), midpoints and spreads, and is where orders are placed and cancelled. The book response is a snapshot of now: bids, asks, tick size and last trade price.
Data API: trades, positions and price history
https://data-api.polymarket.com covers trades, positions, activity and price history. Version 2 lives under /v2; Polymarket retires v1 on October 24, 2026, so new code should use v2. /v2/trades is cursor-paginated at up to 1,000 rows per page, and /v2/prices-history returns a price series for one token.
WebSockets: streaming updates
The market channel at wss://ws-subscriptions-clob.polymarket.com/ws/market sends a full book on subscribe, then price_change, last_trade_price and tick_size_change messages. Clients must send PING every 10 seconds. A user channel streams your own orders and fills, and newer sockets carry live reference prices and sports scores.
Quick start: read a live book with no key
# 1. Find a market and its token IDs (Gamma)
curl -s "https://gamma-api.polymarket.com/markets?slug=<market-slug>" | jq '.[0] | {question, tokens: (.clobTokenIds | fromjson)}'
# 2. Read the current order book for one outcome token (CLOB)
curl -s "https://clob.polymarket.com/book?token_id=<token_id>" | jq '{bids: .bids[:5], asks: .asks[:5]}'
# 3. Price history for the same token (Data API v2)
curl -s "https://data-api.polymarket.com/v2/prices-history?token_id=<token_id>&interval=1d"Parameter names changed between versions: the legacy CLOB /prices-history takes market, startTs, endTs and fidelity, while the v2 Data API route takes token_id with one of interval, start/end or as_of. Check the official docs before relying on either.
Authentication and SDKs
- Public data (Gamma, CLOB reads, Data API) needs no credentials.
- L1 is an EIP-712 wallet signature used to create or derive CLOB API keys.
- L2 is HMAC-SHA256 request signing with
POLY_*headers, needed for private CLOB routes and orders. - SDKs: use py-sdk or ts-sdk. The older
py-clob-clientandclob-clientrepos are archived after the CLOB V2 upgrade, so tutorials that use them are out of date.
Rate limits
Limits are per IP, enforced by Cloudflare, and excess requests are throttled rather than rejected. Figures below are per 10 seconds, from Polymarket's rate-limit page as of 2026-09-27:
- CLOB: 9,000 overall;
/book1,500;/books500;/prices-history1,000. - Gamma: 4,000 overall;
/markets300;/events500. - Data API v2: 800 overall;
/v2/trades300;/v2/prices-history200.
Order placement has its own limits per signing wallet, tiered by trading volume.
What the Polymarket API does not give you
- Historical order books.
/bookis live only. There is no endpoint for the bids and asks at a past moment, so spreads, depth and slippage in the past cannot be reconstructed from the official API. - Fine-grained history for old markets. 1-minute price buckets are kept for at least 7 days; older data is coarser, down to 12-hour buckets for the full history.
- A defined "price". The docs do not say whether price history is a midpoint or a last trade, which matters when you backtest entries against it.
This is the gap Resolved Markets fills. It has recorded full-depth Polymarket order books since March 2026: 4.2B+ orderbook snapshots, with trades and settlement results, queryable by market and time. See what is covered and how to query it.
| Dimension | Resolved Markets | Polymarket official APIs |
|---|---|---|
| Live order book | Yes (REST and WebSocket) | Yes |
| Past order book at a timestamp | Yes, full depth, since March 2026 | No |
| Price history | Mid, bid, ask and spread candles from 1 second up | Single price series; 1-minute buckets kept ≥7 days |
| Trades | Yes, joined to the book by token ID | Yes (Data API) |
| Place orders | No, read-only | Yes |
| Market coverage | Crypto, sports, weather, equities, economics, social; no politics | Every Polymarket market |
| Cost | Free tier (crypto), paid plans from Pro | Free |
Frequently asked questions
Does the Polymarket API provide historical orderbook data?
No. The CLOB GET /book endpoint returns the current order book only, and Polymarket's docs list no endpoint for past bids and asks. Price history (/prices-history) returns a single price series, not depth. To analyse past liquidity or spreads you need an archive that recorded the book over time, such as Resolved Markets.
Is the Polymarket API free?
Yes. Public market data from Gamma, the CLOB and the Data API needs no API key and has no charge. Requests are rate-limited per IP; the limits are published at docs.polymarket.com/api-reference/rate-limits.
Do I need an API key to use the Polymarket API?
Only for private CLOB routes and trading. Keys are created or derived with an L1 wallet signature (EIP-712), and private requests are signed with L2 HMAC headers. Reading markets, books and price history needs no key.
Which Polymarket SDK should I use?
Use the current official SDKs: py-sdk for Python and ts-sdk for TypeScript. The older py-clob-client and clob-client repositories are archived, and py-clob-client's README says it is no longer functional after the CLOB V2 upgrade.
How far back does Polymarket price history go?
The Data API /v2/prices-history endpoint reaches back to 2022 at 12-hour resolution. Finer buckets are kept for shorter periods: 1-minute data for at least 7 days, 5-minute for at least 60 days and 30-minute for at least 90 days. Custom start/end windows are capped at 15 days per request.
Can I trade on Polymarket through the API from the US?
Polymarket's geoblock page lists the US as close-only for both the website and the API, so new positions are blocked. Check GET https://polymarket.com/api/geoblock from your server before trading. Polymarket US is a separate, CFTC-regulated exchange with its own API.

