Perpetuals API
One venue derivatives instrument's basis against spot over time
Futures or perpetual price minus the same venue's spot price, in the quote currency and as a percent, for one instrument on one venue, 1m to 1w per bucket, oldest first.
/api/external/perps/derivatives-basis-history/{symbol}What it returns
The basis of one derivatives instrument on one venue — its price minus the same venue's spot price for the coin, at the close of each bucket — oldest first, in the quote currency and as a percentage of the instrument price. Positive means the instrument traded above spot (contango, or a premium on a perpetual); negative, below. The spot price is the venue's own spot pair for the coin, which can be quoted in a dollar stablecoin against a US-dollar instrument (e.g. XBT/USDT for PF_XBTUSD on Kraken), and the basis then also carries the stablecoin's own gap to the dollar. The newest bucket is normally the one still in progress when the figures were read (complete: false). symbol is the venue's instrument id, spelled exactly as listed (case-sensitive) — take venue and instrument from a derivatives-coin-venues row. Dated futures answer too, by the venue's own id (e.g. "BTCUSDT_261225" on Binance), though derivatives-coin-venues lists perpetuals only. Seven venues answer: Binance, OKX, Bybit, Gate, Bitget, Kraken and Crypto.com. An instrument the venue does not list in that spelling, or has no basis for, answers 404.
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/perps/derivatives-basis-history/<symbol>?venue=Binance"
| Parameter | Description |
|---|---|
venuequery · string · required | The trading venue, spelled exactly as listed (case-sensitive), as derivatives-coin-venues names it.BinanceOKXBybitGateBitgetKrakenCrypto.com |
intervalquery · string · optional | Bucket width. Defaults to one day.1m3m5m15m30m1h4h6h8h12h1d1w |
limitquery · integer · optional | How many of the most recent buckets to return, 1 to 1000. Defaults to 100. Fewer come back when the instrument's or the spot pair's history is shorter, or a bucket carries no figure. limit ≤ 450 keeps the answer under 32 KB. |
symbolpath · string · required | The venue's own instrument id, exactly as instrument in derivatives-coin-venues rows, case included: e.g. "BTCUSDT" (Binance, Bybit), "BTC-USDT-SWAP" (OKX), "BTC_USDT" (Gate), "PF_XBTUSD" (Kraken) — not a bare coin ticker such as "BTC", and not a token mint or contract address. Case-sensitive. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
venue | string | The trading venue. |
instrument | string | The instrument id, exactly as asked. |
interval | string | The bucket width. |
points | object[] | Oldest first. |
points[].at | number | The bucket's open, unix seconds. |
points[].basis | number | null | Instrument price minus the venue's spot price at the bucket's close — for the bucket in progress, the latest — in the quote currency. null when not stated. |
points[].basisPct | number | null | basis as a percentage of the instrument price (0.05 = 0.05%). null when not stated. |
points[].complete | boolean | Whether the figures are final. false only on the newest bucket, which was still in progress when its figures were read. |
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