Prediction markets API

How did the price move across this crypto up-or-down window?

The reference price path across one 5-minute, 15-minute or 1-hour crypto window, with its first and last price; the 15-minute open and close come from here.

GET/api/external/prediction/prediction-crypto-window-price-history

What it returns

Prediction venues list "up or down" markets on a crypto asset over fixed windows; this is the reference price stream across one such window, as points from its start to its end (or to now, for a live window). Name the window by asset, interval and start (unix seconds on the interval's grid). resolutionSeconds is the spacing of the points: 5m and 15m keep every point of the per-second stream (1); 1h keeps the last point of every 5-second bucket plus the true first point (5). Windows older than about 2 hours are answered from a coarser one-minute archive instead (resolutionSeconds 60): it covers only the window's first five minutes and was measured up to 0.24% away from the per-second stream, so for an old window's reference open and close use GET /prediction/prediction-crypto-window-price. open is the first point's price when that point is at the window start (null otherwise); last is the last point's price; complete is true once the window is over and the points reach both of its edges. A window that has not started has no points. 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-history?asset=BTC&interval=5m&start=<start>"
Parameters
ParameterDescription
asset

query · string · required

The crypto asset the window is on, uppercase.BTCETHSOLXRPDOGEBNBHYPE
interval

query · string · required

The window length. 5m, 15m or 1h.5m15m1h
start

query · 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.

Response fields of How did the price move across this crypto up-or-down window?
FieldTypeDescription
assetstringThe asset, as requested.
intervalstringThe window length, as requested.
windowStartstringThe window start, ISO 8601 UTC.
windowEndstringThe window end (start plus one interval), ISO 8601 UTC.
resolutionSecondsintegerThe spacing of points: 1 for 5m/15m, 5 for 1h (last point of each bucket), 60 for the one-minute archive that answers windows older than about 2 hours.
pointsobject[]The reference price, oldest first. Empty for a window that has not started.
points[].tintegerUnix seconds.
points[].pricenumberThe reference price, USD.
opennumber | nullThe first point's price when it sits at the window start (within 10 s); null otherwise or with no points.
lastnumber | nullThe last point's price: the close once complete, the latest price while live. Null with no points.
completebooleanTrue when the window is over and the points reach both its start and its end (each within 10 s).

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