Prediction markets API
The markets of one prediction event, and the part each plays
Every market that prices one prediction event, each labelled moneyline, spread, total, threshold and so on, with its line and its trading figures.
/api/external/prediction/prediction-event-markets/{id}What it returns
One row per market of the event, ranked by sort_by, each with its role in the event (e.g. MONEYLINE, SPREAD, TOTAL, THRESHOLD_BUCKET), the line or threshold it is about, and the market's own trading figures. eventShape says what kind of event it is (e.g. SPORTS_MATCH, FED_DECISION, ELECTION). The id is an event id from prediction-events, or a market's eventId. Page with offset: there is no total, so a page shorter than limit is the last one. An unknown id, like an offset past the end, answers an empty items and a null eventShape.
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-event-markets/<id>"
| Parameter | Description |
|---|---|
sort_byquery · string · optional | Which figure to rank markets by. Defaults to 24h volume.volumeUsd24hliquidityUsdtrendingScore24hopenInterestUsdcreatedAt |
sort_typequery · string · optional | Sort direction. Defaults to descending.ASCDESC |
limitquery · integer · optional | How many rows to return. Defaults to 25; this endpoint caps it at 100. |
offsetquery · integer · optional | 0-based row offset, for paging. At most 1000000. |
idpath · string · required | A prediction-market event id (groups one or more markets, e.g. a multi-candidate election) — 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 |
|---|---|---|
eventShape | string | null | What kind of event this is, e.g. SPORTS_MATCH, ELECTION, PRICE_THRESHOLD, FED_DECISION, BINARY. An open set. Null when items is empty. |
items | object[] | |
items[].role | string | null | The part this market plays in the event, e.g. MONEYLINE, MONEYLINE_OUTCOME, SPREAD, TOTAL, PROP, THRESHOLD_BUCKET, DATE_BUCKET. An open set. |
items[].sortKey | number | null | The market's place among the event's markets of the same role, 0 first (e.g. the smallest line). Rows are ranked by sort_by, not by this. |
items[].segment | object | null | The stat the market is about, e.g. a points spread. Null when the market is not split by a stat. |
items[].segment.type | string | null | e.g. STAT. |
items[].segment.stat | string | null | e.g. POINTS. |
items[].segment.value | number | null | The line, e.g. 13.5 for a 13.5-point spread. |
items[].threshold | object | null | For a market about a figure crossing a level, e.g. a rate change of at least 25 bps. Null otherwise. |
items[].threshold.metric | string | null | e.g. RATE_CHANGE_BPS. |
items[].threshold.operator | string | null | e.g. ABOVE, BELOW, EXACTLY. |
items[].threshold.value | number | null | The level, in the metric's own unit (e.g. -50 for a 50 bps cut). |
items[].market | object | |
items[].market.id | string | null | The market id, as prediction-market takes it. |
items[].market.eventId | string | null | |
items[].market.eventLabel | string | null | The event's headline. |
items[].market.protocol | string | null | The venue, e.g. POLYMARKET or KALSHI. |
items[].market.status | string | null | One of OPEN, SUSPENDED, RESOLVED, CANCELLED, PENDING. |
items[].market.question | string | null | The market's own question. |
items[].market.label | string | null | A short label for the market within its event. Often null. |
items[].market.networkId | number | null | The settlement network id (e.g. 137). Null for a venue that settles off-chain. |
items[].market.opensAt | number | null | Unix seconds. |
items[].market.closesAt | number | null | Unix seconds trading closes. |
items[].market.categories | string[] | null | |
items[].market.outcome0 | object | |
items[].market.outcome0.id | string | null | The outcome id — pass to prediction-outcome-order-book. |
items[].market.outcome0.label | string | null | e.g. Yes. |
items[].market.outcome0.lastPriceUsd | number | null | The outcome's last traded price, USD (0 to 1 for a binary market). |
items[].market.outcome0.liquidityUsd | number | null | Liquidity backing this outcome, USD. |
items[].market.outcome1 | object | |
items[].market.outcome1.id | string | null | The outcome id — pass to prediction-outcome-order-book. |
items[].market.outcome1.label | string | null | e.g. Yes. |
items[].market.outcome1.lastPriceUsd | number | null | The outcome's last traded price, USD (0 to 1 for a binary market). |
items[].market.outcome1.liquidityUsd | number | null | Liquidity backing this outcome, USD. |
items[].market.liquidityUsd | number | null | Null on venues that do not report it. |
items[].market.volumeUsd24h | number | null | |
items[].market.trades24h | number | null | |
items[].market.uniqueTraders24h | number | null | Null on venues that do not report it. |
items[].market.trendingScore24h | 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