---
title: "Exchange Long/Short Ratio History"
method: GET
path: "/gateway/v1/exchange/long-short-ratio"
tags: ["Exchange"]
---

# Exchange Long/Short Ratio History

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

## Request

- Base URL: `https://api.asksurf.ai`
- URL: `https://api.asksurf.ai/gateway/v1/exchange/long-short-ratio`
- Auth: HTTP bearer

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

- `pair` string, required: Trading pair (e.g. BTC/USDT)
- `interval` '1h' | '4h' | '1d': 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.
- `from` string: 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.
- `limit` integer: Max number of records. For longer history, paginate using the last returned timestamp as the next from value.
- `exchange` 'binance' | 'okx' | 'bybit' | 'bitget': Exchange identifier

## Response `200`

OK

- SimpleListResponseExchangeLongShortRatioItem
  - `$schema` string, uri: A URL to the JSON Schema for this object.
  - `data` ExchangeLongShortRatioItem[], nullable, required
    - `exchange` string, required: Exchange identifier
    - `long_short_ratio` number, double, nullable, required: Ratio of longs to shorts (e.g. 1.5 means 60% long / 40% short). To get percentages: long% = ratio/(ratio+1)*100, short% = 100/(ratio+1)
    - `pair` string, required: Perpetual contract pair like BTC/USDT
    - `timestamp` integer, nullable, required: Unix timestamp in seconds
  - `meta` ObjectResponseMeta, required
    - `cached` boolean, required: Whether this response was served from cache
    - `credits_used` integer, required: Credits deducted for this request
    - `empty_reason` string: Hint explaining why the data array is empty, when applicable

## Other responses

- `default`: Error

---

[API](https://skmtc.dev/asksurf/apis/asksurf-public-rest-api.md) - [All operations](https://skmtc.dev/asksurf/apis/asksurf-public-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/asksurf/apis/asksurf-public-rest-api/revisions/91774fdd5302?raw)
