Perpetuals API

One coin's open interest across all venues, as candles over time

A coin's derivatives open interest summed across venues as candles, in USD or coin units; optionally only coin- or stablecoin-margined contracts, or one venue market.

GET/api/external/perps/derivatives-open-interest-history/{symbol}

What it returns

One coin's derivatives open interest over time: every venue's open positions summed into one figure, as open/high/low/close candles, oldest first, in US dollars (default) or in the coin's own units. The newest candle is normally the one still in progress when the figures were read (complete: false, its close the latest open interest). symbol is the coin ticker (e.g. "BTC"), matched case-insensitively — not an instrument id, not a token mint or contract address, and not scoped to any of this API's chains. An unknown ticker answers 404.

Two narrower questions are opt-in. margin=coin counts only the contracts margined in the coin itself, in US dollars only; margin=stablecoin only those margined in a stablecoin, in the coin's own units only (pass unit=coin) — both still summed across venues. Measured against the per-venue figures, the coin-margined close matched for BTC, SOL and HYPE but ran about 10% low for ETH. venue + instrument together answer one market's own series instead of the sum: the venue and its instrument id for this coin, as a derivatives-coin-venues row names them; an instrument that is not one of this coin's markets 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-open-interest-history/<symbol>"
Parameters
ParameterDescription
interval

query · string · optional

Candle width. Defaults to one day.1m3m5m15m30m1h4h6h8h12h1d1w
limit

query · integer · optional

How many of the most recent candles to return, 1 to 1000. Defaults to 100. Fewer come back when the coin's history is shorter, a candle carries no figures, or the answer comes from the backup series, which reaches back about 96 candles at 15m, about 30 at 1h, 4h and 12h, and 90 days at 1d. limit ≤ 250 keeps the answer under 32 KB.
unit

query · string · optional

What the figures count: US dollars (default), or the coin's own units, which leave out the price's own moves. margin=coin answers US dollars only and margin=stablecoin the coin's own units only.usdcoin
margin

query · string · optional

Which contracts to count: all (default — every contract), coin (only those margined in the coin itself; requires unit=usd) or stablecoin (only those margined in a stablecoin; requires unit=coin). Cannot be combined with venue and instrument.allcoinstablecoin
venue

query · string · optional

With instrument: answer one market's own series instead of the sum across venues. The exchange, as derivatives-coin-venues names it (e.g. "Binance", "OKX", "Bybit", "Deribit", "Crypto.com"); matched ignoring case.
instrument

query · string · optional

With venue: that venue's instrument id for this coin, as instrument in derivatives-coin-venues rows (e.g. "BTCUSDT" on Binance, "BTC-USDT-SWAP" on OKX, "BTC-PERPETUAL" on Deribit). The exact spelling is matched first; otherwise the one listed id that differs only in case.
symbol

path · string · required

The coin (base asset) ticker, e.g. "BTC" or "kPEPE" — not a venue instrument id such as "BTCUSDT", and not a token mint or contract address. Case-insensitive.

Response fields

A JSON response. Every field is always present; null means the value could not be established, never zero.

Response fields of One coin's open interest across all venues, as candles over time
FieldTypeDescription
symbolstringThe coin, spelled as it is listed (e.g. "BTC", "kPEPE").
intervalstringThe candle width.
unitstringWhat the figures count: US dollars, or the coin's own units.
marginstringPresent only when margin narrowed the answer: which contracts the figures count.
venuestringPresent only in the one-market answer: the venue, spelled as it is listed.
instrumentstringPresent only in the one-market answer: the venue's instrument id, spelled as it is listed.
candlesobject[]Oldest first.
candles[].atnumberThe bucket's open, unix seconds.
candles[].opennumber | nullOpen interest across all venues (or the one market asked for) at the bucket open, in unit. null when not stated.
candles[].highnumber | nullHighest open interest across all venues (or the one market asked for) in the bucket, in unit. null when not stated.
candles[].lownumber | nullLowest open interest across all venues (or the one market asked for) in the bucket, in unit. null when not stated.
candles[].closenumber | nullOpen interest across all venues (or the one market asked for) at the bucket close — the latest figure while the bucket is in progress. In unit; null when not stated.
candles[].completebooleanWhether the figures are final. false only on the newest candle, 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