As of November 8, 2026, Polymarket has three public web APIs, and reading data from any of them needs no key: Gamma (gamma-api.polymarket.com) for events and markets, the Data API v2 (data-api.polymarket.com/v2/…) for trades, positions, PnL, holders and leaderboards, and the order book API (clob.polymarket.com, which Polymarket’s docs call the CLOB API) for live books and prices. Only placing and managing orders needs credentials. The old Data API v1 is gone: on November 8, 2026 our test calls to /trades, /positions and /v1/leaderboard all returned HTTP 410 with "Data API v1 has been retired", and v2 pages with cursors only. This guide is organized by task, with the requests we ran and the places where the docs and our tests differ. It covers reading public data only.
The three APIs at a glance
| Gamma | Data API v2 | Order book API | |
|---|---|---|---|
| Base address | https://gamma-api.polymarket.com |
https://data-api.polymarket.com/v2 |
https://clob.polymarket.com |
| What it answers | What exists: events, markets, tags, rules text, outcome token ids, public profiles | What happened and who holds what: trades, activity, positions, PnL, holders, leaderboards, price history | What the book looks like now: bids, asks, midpoint, spread, last trade |
| Key for public reads | None | None | None for market data; trading endpoints need credentials |
| Paging | offset on /events; cursor on /events/keyset |
Cursor only (offset returns 400) |
Mostly single objects or batches |
| Field names | camelCase | snake_case | snake_case |
| Rate limit, general (per 10 s) | 4,000 | 800 | 9,000 |
Polymarket also runs public WebSocket feeds (the market channel at wss://ws-subscriptions-clob.polymarket.com/ws/market, subscribed by token id, and a real-time data feed at wss://ws-live-data.polymarket.com) and official SDKs: @polymarket/client for TypeScript and polymarket-client for Python, both of which support Data API v2 from version 0.10.0, according to the migration guide. This guide uses plain HTTP requests.
Do I need an API key?
Not for reading. The Data API v2 overview says “No API key or authentication is required”, and the Gamma and order book examples in the docs are plain unauthenticated GETs. Every request in this guide worked without any header beyond a normal user agent.
Keys come in only when you act on an account. The docs describe two layers for private order book requests: a wallet signature to create or derive credentials, then signed requests using those credentials. Placing, cancelling and listing your own orders need them; so do some position operations. FollowCheck does not trade, so this guide stops here. If you are building something that trades, read Polymarket’s own authentication docs and the rules for where its markets are available.
How do I get markets and events?
Gamma is the catalogue. An event groups one or more markets; each market is a Yes/No question with two outcome tokens, and the outcome’s token id is what the price and order book endpoints take.
The top open events by 24-hour volume, with their markets nested inside:
curl "https://gamma-api.polymarket.com/events?active=true&closed=false&order=volume24hr&ascending=false&limit=20"
One event by the slug in its polymarket.com address:
curl "https://gamma-api.polymarket.com/events/slug/ai-bubble-burst-by"
Search by text:
curl "https://gamma-api.polymarket.com/public-search?q=bitcoin&limit_per_type=5"
For a full crawl, use the cursor version, which returns {"events": […], "next_cursor": "…"}. Pass the cursor back as after_cursor; the maximum page size is 100.
curl "https://gamma-api.polymarket.com/events/keyset?closed=false&limit=100"
What caught us out:
outcomes,outcomePricesandclobTokenIdsare JSON strings inside the JSON (for example"[\"Yes\", \"No\"]"), so parse them a second time. The first id inclobTokenIdsbelongs to the first outcome.- The docs’ order book page says markets with
version: "v2"(Polymarket’s newer position system) carry their outcome ids inpositionIdsinstead. Checkversionbefore choosing the id field. The market we sampled reported"v1"and usedclobTokenIds. - The event-level
categoryfield wasnullon the samples we pulled;tags[]is the reliable way to group markets. /events/keysetrejectsoffsetwith HTTP 422 and"offset is not allowed on keyset endpoints".- The full resolution rules are in each market’s
description, not its title.
How do I get a wallet’s trades, positions and PnL?
Everything about a wallet lives on the Data API v2, keyed by the wallet’s proxy address (the address shown on its Polymarket profile).
| Need | Endpoint | Notes |
|---|---|---|
| Trades | /v2/trades?user=… |
Taker side only unless taker_only=false |
| Every account event (trades, splits, merges, redemptions, rewards…) | /v2/activity?user=… |
user is required; filter with type |
| Open positions | /v2/positions?user=… |
Default status is open |
| Closed positions | /v2/positions?user=…&status=CLOSED |
There is no /closed-positions route in v2 |
| PnL over time | /v2/user-pnl?user=…&interval=1m&fidelity=1d |
Cumulative series, not a single number |
| Lifetime summary | /v2/user-stats?user=… |
trades counts distinct markets, not fills |
| Portfolio value | /v2/value?user=… |
Marked to market, in USDC |
| Public profile name | Gamma /public-profile?address=… |
404 when the wallet has no profile |
A wallet’s latest trades, both sides of each fill:
curl "https://data-api.polymarket.com/v2/trades?user=$wallet&taker_only=false&limit=1000"
Its daily PnL series for the last month:
curl "https://data-api.polymarket.com/v2/user-pnl?user=$wallet&interval=1m&fidelity=1d"
Things to know before you build on these:
- Responses use snake_case (
proxy_wallet,condition_id); v1 used camelCase. Query parameters accept both spellings. - Markets are selected with
condition(aliasescondition_id,conditionId), up to 20 comma-separated condition ids. The oldmarketparameter returns HTTP 400 with a message namingconditionas the replacement. - Units: a bare
sizeorvolumeis in shares; fields ending in_usdcare dollars. A missing ornullnumber means unavailable, not zero, andoutcome_index: 999means the outcome could not be labelled. - Date filters on trades (
start,end, epoch seconds) apply only whenuseris given. Without a user, the global feed covers only the current and previous month, and market-filtered feeds serve a fixed window of about three years. - PnL fields are cumulative through each point’s timestamp. The docs say historical observations are daily even when you ask for a finer grid; our test returned
source_fidelity: "1d". - Leaderboard and PnL numbers differ by design. Day, week and month boards include unrealized marks; the all-time board is realized only (see below).
FollowCheck’s wallet pages are built from these routes plus every fill read directly from Polygon; you can see the result on any wallet page.
How do I get price history?
Price history moved to the Data API in 2026. Polymarket’s changelog says /v2/prices-history replaces the older order book route; the old route still answered on November 8, 2026.
curl "https://data-api.polymarket.com/v2/prices-history?token_id=$token_id&interval=1w&bucket_seconds=10800"
- The key is
token_id, notmarket, and the bucket width isbucket_seconds, notfidelity. - Choose exactly one window:
interval(max,all,1m,1w,1d,6h,1h), an explicitstart/end, oras_offor a point in time. - Explicit windows are capped at 15 days. A wider one returned HTTP 400:
"'start' to 'end' must span at most 15 days". For a market’s whole life, useinterval=max. - Retention depends on bucket width. The docs describe permanent 3-hour and 12-hour series, and fine series kept for at least 7 days (1 minute), 60 days (5 minutes) and 90 days (30 minutes). Asking for a fine bucket over an old range returns an empty or sparse page rather than an error.
- Resolved markets end with a settlement point (0, 1 or a fraction).
The legacy route takes market (the token id) and fidelity in minutes and returns {"history": [{"t": …, "p": …}]}:
curl "https://clob.polymarket.com/prices-history?market=$token_id&interval=1d&fidelity=60"
How do I get the leaderboard?
curl "https://data-api.polymarket.com/v2/leaderboard?time_period=month&category=politics&sort_by=PNL&limit=100"
time_period:day(default),week,monthorall.sort_by: PnL (default) or volume.category:overallby default. On November 8, 2026 these returned ranked rows: overall, politics, sports, crypto, culture, economics, tech, finance, weather, mentions, esports and combos. The docs give no complete list.- An unknown category returns HTTP 200 with
"data": [], not an error. A typo looks exactly like an empty board, so validate category names yourself. user=0x…returns one wallet’s PnL, volume and rank instead of the board; a rank ofnullor0means unranked.- Names for wallets that never set one often look like
0xA2cd…2Ba0-1729178570395(the address plus a timestamp). Treat those as “no display name”. /v2/biggest-winnerslists the largest single resolved wins per period, one row per winning position, not per user.
FollowCheck’s own leaderboard is built from on-chain fills and simulated copy results, not from this endpoint.
How do I read the order book?
curl "https://clob.polymarket.com/book?token_id=$token_id"
The response has bids, asks, tick_size, min_order_size, neg_risk, last_trade_price and a hash you can compare between reads to see whether the book changed. Prices and sizes are strings.
The trap: bids are sorted from the lowest price up and asks from the highest price down, so the top of the book is the last entry on each side, not the first. On a live sports market we read on November 8, 2026, the bid list ran from 0.03 to 0.51 and the ask list from 0.97 to 0.94. Code that takes bids[0] gets the lowest bid in the book.
Other public reads, each by token_id: /price (with a side parameter), /midpoint, /spread and /last-trade-price. Batch versions (POST /books, /prices, /midpoints, /spreads, /last-trades-prices) take a JSON list of token ids. A token with no book (for example a closed market) returns HTTP 404 with "No orderbook exists for the requested token id".
There is no historical order book in any of these APIs. You get the book as it is now; past books exist only if someone saved snapshots.
Paging and rate limits
Data API v2 cursors. Every response is {"data": …}; paged routes add pagination with has_more and next_cursor. Send the first request with an optional limit, then repeat it with cursor=<next_cursor> until next_cursor is null.
- Never send
offset, not evenoffset=0. It returns HTTP 400:"'offset' is not a query param on this API: pages are cursor-only…". - On the feeds (
/v2/trades,/v2/activity), re-send the same filters with every cursor. The cursor carries only its position, so changing a filter mid-walk quietly re-anchors the feed. - On
/v2/positions, keep sending theuserorconditionanchor; a bare?cursor=returned HTTP 400. limitapplies to the first page only. The maximum is 1,000 rows on trades, activity, positions, holders and leaderboards, and 10,000 points on price history.has_moreis exact: an empty or short page does not mean the walk is over.
Rate limits are per IP address over sliding 10-second windows, as listed on Polymarket’s rate-limit page on November 8, 2026:
| Scope | Requests per 10 s |
|---|---|
| Data API v2, all routes | 800 |
/v2/trades |
300 |
/v2/positions, /v2/activity, /v2/prices-history |
200 each |
| Gamma, all routes | 4,000 |
Gamma /events / /markets / /public-search |
500 / 300 / 350 |
| Order book API, all routes | 9,000 |
/book, /price, /midpoint |
1,500 each |
/books, /prices, /midpoints |
500 each |
The global /v2/trades feed came back with cache-control: public, max-age=300 in our tests, so polling it more often than every five minutes returns the same rows.
Common errors
| What you see | What it means |
|---|---|
HTTP 410, "Data API v1 has been retired" |
You are calling a v1 route (/trades, /positions, /v1/leaderboard…). Move to the /v2/ path. |
HTTP 400, "'offset' is not a query param on this API…" |
Remove offset and follow next_cursor. |
HTTP 400, "'market' is not a query param on this API…" |
Use condition with condition ids. |
HTTP 400, "required query param 'user' or 'condition' not provided" |
Positions (and a resumed positions cursor) need an anchor. |
HTTP 400, "'start' to 'end' must span at most 15 days" |
Shorten the price-history window or use interval. |
HTTP 200 with "data": [] on the leaderboard |
Usually a misspelt category. |
HTTP 200 with "data": null |
The wallet or item is unknown; v2 reports misses this way, not as 404. |
HTTP 422, "offset is not allowed on keyset endpoints" |
Gamma /events/keyset takes after_cursor. |
HTTP 404, "No orderbook exists for the requested token id" |
Closed market or wrong outcome id. |
HTTP 429 with Retry-After |
Slow down and wait the stated time. |
Data API v2 errors are JSON. The ones we triggered carried error, code (invalid_request), retryable and trace_id.
Where the docs and our tests differ
- v1 shutdown. The migration guide says Data API v1 “retires on November 2, 2026”, and the rate-limit page still lists v1 limits. On November 8 the v1 routes we tried returned HTTP 410.
- Price history host. The changelog says
/v2/prices-historyreplaces the order book route, butclob.polymarket.com/prices-historystill returned HTTP 200, and the order book API’s own reference still documents it. - Over-limit behaviour. The rate-limit page says requests over the limit are throttled (delayed or queued) rather than rejected; the Data API v2 overview says heavy load answers with HTTP 429 and
Retry-After. Handle both. We did not push any endpoint to its limit. - Error shape. The v2 overview’s example error has only an
errorfield. The OpenAPI file and the live 400s also includecode,retryableandtrace_id, plus anx-trace-idheader. - Leaderboard categories. The docs do not list valid categories or say what an unknown one does; in our test it returned an empty 200.
How FollowCheck uses these APIs
We use Gamma for events and markets (refreshed about every 10 minutes), the Data API v2 for profiles, holders, leaderboards and wallet stats, and order book snapshots to estimate whether a simulated copy order could have filled. Trades themselves come from on-chain OrderFilled events on Polygon, so every fill on a FollowCheck page can be traced to a block and log index. The methodology explains the pipeline, and How to download Polymarket data covers on-chain sources, indexers and exporting your own history. All copy figures on FollowCheck are simulations.
FAQ
Is the Polymarket API free?
Reading needs no key and no payment on Gamma, the Data API v2 and the order book’s market-data endpoints, within the per-IP rate limits above. Polymarket’s docs also list builder tiers with their own rate limits for apps that route orders; we did not review those.
Why does my old Polymarket API code return 410 or 400?
Data API v1 is retired: v1 routes returned HTTP 410 in our tests on November 8, 2026. Code ported to v2 still fails with HTTP 400 if it sends offset or market; v2 uses cursor and condition.
How do I get all trades for one market?
Call /v2/trades?condition=<condition id>&taker_only=false and follow next_cursor, re-sending the same filters each time. Market-filtered queries cover a fixed window of about three years. For a complete history from launch, use on-chain fills.
Can I get historical order books?
No. The order book endpoints return the current book only. Price history gives traded or midpoint-style prices per bucket, not depth.
Where do I find the token id for an outcome?
In Gamma, inside each market: clobTokenIds (a JSON string to parse a second time) for markets with version other than "v2", or positionIds for "v2" markets, according to the docs.
Sources
Checked 2026-11-08.
- Polymarket docs index (llms.txt)
- Polymarket docs: API overview and authentication layers
- Polymarket docs: SDKs and APIs
- Polymarket docs: Data API v2 overview (envelope, cursors, units, errors, price-history retention)
- Polymarket docs: migrate from Data API v1 to v2
- Polymarket docs: rate limits
- Polymarket docs: market data overview
- Polymarket docs: prices and order books
- Data API v2 OpenAPI file (version 0.1.0: conventions, errors, auth)
- Polymarket changelog: predictions (Data API v2 launch, price history moving to the data host)
- FollowCheck’s own test calls on November 8, 2026 against Gamma (
/events,/events/keyset,/events/slug,/public-search), the Data API (v1 routes,/v2/trades,/v2/positions,/v2/leaderboard,/v2/prices-history) and the order book API (/book,/prices-history). Results such as the 410, 400, 422 and 404 messages above are quoted from those responses. Thecache-controlheader, theuser-pnlsource_fidelityvalue and the list of working leaderboard categories come from FollowCheck’s earlier test calls the same day.