Polymarket backtest API

Polymarket backtest API: replay 118,251 resolved markets on 250ms L2 order books

A Polymarket backtest API is only as good as the book it replays on. Backtest AI and the PolyOrderbooks REST API replay your strategy over resolved Polymarket crypto up/down markets — more than 118,000 of them — walking the historical bid/ask ladder at every 250ms tick instead of an assumed mid price.

Figures measured as of 2026-10-02 on the published PolyOrderbooks archive.

Short answer

A backtest is only as good as the book it replays on

A Polymarket backtest needs two things: historical data and a fill model. PolyOrderbooks provides both. The archive captures prices, metrics, and full L2 order book ladders every 250ms for crypto up/down markets — BTC, ETH, SOL, BNB, DOGE, HYPE, XRP, and ZEC at 5-minute, 15-minute, and 4-hour windows.

Only markets that have already resolved are used for scoring. With 118,251 resolved markets on file, a strategy is tested against what actually happened, not against a hypothesis about what might.

Under the hood

The archive behind the API

118,251resolved markets
143.5ML2 order book snapshots
8coins tracked
250msresolution on every plan

Realism

Fills that walk the ladder, not the midpoint

Filling at the mid assumes you capture half the spread on every entry and exit. On Polymarket crypto Up/Down books, where liquidity concentrates around a few price levels and the book thins in the final minute before resolution, that assumption flatters most strategies. On the published dataset, 5-minute markets are one-sided 16.9% of the time and 3.24% of snapshots are crossed.

The replay engine walks the historical 250ms L2 ladder at each tick instead: it reads the size available at each price level, models partial fills when a level runs out, applies slippage when a larger order has to cross the book, and logs why each exit fired — take profit, stop loss, window end, or no fill.

Two ways in

Backtest AI, or the REST API on the same archive

  • Backtest AI — describe a strategy in plain English, e.g. “Buy DOWN on BTC 15m below 0.40, take profit at 0.55, stop loss at 0.30”, and it parses the rule, replays it, and reads the result back with a Summary, Key Observations, and an Actionable Takeaway. No Python required.
  • REST API + Python SDK — pull the same 250ms order book history and run your own strategy code. Polymarket order book data is one query away.
  • The archive your API key queries is the archive Backtest AI replays on — there is no second vendor's dataset to reconcile.

Plans

Who can use it

  • [Starter](/signup) stays free — 250ms L2 books, prices, and metrics with 3 days of history, 60 requests/min, 1,000/day, plus 1 free AI backtest and 3 free strategy backtests.
  • Backtest AI — +$19/mo add-on on any data window, or a standalone $29/mo plan with ~500 AI backtests/month and no data API.
  • Data windows — from $19/mo (30 days of history) up to $49/mo (120 days), with Fast/Heavy speed add-ons for higher rate limits.
  • See how it measures against the alternatives before choosing.

Verify the data

The archive is citable and free to inspect

The underlying dataset carries DOI 10.5281/zenodo.22084114, is mirrored on Kaggle and Hugging Face, and is free to inspect via the BTC 5-minute CSV/JSON sample. The methodology behind replay and fill simulation is in the post on historical Polymarket order book data backtesting.

Worked example

The same idea through the record

The API answers one question everywhere else is marketing: what happens to my rules on the books as they actually stood? A request names a market set and a rule set, and the replay walks the stored 250ms ladders instead of guessing fills from a closing price column. Because every one of the 118,251 resolved markets is scored on its real book, a strategy that looks profitable on paper gets to prove it against 5-minute, 15-minute, and 4-hour windows across the eight recorded coins.

The typical first call is a btc 15m rule: buy DOWN below a floor, take profit at a ceiling, stop loss at a cut, exit at window end. The response reports fills, the fills' price paths, and the exit reason for every contract in the window — thousands of rows that a sheet can summarise without any of the fills having been invented.

Reading the report critically means checking the fill column against the venue's one-sidedness: 5-minute books are one-sided 16.9% of the time, and 3.24% of snapshots are crossed, so a mid-fill backtest quietly buys liquidity that never existed. The API's ladder-walking fill model is the part that keeps the score honest, and it is the same engine across the REST path and Backtest AI.

Teams that outgrow the interactive tool drop into the API for scripted runs: same archive, same fill rules, no Python engine of their own to maintain. The free 897,192-snapshot dataset means the same books can be inspected row by row before a single paid call.

Signals

What to check before you trust it

Watch the exit-reason breakdown first: a strategy that exits at window end far more often than it hits its take-profit is telling you the book never offered your target, and no parameter sweep changes that.

Compare the same rule across window lengths — 5m versus 4h — because the one-sidedness rate and the crossed-book rate differ by window, and a rule tuned on one cadence can be silently worthless on another.

A real sanity check is to replay one known contract end to end: place a trivial rule, read the fills, and reconcile them against the stored snapshot for the same second. If the path matches the book, the engine is doing what its docs say.

Finally, keep a run book: every backtest posted on the site should name its window, its coins, and the exit-rate table, so the study can be reproduced from the archive rather than trusted from a headline win rate.

FAQ

What exactly does a Polymarket backtest API replay on?

Backtest AI replays your strategy over resolved Polymarket crypto up/down markets from the PolyOrderbooks archive — more than 118,000 of them across BTC, ETH, SOL, BNB, DOGE, HYPE, XRP, and ZEC at 5-minute, 15-minute, and 4-hour windows. Only markets that have already resolved are used, so every run is judged against what actually happened.

How does Polymarket backtesting handle fills?

The engine walks the historical 250ms L2 bid/ask ladder at each tick instead of filling at a midpoint. Entries and exits respect available size at each price level, model partial fills, and apply slippage when a larger size has to cross the book. Exit reasons are tracked too — take profit, stop loss, window end, or no fill.

Do I need to write Python to backtest on Polymarket?

No. Backtest AI takes a plain-English description like “Buy DOWN on BTC 15m below 0.40, take profit at 0.55, stop loss at 0.30” and turns it into executable rules. If you prefer code, the same archive is available through the REST API and the official Python SDK with 250ms resolution on every plan.

Which plans include Polymarket backtesting?

Backtest AI is available as a +$19/mo add-on on any paid data window, or as a standalone $29/mo plan with unlimited strategy backtests, ~500 AI backtests/month, 30-day market data for AI, and no REST API data access. Starter stays free — 250ms L2 order books, prices, and metrics with 3 days of history, plus 1 free AI backtest and 3 free strategy backtests — which is enough to try a strategy before upgrading.