Prediction markets API
What did this crypto up-or-down window open and close at?
The reference open ("price to beat") and close of one 5-minute or 1-hour crypto window, e.g. BTC 14:30–14:35; the close is null until the window settles.
/api/external/prediction/prediction-crypto-window-priceWhat it returns
Prediction venues list "up or down" markets on a crypto asset over fixed windows; this is the reference price such a window opens and closes at. Name the window by asset, interval and start (unix seconds on the interval's grid). The two intervals use different references: 5m samples a per-second reference price stream at the window's two edges; 1h is the hour's exchange candle open and close (2 decimals), measured about 0.02% from that stream. closePrice is null until the window is settled: a live window has its openPrice only, a window that has not started has neither. 15-minute windows are not offered here, because the only reference for them answers the containing hour; read a 15-minute window's first and last points from GET /prediction/prediction-crypto-window-price-history instead. 5-minute windows are answered about 25 days back; older ones fail. No chain and no subject.
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-crypto-window-price?asset=BTC&interval=5m&start=<start>"
| Parameter | Description |
|---|---|
assetquery · string · required | The crypto asset the window is on, uppercase.BTCETHSOLXRPDOGEBNBHYPE |
intervalquery · string · required | The window length. 5m or 1h; 15-minute windows are served by the price-history endpoint.5m1h |
startquery · integer · required | The window start, unix seconds. Must sit on the interval's grid (a multiple of 300 for 5m, 900 for 15m, 3600 for 1h); the window ends one interval later. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
asset | string | The asset, as requested. |
interval | string | The window length, as requested. |
windowStart | string | The window start, ISO 8601 UTC. |
windowEnd | string | The window end (start plus one interval), ISO 8601 UTC. |
openPrice | number | null | The reference price at the window start (the "price to beat"), USD. Null when the window has not started. |
closePrice | number | null | The reference price at the window end (the final price), USD. Null until the window is settled — a running price of a live window is never published here. |
settled | boolean | True when the window is over and both prices are final. |
asOf | string | When the prices were read, ISO 8601 UTC. |
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