Long/Short Ratio History

GET/gateway/v1/exchange/long-short-ratio

Returns historical long/short ratio for a perpetual contract.

Included fields: ratio value, long account percentage, short account percentage.

Granularity: `interval` supports `1h`, `4h`, `1d`.

Pagination: use `from` for start time and `limit` for result count. For longer history, pass the last returned timestamp as the next `from` value.

Note: not all exchanges support historical queries via `from`; some only return recent data regardless.

Just pass the base pair (e.g. `pair=BTC/USDT`). For aggregated cross-exchange long/short ratio, see `/market/futures`.

Query Parameters

pairstringrequired

Trading pair (e.g. BTC/USDT)

Example: BTC/USDT
intervalenum<string>

Bucket size for each point in the series: `1h`, `4h`, or `1d`. This endpoint uses `interval` only; it does NOT accept `time_range`. Use `from` + `limit` to control the window.

Available options:1h4h1d
Example: 1h
fromstring

Start of time range. Accepts Unix seconds or date string (YYYY-MM-DD, ISO8601). Binance only retains the last 30 days of data; other exchanges may have different limits.

Example: 2026-03-01
limitinteger

Max number of records. For longer history, paginate using the last returned timestamp as the next from value.

Example: 50
exchangeenum<string>

Exchange identifier

Available options:binanceokxbybitbitget
Example: binance
Long/Short Ratio History
const options = {method: 'GET'};

fetch('https://api.asksurf.ai/gateway/v1/exchange/long-short-ratio?pair=BTC/USDT&interval=1h&from=2026-03-01&limit=50&exchange=binance', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
OK
{
  "$schema": "https://example.com/schemas/SimpleListResponseExchangeLongShortRatioItem.json",
  "data": [
    {
      "exchange": "<string>",
      "long_short_ratio": 123,
      "pair": "<string>",
      "timestamp": 123
    }
  ],
  "meta": {
    "cached": true,
    "credits_used": 123,
    "empty_reason": "<string>"
  }
}