Prediction markets API
One prediction market's OHLC-style bars over a bounded window
The priced series for one market over a bounded window, in OHLC-style bars. A different question from the market's state: how the price moved, not what it is.
/api/external/prediction/prediction-market-bars/{id}What it returns
Per-bucket probability (0-1), volume and trade-count bars for one market, addressed by the id from GET /prediction/prediction-markets. Bounded by from/to (Unix seconds) and capped at 1000 bars per request.
Chains
This endpoint is not tied to a chain: it takes no chain in its request.
Request
Send your key in the x-dex-data-key header. Replace each <placeholder> with a real value.
curl -H "x-dex-data-key: $DEXDATA_API_KEY" \ "https://api.dexdata.io/api/external/prediction/prediction-market-bars/<id>?resolution=min1&from=<from>&to=<to>"
| Parameter | Description |
|---|---|
resolutionquery · string · required | The bucket width.min1min5min15min30hour1hour4hour12day1week1 |
fromquery · integer · required | Window start, Unix seconds (inclusive). |
toquery · integer · required | Window end, Unix seconds (inclusive). Per market, a window of ≤ 90 bars keeps the answer under 32 KB; a batch keeps markets × bars ≤ 80. |
idpath · string · required | A prediction-market id, e.g. "<marketAddress>:Polymarket:<exchangeAddress>:<networkId>" or "<slug>:Kalshi" — not a token mint or contract address, and not scoped to any chain this API otherwise supports. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
marketId | string | null | |
bars | object[] | |
bars[].t | number | null | Bucket open time, Unix seconds. |
bars[].volumeUsd | number | null | Volume across both outcomes in this bucket, USD. |
bars[].uniqueTraders | number | null | |
bars[].trades | number | null | |
bars[].allTimeVolumeUsd | number | null | Cumulative lifetime volume as of this bucket, USD. |
bars[].outcome0 | object | null | |
bars[].outcome0.trades | number | null | |
bars[].outcome0.volumeUsd | number | null | |
bars[].outcome0.priceUsd | object | null | |
bars[].outcome0.priceUsd.o | number | null | |
bars[].outcome0.priceUsd.h | number | null | |
bars[].outcome0.priceUsd.l | number | null | |
bars[].outcome0.priceUsd.c | number | null | |
bars[].outcome1 | object | null | |
bars[].outcome1.trades | number | null | |
bars[].outcome1.volumeUsd | number | null | |
bars[].outcome1.priceUsd | object | null | |
bars[].outcome1.priceUsd.o | number | null | |
bars[].outcome1.priceUsd.h | number | null | |
bars[].outcome1.priceUsd.l | number | null | |
bars[].outcome1.priceUsd.c | number | null |
Start building with DexData today
Sign in, create a key and make your first call in a minute. Free credits every month, and you only pay for calls that succeed.
Get a free API key