# Long/Short Ratio API
> Live crypto long/short trader-positioning sentiment as an API, streamed from the Bybit v5 public account-ratio feed. For any USDT perpetual futures contract it returns the share of accounts positioned long versus short (buy/sell ratio) and the derived long/short ratio — either the latest reading or a full time-series across 5m, 15m, 30m, 1h, 4h and 1d buckets. The crowd-positioning signal traders use to spot one-sided, over-leveraged markets. Look up by symbol or base coin, pull history, or list tradable symbols. Live, no key. Distinct from funding-rate, price and open-interest APIs — this is the account long/short sentiment.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/longshortratio-api/..."
```

## Pricing
- **Free** (Free) — 200 calls/Mo, 3 req/s
- **Trader** ($11/Mo) — 9,000 calls/Mo, 10 req/s
- **Pro** ($31/Mo) — 45,000 calls/Mo, 25 req/s
- **Desk** ($74/Mo) — 220,000 calls/Mo, 50 req/s

## Endpoints

### Sentiment

#### `GET /v1/history` — Long/short ratio time-series

**Parameters:**
- `symbol` (query, optional, string) — Contract symbol Example: `BTCUSDT`
- `base` (query, optional, string) — Base coin
- `period` (query, optional, string) — 5m | 15m | 30m | 1h | 4h | 1d Example: `1h`
- `limit` (query, optional, string) — Max 1-500 Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/longshortratio-api/v1/history?symbol=BTCUSDT&period=1h&limit=50"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "period": "1h",
        "symbol": "BTCUSDT",
        "history": [
            {
                "symbol": "BTCUSDT",
                "long_pct": 62.32,
                "short_pct": 37.68,
                "timestamp": "2026-06-07T02:00:00.000Z",
                "long_ratio": 0.6232,
                "short_ratio": 0.3768,
                "long_short_ratio": 1.6539
            },
            {
                "symbol": "BTCUSDT",
                "long_pct": 62.45,
                "short_pct": 37.55,
                "timestamp": "2026-06-07T03:00:00.000Z",
                "long_ratio": 0.6245,
                "short_ratio": 0.3755,
                "long_short_ratio": 1.6631
            },
            {
                "symbol": "BTCUSDT",
                "long_pct": 62.75,
                "short_pct": 37.25,
                "timestamp": "2026-06-07T04:00:00.000Z",
                "long_ratio": 0.6275,
                "short_ratio": 0.3725,
                "long_short_ratio": 1.6846
            },
            {
                "symbol": "BTCUSDT",
                "long_pct": 62.94,
                "short_pct": 37.06,
                "timestamp": "2026-06-07T05:00:00.000Z",
                "long_ratio": 0.6294,
                "short_ratio": 0.3706,
                "long_short_ratio": 1.6983
            },
            {
                "symbol": "BTCUSDT",
                "long_pct": 63.21,
                "short_pct": 36.79,
           
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/ratio` — Latest long/short ratio for a contract

**Parameters:**
- `symbol` (query, optional, string) — Contract symbol (preferred) Example: `BTCUSDT`
- `base` (query, optional, string) — Base coin, e.g. BTC
- `period` (query, optional, string) — 5m | 15m | 30m | 1h | 4h | 1d Example: `1h`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/longshortratio-api/v1/ratio?symbol=BTCUSDT&period=1h"
```

**Response:**
```json
{
    "data": {
        "period": "1h",
        "symbol": "BTCUSDT",
        "long_pct": 62.58,
        "short_pct": 37.42,
        "timestamp": "2026-06-09T03:00:00.000Z",
        "long_ratio": 0.6258,
        "short_ratio": 0.3742,
        "long_short_ratio": 1.6724
    },
    "meta": {
        "timestamp": "2026-06-09T03:03:42.172Z",
        "request_id": "37752e22-d188-4f3b-95e6-5addc37ce333"
    },
    "status": "ok",
    "message": "Long/short ratio retrieved successfully",
    "success": true
}
```

#### `GET /v1/symbols` — List tradable perpetual symbols

**Parameters:**
- `q` (query, optional, string) — Symbol fragment, e.g. PEPE
- `limit` (query, optional, string) — Max 1-2000 Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/longshortratio-api/v1/symbols?limit=100"
```

**Response:**
```json
{
    "data": {
        "count": 100,
        "total": 582,
        "symbols": [
            "0GUSDT",
            "1000000BABYDOGEUSDT",
            "1000000MOGUSDT",
            "10000NEXUSDT",
            "10000SATSUSDT",
            "1000BONKUSDT",
            "1000BTTUSDT",
            "1000CATUSDT",
            "1000FLOKIUSDT",
            "1000LUNCUSDT",
            "1000NEIROCTOUSDT",
            "1000PEPEUSDT",
            "1000RATSUSDT",
            "1000TAGUSDT",
            "1000TOSHIUSDT",
            "1000TURBOUSDT",
            "1000XECUSDT",
            "1INCHUSDT",
            "2ZUSDT",
            "4USDT",
            "AAPLUSDT",
            "AAVEUSDT",
            "ACEUSDT",
            "ACHUSDT",
            "ACTUSDT",
            "ACUUSDT",
            "ACXUSDT",
            "ADAUSDT",
            "AERGOUSDT",
            "AEROUSDT",
            "AEVOUSDT",
            "AGIUSDT",
            "AGLDUSDT",
            "AIGENSYNUSDT",
            "AIOUSDT",
            "AIOZUSDT",
            "AIXBTUSDT",
            "AKEUSDT",
            "AKTUSDT",
            "ALCHUSDT",
            "ALGOUSDT",
            "ALICEUSDT",
            "ALLOUSDT",
            "ALPINEUSDT",
            "ALTUSDT",
            "AMATUSDT",
            "AMDSTOCKUSDT",
            "AMZNUSDT",
            "ANIMEUSDT",
            "ANKRUSDT",
            "APEUSDT",
            "APEXUSDT",
            "API3USDT",
            "APRUSDT",
            "APTUSDT",
            "ARBUSDT",
     
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Service metadata

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/longshortratio-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "source": "Bybit v5 account-ratio (live)",
        "periods": [
            "5m",
            "15m",
            "30m",
            "1h",
            "4h",
            "1d"
        ],
        "service": "longshortratio-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/ratio": "Latest long/short ratio (symbol=BTCUSDT or base=BTC, period=5m|15m|30m|1h|4h|1d).",
            "GET /v1/history": "Long/short ratio time-series (symbol, period, limit up to 500).",
            "GET /v1/symbols": "List tradable perpetual symbols (q= filter, limit)."
        },
        "description": "Live crypto long/short trader-positioning sentiment from Bybit v5 (USDT perpetuals): share of accounts long vs short (buy/sell ratio) and the derived long/short ratio, latest or as a time-series across 5m–1d buckets. Look up by symbol or base coin, pull history, or list symbols. Live, no key. Distinct from funding-rate and price APIs.",
        "symbols_live": 582
    },
    "meta": {
        "timestamp": "2026-06-09T03:03:42.764Z",
        "request_id": "978085b5-64db-4956-a867-4a67f5be2cc0"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/longshortratio-api
OpenAPI spec: https://www.oanor.com/api/longshortratio-api/openapi.json
