Prediction markets API

One prediction-market trader's results bucketed over a window

How one prediction-market trader's volume, trades, wins, losses and realized profit moved per hour, day or week, with a running profit total — a PnL curve.

GET/api/external/prediction/prediction-trader-bars/{id}

What it returns

A trader's activity per hour, 4 hours, day or week between from (inclusive) and to (exclusive): trades, buys, sells, markets traded, volume, wins, losses, the profit realized in each bucket and its running total. Every bucket of the window is answered, a bucket with no trading as zeros with the running total carried over it. The id is a traderId from prediction-trades or prediction-market-traders rows — copy it as given. An id no trader has is a 404, never a series of zeros a caller would chart as a real trader who sat out the window. At most 1000 buckets 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-trader-bars/<id>?resolution=hour1&from=<from>&to=<to>"
Parameters
ParameterDescription
resolution

query · string · required

The bucket width.hour1hour4day1week1
from

query · integer · required

Window start, Unix seconds (inclusive).
to

query · integer · required

Window end, Unix seconds (exclusive): a bucket opening at to is not answered. A window of ≤ 175 bars keeps the answer under 32 KB.
id

path · string · required

A prediction-market trader id, e.g. "<walletAddress>:Polymarket", as traderId in prediction-trades and prediction-market-traders rows — not a bare wallet 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.

Response fields of One prediction-market trader's results bucketed over a window
FieldTypeDescription
traderIdstringThe trader id, as passed.
barsobject[]One bucket per period of the window, oldest first.
bars[].tnumberBucket open time, Unix seconds.
bars[].tradesnumber | null
bars[].buysnumber | null
bars[].sellsnumber | null
bars[].marketsnumber | nullHow many different markets the trader traded in the bucket.
bars[].volumeUsdnumber | nullBought plus sold, in USD.
bars[].buyVolumeUsdnumber | null
bars[].sellVolumeUsdnumber | null
bars[].winsnumber | nullResults counted as won in the bucket. Not every trade is counted as a win or a loss.
bars[].lossesnumber | nullResults counted as lost in the bucket.
bars[].realizedPnlUsdnumber | nullProfit realized in the bucket, in USD. Negative for a loss.
bars[].cumulativeRealizedPnlUsdnumber | nullRunning total of realized profit through this bucket, in USD.

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