Quickstart
Sign up, mint an API key, and pull your first resolved market. Five minutes, two commands.
1. Get an API key
Create an account, then head to API keys and click Create key. The plaintext value is shown once — copy it somewhere safe.
Note
On the Free plan, dataset downloads and
/range are scoped to BTC and a recent window (roughly the last seven days); the /markets metadata listing itself is not date-gated. See pricing for the full Pro tier.2. Make your first request
Set the key as an environment variable, then list resolved BTC markets on the 4h timeframe:
terminal
export POLYREPLAY_API_KEY="pr_..." curl https://polyreplay.dev/api/v1/markets \ -H "Authorization: Bearer $POLYREPLAY_API_KEY" \ -G \ --data-urlencode "token=BTC" \ --data-urlencode "timeframe=4h" \ --data-urlencode "resolved=true" \ --data-urlencode "limit=3"
3. Read the response
Each market includes the condition ID (use it to fetch books or trades), the start/end window, the winner, and the final volume. Results are wrapped in a data array alongside a pagination object.
200 OK
{
"data": [
{
"condition_id": "0xabc123...",
"slug": "btc-updown-4h-1747776000",
"question": "Bitcoin Up or Down — May 20, 12pm ET?",
"asset": "BTC",
"timeframe": "4h",
"yes_token_id": "0x...",
"no_token_id": "0x...",
"start_date": "2025-05-20T12:00:00Z",
"end_date": "2025-05-20T16:00:00Z",
"winner": "Up",
"btc_price_start": 67342.10,
"btc_price_end": 67501.88,
"final_volume": 184230.55,
"final_liquidity": 52110.40
}
],
"pagination": { "limit": 3, "offset": 0, "total": 1 }
}4. Pull the order book
Take any condition_id from above and fetch its top-of-book quotes. Rows return ts, side, best_bid, and best_ask.
terminal
curl https://polyreplay.dev/api/v1/markets/0xabc123.../book \ -H "Authorization: Bearer $POLYREPLAY_API_KEY" \ -G \ --data-urlencode "side=yes"
What's next
- Markets reference — every filter, sort, and field.
- Order book reference — top-of-book quote fields and filters. (L25 depth ships in the Parquet datasets.)
- Bulk Parquet datasets— for backfills that don't fit a REST call.