Yes — Polymarket has APIs. There is no single "Polymarket API" endpoint for every task. Developers typically combine the Gamma API (discovery and metadata), the CLOB API (live prices, order books, and trading), the Data API (public activity and positions), and documented historical price endpoints — then add an archive when they need to replay past L2 depth.

This guide maps those surfaces to real workflows: market data, historical prices, order books, official rate limits, Python access, and when a hosted archive helps for historical L2 replay. PolyOrderbooks is mentioned only where official APIs do not store past book state. It is an independent product and is not affiliated with Polymarket.

Does Polymarket have an API?

Polymarket publishes developer documentation, REST APIs, WebSocket feeds, and official TypeScript and Python SDKs. Public market-data endpoints do not require a paid API subscription; trading and private account reads use API keys and wallet authentication as described in the wallets and authentication docs.

At a high level, the main interfaces look like this:

API / surfaceBest forTypical data
Gamma API
gamma-api.polymarket.com
Market discoveryEvents, markets, tags, metadata, clobTokenIds
CLOB API
clob.polymarket.com
Live book, prices, tradingCurrent order book (/book), prices, midpoints, spreads, orders, trades
Data API
data-api.polymarket.com
Public activity analyticsTrades, positions, closed positions, user activity (see official Data API docs)
Historical prices (CLOB)Price-series historyImplied-probability time series via /prices-history (per outcome token)
PolyOrderbooksArchived historical market stateHistorical L2 books, bucketed prices, volume/liquidity metrics (independent archive)

For orientation, start with Polymarket's SDKs & APIs overview and the market data overview.

Which Polymarket API should you use?

Discovering markets and events

Use the Gamma API to list or search events and markets, read tags, and resolve clobTokenIds before calling CLOB market-data routes. Polymarket's discover markets guide walks through listing and filtering.

Reading the current order book

Use the CLOB API GET /book endpoint (token id required) or subscribe to the public market WebSocket for streaming updates. These surfaces return the book now, not a stored ladder from last week.

Trading programmatically

Order placement, cancellation, and authenticated trade history live on the CLOB trading surface with L2 API keys and signing. See place your first order and the order API reference.

Retrieving historical prices

Polymarket documents GET /prices-history on the CLOB for outcome-level price series, plus batch history endpoints in the API reference. That is the right starting point for charts and coarse signal work. Our Polymarket price history with Python article shows a minimal download flow.

Replaying a historical order book

Historical prices are not the same as historical L2 depth. Polymarket's documented APIs provide current order-book data and historical price series, but the official documentation does not expose a general-purpose endpoint for querying complete historical L2 ladders at arbitrary past timestamps. For that workflow you either record books yourself or query a third-party archive such as PolyOrderbooks (not affiliated with Polymarket).

Polymarket market data API

For analysis and monitoring, developers usually pull:

  • Market metadata — questions, outcomes, condition ids, volume, and liquidity fields from Gamma.
  • Outcome / token identifiersclobTokenIds tie Gamma markets to CLOB routes.
  • Prices and midpoints — best bid/ask, midpoint, spread, and last trade via CLOB market-data endpoints.
  • Current order-book state — bids and asks with size at each level from /book or WebSocket market channel.
  • Activity where supported — public trades and positions via the Data API; authenticated trade history via CLOB when you have keys.

Polymarket's prices and order books page explains how quotes relate to the CLOB. For broader analytics (leaderboards, open interest, live volume), see the public analytics docs.

Polymarket order book API

The documented CLOB order-book endpoint returns a summary for one outcome token: bids and asks as price/size levels, tick size, last trade price, and a snapshot timestamp. Batch variants exist for multiple tokens. Real-time updates are available on the market WebSocket channel.

When reading a book response, pay attention to:

  • Bids and asks — separate ladders; best bid is highest buy, best ask is lowest sell.
  • Depth — how much size rests at each price level.
  • Spread — distance between best bid and best ask (also available via dedicated endpoints).
  • Current vs historical — the REST /book route describes the book at request time.

Fetching the order book now is different from asking what the complete order book looked like yesterday at a particular second. The official API answers the first question; archived L2 data answers the second.

Polymarket historical data API

Polymarket does expose historical price data through documented CLOB routes such as /prices-history and batch price-history endpoints in the API reference. Each point is a timestamp and implied probability for a specific outcome token — useful for time-series charts and many research tasks.

That history is not equivalent to a stored L2 order-book archive. Price lines do not tell you how much size sat on each level, how the spread evolved tick-by-tick, or whether a large order could have filled against the visible stack. For a broader download-oriented overview, see our Polymarket historical data guide, or compare Polymarket historical data providers.

Polymarket API pricing — is the API free?

Polymarket does not publish a separate "API subscription" for public market-data endpoints in the way a commercial data vendor might. Discovery, live quotes, order books, and documented historical price routes are available to developers subject to documented rate limits. Public API access is separate from trading fees. Some Polymarket markets charge taker fees, while other markets may be fee-free. Check Polymarket's current fee documentation for market-specific details.

PolyOrderbooks API pricing is different: we sell access to an independent historical archive with a free Starter tier and paid Pro and Scale plans for longer lookbacks and finer resolution. See PolyOrderbooks pricing for current plan limits — not Polymarket's official pricing.

