Skip to content
Recording 4 venues

How to get Polymarket historical data

Polymarket's public APIs give you price history, trades and market details without an API key, and every fill is on-chain on Polygon. Past order books are not available from Polymarket: the book endpoint shows only the book as it is now.

Checked against Polymarket's APIs on October 31, 2026.

Where Polymarket's history lives

DataSourceWhat you get
Marketsgamma-api.polymarket.com/markets, /eventsQuestion, slug, outcomes, condition id and one token id per outcome (clobTokenIds). Add closed=true for markets that have ended.
Pricesclob.polymarket.com/prices-historyOne price per step for one outcome token. With interval=max, 1-minute and 1-hour steps reach back about a month; 12-hour steps (fidelity=720) cover the market's whole life.
Tradesdata-api.polymarket.com/v2/tradesTrades for a market (condition=): wallet, side, outcome, price, size, time and transaction hash. Paged with next_cursor.
On-chain fillsPolygonEvery match settles on-chain, and Polymarket's exchange contracts log it as an OrderFilled event. Read them with a Polygon node or an indexer.
Order bookclob.polymarket.com/bookThe book right now for one token: bids and asks. Nothing from the past.

Price history for a market

import json
import requests

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

slug = "will-the-us-invade-iran-before-2027"
market = requests.get(f"{GAMMA}/markets", params={"slug": slug}, timeout=30).json()[0]
yes_token = json.loads(market["clobTokenIds"])[0]

def prices(token, fidelity):
    params = {"market": token, "interval": "max", "fidelity": fidelity}
    r = requests.get(f"{CLOB}/prices-history", params=params, timeout=30)
    r.raise_for_status()
    return r.json()["history"]  # [{"t": unix seconds, "p": price}, ...]

whole_life = prices(yes_token, 720)  # every 12 hours, back to the first day
last_month = prices(yes_token, 1)    # every minute, about the last 31 days

Every trade in a market

DATA = "https://data-api.polymarket.com"

def trades(condition_id):
    """Every trade in a market, newest first, following the cursor to the end."""
    params = {"condition": condition_id, "limit": 1000}
    while True:
        r = requests.get(f"{DATA}/v2/trades", params=params, timeout=30)
        r.raise_for_status()
        body = r.json()
        yield from body["data"]
        if not body["pagination"]["has_more"]:
            break
        params["cursor"] = body["pagination"]["next_cursor"]

rows = list(trades(market["conditionId"]))

What the APIs leave out

  • Past order books. The bids, asks and size at each price at any past moment are gone once the book changes.
  • Fine prices on older days. Past the last month, price history comes in 12-hour steps.
  • Bid and ask. Price history is one price per step, not the two sides of the book.

Order book history

Kalshi Eye records Polymarket's order book around the clock: every book snapshot and price-level change for both outcome tokens of every market, every trade, and every on-chain fill, 35.4 billion rows so far. Each UTC day is published the next morning as Parquet files.

  • polymarket_l2: every book change, to rebuild both tokens' books at any moment.
  • polymarket_trades and polymarket_fills: trades, and the on-chain OrderFilled logs.
  • polymarket_markets and chainlink: each day's markets, and the Chainlink prices the crypto markets settle on.

Code to rebuild a Polymarket book from polymarket_l2 is in Kalshi vs Polymarket data.

Questions

Does Polymarket have historical order book data?

Not through its APIs. The book endpoint returns each token's book as it is now, and orders rest off-chain, so past books exist only where someone recorded them as they changed.

How far back does Polymarket price history go?

To the market's first day at 12-hour steps (fidelity=720). At 1-minute and 1-hour steps, prices-history returned only the last 31 days when we checked.

Do I need an API key for Polymarket's data?

No. Markets, price history, trades and the current order book answer without one. Placing orders needs a key.

Next