Prediction markets API
Many prediction markets' state and live outcome prices
Up to 25 prediction markets in one request: each one's lifecycle, windowed stats and the live price of each outcome.
/api/external/prediction/prediction-market-batchWhat it returns
The prediction-market answer for many markets in one request, addressed by the ids from GET /prediction/prediction-markets. Each result is exactly what prediction-market answers for that market, with the same caveats on every field — including the all-null answer for a well-formed id nobody recognises, which is a result, not an error. POST, because the list is the subject: it can run past what a URL comfortably holds, and a body keeps a watch list out of every proxy log between the caller and this service.
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 -X POST -H "x-dex-data-key: $DEXDATA_API_KEY" \
-H "content-type: application/json" \
-d '{"subjects":["<subjects>"]}' \
"https://api.dexdata.io/api/external/prediction/prediction-market-batch"| Parameter | Description |
|---|---|
subjectsbody · string[] · optional | Prediction market ids — never a token mint or contract address. Between 1 and 25, each sent once. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
results | object[] | One entry per requested subject, in the order they were sent. |
results[].subject | string | The subject exactly as it was sent. |
results[].result | object | null | What the single-subject endpoint answers for this subject. null only when error is set. |
results[].result.id | string | null | |
results[].result.protocol | string | null | The venue this market trades on, e.g. "POLYMARKET" or "KALSHI". |
results[].result.eventId | string | null | The event this market belongs to, or null for a standalone market. |
results[].result.question | string | null | |
results[].result.label | string | null | A short label for this market within its event, when it has a parent event. |
results[].result.outcomeIds | string[] | null | The two outcome ids — pass one to GET /prediction/prediction-outcome-order-book. |
results[].result.outcomeLabels | string[] | null | |
results[].result.categories | object[] | null | |
results[].result.categories[].name | string | null | |
results[].result.categories[].slug | string | null | |
results[].result.categories[].subcategories | unknown[] | null | |
results[].result.resolution | object | null | Null until the market resolves. |
results[].result.resolution.result | string | null | |
results[].result.resolution.source | string | null | |
results[].result.createdAt | number | null | Unix seconds this market was created. |
results[].result.opensAt | number | null | Unix seconds the market opened for trading. |
results[].result.closesAt | number | null | Unix seconds trading closes. |
results[].result.resolvesAt | number | null | Expected resolution time, Unix seconds. |
results[].result.resolvedAt | number | null | Actual resolution time, Unix seconds — null while unresolved. |
results[].result.networkId | number | null | The on-chain settlement network id (e.g. 137 for Polygon/Polymarket) — null for a Kalshi market, which has none. |
results[].result.exchangeAddress | string | null | The on-chain exchange contract, when this market settles on-chain. |
results[].result.winningOutcomeId | string | null | Null until the market resolves. |
results[].result.lifecycle | object | |
results[].result.lifecycle.ageSeconds | number | null | |
results[].result.lifecycle.expectedLifespanSeconds | number | null | |
results[].result.lifecycle.timeToResolutionSeconds | number | null | |
results[].result.lifecycle.isResolved | boolean | null | |
results[].result.lifecycle.winningOutcomeId | string | null | |
results[].result.allTimeVolumeUsd | number | null | Lifetime trading volume, USD. |
results[].result.statsHour1 | object | |
results[].result.statsHour1.volumeUsd | number | null | Trading volume over the window, USD. |
results[].result.statsHour1.trades | number | null | Number of trades over the window. |
results[].result.statsHour1.uniqueTraders | number | null | Distinct trading accounts over the window — null on venues that do not report it (measured: Kalshi). |
results[].result.statsDay1 | object | |
results[].result.statsDay1.volumeUsd | number | null | Trading volume over the window, USD. |
results[].result.statsDay1.trades | number | null | Number of trades over the window. |
results[].result.statsDay1.uniqueTraders | number | null | Distinct trading accounts over the window — null on venues that do not report it (measured: Kalshi). |
results[].result.priceObservedAt | number | null | Unix seconds the outcome prices below were observed at. |
results[].result.outcomePrices | object[] | One entry per outcome. Empty for an unrecognised market id. |
results[].result.outcomePrices[].outcomeId | string | null | |
results[].result.outcomePrices[].lastTradePriceUsd | number | null | Last traded price, USD (0-1 for a binary market). |
results[].result.outcomePrices[].bestBidUsd | number | null | Best resting bid, USD — null when there is none (a literal "0" in the source data is read as absent, never a real zero price). |
results[].result.outcomePrices[].bestAskUsd | number | null | Best resting ask, USD — null when there is none, same reasoning as bestBidUsd. |
results[].result.outcomePrices[].bookLiquidityUsd | number | null | Liquidity currently backing the order book for this outcome, USD. |
results[].error | string | null | null, or unavailable when no source could be reached for this subject — retry it. A subject nobody has data for is NOT an error: its result says so. |
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