Polymarket API rate limits

Polymarket enforces IP-based limits across its APIs using Cloudflare throttling. When you exceed a limit, requests are delayed rather than always rejected immediately. Limits vary by API and endpoint — for example Gamma, Data API, and CLOB each have their own tables, and CLOB trading routes also use separate per-signer trading limits.

Representative public read limits (verify current values in official docs):

  • Gamma general — 4,000 requests / 10s
  • Data API general — 1,000 requests / 10s
  • CLOB /book — 1,500 requests / 10s
  • CLOB /prices-history — 1,000 requests / 10s

Do not treat this list as exhaustive. Use Polymarket's rate limits documentation as the source of truth and design clients with pacing and backoff.

PolyOrderbooks rate limits are enforced per API key on our hosted archive, with different per-minute and daily quotas by plan. They are unrelated to Polymarket's Cloudflare limits — see PolyOrderbooks rate limits.

Using the Polymarket API with Python

Polymarket provides an official Python CLOB client for market data, authentication, and order management. For simple public reads, developers can also call the Gamma and CLOB REST APIs directly with requests.

The example below:

  1. Lists an active market on Gamma and parses clobTokenIds.
  2. Calls GET /book on the CLOB for the YES outcome token.
  3. Prints the best bid and ask levels from the response.
import json
import time

import requests

GAMMA = "https://gamma-api.polymarket.com"
CLOB = "https://clob.polymarket.com"

# 1. Discover a market and read outcome token IDs (Gamma — public)
markets = requests.get(
    f"{GAMMA}/markets",
    params={"limit": 5, "active": True, "closed": False},
    timeout=60,
)
markets.raise_for_status()
market = markets.json()[0]
token_ids = json.loads(market["clobTokenIds"])
yes_token_id = token_ids[0]

print(market["question"])
print("YES token:", yes_token_id[:16], "...")

# 2. Read the current order book for that outcome (CLOB /book — public)
book = requests.get(
    f"{CLOB}/book",
    params={"token_id": yes_token_id},
    timeout=60,
)
book.raise_for_status()
payload = book.json()

best_bid = payload["bids"][0] if payload.get("bids") else None
best_ask = payload["asks"][0] if payload.get("asks") else None
print("best bid", best_bid, "best ask", best_ask)

time.sleep(0.2)  # respect IP-based rate limits when looping

For price history instead of the live book, swap the second request for /prices-history — see our price history Python walkthrough. Polymarket's REST API guide lists base URLs and authentication expectations per surface.

Current order book vs historical L2 order book

Current order book

Shows available bids and asks at request time (REST) or as a stream (WebSocket). Good for live monitoring, execution, and market-making.

Historical price series

Shows how implied probabilities moved over time for an outcome token. Good for charts, event-study style analysis, and coarse backtests that only need a price line.

Historical L2 archive

Stores what bid/ask depth and available size looked like at past timestamps — often as repeated snapshots or bucketed ladders. That matters when you care about:

  • Backtesting with realistic fills and slippage
  • Spread and liquidity research
  • Market microstructure such as book imbalance, spread/depth dynamics, and depth consumption

Our historical order book data for backtesting article walks through why mids and prints are often insufficient.

Free Polymarket historical order book dataset

If you want to inspect what historical L2 data looks like before using an API, PolyOrderbooks publishes a free BTC 5-minute sample dataset: a resolved short-horizon BTC market with 1-second L2 snapshots for both outcomes, full bid/ask ladders, CSV and JSON downloads, and no signup required.

When should you use PolyOrderbooks?

Consider our archive when your workflow needs:

  • Stored historical L2 order books and depth replay
  • Historical liquidity and spread metrics aligned on the same timestamps
  • Programmatic access without operating your own 24/7 recorder
  • Longer lookbacks or 1-second query resolution on paid plans

Use official Polymarket APIs when live discovery, current books, trading, or documented price history is enough. Browse developer resources for links to our SDK, examples, and API documentation.

FAQ

Does Polymarket have an API?

Yes. Polymarket provides Gamma (discovery), CLOB (live market data and trading), Data API (public activity), WebSocket feeds, and documented historical price endpoints. See docs.polymarket.com.

Is the Polymarket API free?

Public market-data and historical-price endpoints are available without a separate API subscription fee, subject to rate limits. Some markets separately charge trading fees.

Does Polymarket provide historical data?

Yes — documented historical price endpoints exist on the CLOB. The official documentation does not expose a general-purpose endpoint for complete historical L2 ladders; teams typically record books themselves or use an archive provider.

Can I get historical Polymarket order books?

Polymarket documents current order books and historical price series, but not a general-purpose endpoint for querying complete historical L2 ladders at arbitrary past timestamps. For that, teams typically record books themselves or use an archive provider.

Does Polymarket have a Python API?

Yes. Polymarket provides an official Python CLOB client as well as REST APIs that can be called directly from Python.

What is the Polymarket CLOB API?

The Central Limit Order Book API at clob.polymarket.com handles live order books, prices, order placement, and related market-data routes. It is the trading and live market-structure layer — see Polymarket's prices & orderbook concepts.

What are the Polymarket API rate limits?

IP-based limits differ by API and route. Consult Polymarket's rate limits page for current tables; trading routes have additional per-signer limits.