← Backtesting

Data API

Marketlens: replay a strategy against historical order books

Marketlens pairs a historical Polymarket API with a Python replay engine. It provides L2 order books, trades and candles for researchers who need to investigate liquidity and simulated execution beyond a price chart.

Available on
API

Screenshots and interface

What is Marketlens?

The archive starts on March 1, 2026 for covered markets; check each market’s actual coverage rather than treating that date as continuous history for everything. Strategy callbacks expose book updates, trades, fills, rejects and market boundaries, with a simulated account for balances, positions and order controls.

Exports and replays need two kinds of budgeting: data allowance and execution assumptions. Request a dry-run quote before a large export, and specify latency, queue and fill behavior before judging a strategy. Inspect effective coverage because a history-store failure can skip a market during a backtest.

Who it is for

  • Quant researchers studying execution and depth.
  • Developers building trade and candle datasets.
  • Teams planning large historical exports.

Features and coverage

  • Historical market data

    Retrieve L2 book depth, trades and candles for covered markets.

  • Python callbacks

    React to book updates, trades, fills, rejects and market boundaries in your strategy.

  • Simulated account controls

    Inspect balances and positions, manage orders and use split/merge operations.

  • Export estimates

    Quote a large export before running it. Downloading the same completed export again does not incur new row charges.

  • Cursor pagination

    List endpoints use opaque cursors; the SDK can paginate automatically. Cursors expire after 24 hours.

  • Explicit execution assumptions

    Configure latency, queue and fills rather than assuming every displayed price is tradable.

Workflows with Marketlens

Start with one market

Check coverage, fetch history and replay a small strategy with documented fill and latency settings. Inspect fills and positions before expanding the test.

Budget a research dataset

Choose markets and dates, request a dry-run estimate and compare it with your row allowance. Retain the finished export for repeatable local analysis.

Pricing and total cost

Free supplies 2 million rows once and a recent seven-day market-access window. Pro costs US$39/month; Scale costs US$199/month.

Free

US$0

  • 2 million rows once.
  • Recent seven-day market-access window.

Pro

US$39/month

  • 5 billion rows/month.
  • 3,600 requests/minute.
  • 5 API keys.
  • Full archive.

Scale

US$199/month

  • 50 billion rows/month.
  • 10,800 requests/minute.
  • 25 API keys.
  • Full archive.

Fees and usage costs

  • Unused paid-plan rows roll over for one month.
  • A separate daily request-unit budget applies; limits are shared across a user’s keys.

Getting started

Before you start: Check actual coverage per market; the archive start date is not universal continuous history.

  1. Create an API key in the Marketlens console.
  2. Install the marketlens Python package or use REST.
  3. Set MARKETLENS_API_KEY and request a small market list.
  4. Check coverage and quote an export before fetching history.
  5. Replay one market and inspect fills and simulated account state.

The archive start date does not guarantee continuous coverage for every market.

Read Marketlens documentation

Useful links

What to check

  • Check actual coverage per market; the archive start date is not universal continuous history.
  • Cursors expire after 24 hours.
  • A history-store failure can skip a backtest market.
  • Queue, latency and fill settings materially affect replay results.

A closer look

Ratings & reviews

Editorial rating
4.0/ 5
0 user reviews

Our take on Marketlens

Explicit allowances and execution assumptions make the research task easier to scope. Archive gaps and markets skipped during a backtest still require inspection in each result.

Based on documented features, setup and access terms. How we rate

User reviews 0

The main score switches to user ratings after 5 published reviews.

Be the first to share your experience

A specific example helps the next person choose the right tool.

Related tools

Browse category

Frequently asked questions about Marketlens

Why use L2 history instead of a chart?

Book depth helps study liquidity and fills; a price chart usually summarizes prices.

Can I estimate row usage first?

Yes. Use the documented dry-run quote before starting an export.

Can I replay my own Python strategy?

Yes. The engine supplies strategy callbacks and simulated account controls.