# BitMEX Derivatives Exchange API
> Live market data for BitMEX, the original crypto perpetual-swap exchange, with no key. List the active instruments (perpetual swaps, futures and FX) with mark/last price, funding rate, open interest and 24h volume; pull a single-instrument ticker; read the live L2 order book split into bids and asks; stream recent public trades; and fetch bucketed OHLC candles. BitMEX uses XBT for Bitcoin — the flagship perpetual is XBTUSD. Ideal for derivatives dashboards, funding-rate monitors and charting across 130+ instruments.

## 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/bitmex-api/..."
```

## Pricing
- **Free** (Free) — 1,960 calls/Mo, 4 req/s
- **Basic** ($17/Mo) — 55,500 calls/Mo, 9 req/s
- **Pro** ($47/Mo) — 222,000 calls/Mo, 22 req/s
- **Business** ($101/Mo) — 888,000 calls/Mo, 54 req/s

## Endpoints

### Markets

#### `GET /v1/candles` — Bucketed OHLC candles

**Parameters:**
- `symbol` (query, required, string) — BitMEX symbol Example: `XBTUSD`
- `binSize` (query, optional, string) — Candle size (1m,5m,1h,1d) Example: `1h`
- `count` (query, optional, string) — Candles (1-500) Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bitmex-api/v1/candles?symbol=XBTUSD&binSize=1h&count=100"
```

**Response:**
```json
{
    "data": {
        "count": 100,
        "symbol": "XBTUSD",
        "candles": [
            {
                "low": 65504.3,
                "high": 65900.3,
                "open": 65524.9,
                "vwap": 65726.7738,
                "close": 65834.8,
                "trades": 1293,
                "volume": 7456900,
                "timestamp": "2026-06-15T11:00:00.000Z"
            },
            {
                "low": 65433,
                "high": 65715.1,
                "open": 65588.3,
                "vwap": 65544.9737,
                "close": 65524.9,
                "trades": 862,
                "volume": 3947200,
                "timestamp": "2026-06-15T10:00:00.000Z"
            },
            {
                "low": 65544.5,
                "high": 65723.1,
                "open": 65592.8,
                "vwap": 65626.7022,
                "close": 65588.3,
                "trades": 728,
                "volume": 2670100,
                "timestamp": "2026-06-15T09:00:00.000Z"
            },
            {
                "low": 65550.1,
                "high": 65942.6,
                "open": 65736.4,
                "vwap": 65702.5907,
                "close": 65592.8,
                "trades": 1194,
                "volume": 6931800,
                "timestamp": "2026-06-15T08:00:00.000Z"
            },
            {
                "low": 65700.1,
                "high": 65899,
                "open": 65787.8,
                "vwap": 658
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/instruments` — Active instruments with funding, OI & 24h volume

**Parameters:**
- `type` (query, optional, string) — Filter by instrument type

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

**Response:**
```json
{
    "data": {
        "count": 136,
        "venue": "bitmex",
        "instruments": [
            {
                "type": "FFWCSX",
                "state": "Open",
                "symbol": "TONUSD",
                "low_price": 1.6860000000000002,
                "timestamp": "2026-06-15T11:15:37.889Z",
                "high_price": 1.8192,
                "last_price": 1.7845,
                "mark_price": 1.779,
                "open_value": 617615430,
                "underlying": "TON",
                "volume_24h": 2577,
                "index_price": 1.779,
                "funding_rate": 0.0001,
                "turnover_24h": 29631.92882715105,
                "open_interest": 34717,
                "quote_currency": "USD"
            },
            {
                "type": "FFWCSX",
                "state": "Open",
                "symbol": "TONUSDT",
                "low_price": 1.6802000000000001,
                "timestamp": "2026-06-15T11:15:37.889Z",
                "high_price": 1.8181,
                "last_price": 1.7764,
                "mark_price": 1.7802,
                "open_value": 404739151200,
                "underlying": "TON",
                "volume_24h": 150461,
                "index_price": 1.7804,
                "funding_rate": -0.001479,
                "turnover_24h": 264820.27079999994,
                "open_interest": 227356,
                "quote_currency": "USDT"
            },
            {
                "type": "FFSCSX",

…(truncated, see openapi.json for full schema)
```

#### `GET /v1/orderbook` — Live L2 order book (bids/asks)

**Parameters:**
- `symbol` (query, required, string) — BitMEX symbol Example: `XBTUSD`
- `depth` (query, optional, string) — Levels (1-100) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bitmex-api/v1/orderbook?symbol=XBTUSD&depth=10"
```

**Response:**
```json
{
    "data": {
        "asks": [
            {
                "size": 1000,
                "price": 65898.5
            },
            {
                "size": 100,
                "price": 65900
            },
            {
                "size": 1000,
                "price": 65903
            },
            {
                "size": 800,
                "price": 65903.8
            },
            {
                "size": 800,
                "price": 65904.4
            },
            {
                "size": 1200,
                "price": 65906.8
            },
            {
                "size": 1300,
                "price": 65907.8
            },
            {
                "size": 17600,
                "price": 65909.8
            },
            {
                "size": 4400,
                "price": 65910.3
            },
            {
                "size": 149900,
                "price": 65910.4
            }
        ],
        "bids": [
            {
                "size": 600,
                "price": 65898.4
            },
            {
                "size": 1600,
                "price": 65898
            },
            {
                "size": 5000,
                "price": 65897.9
            },
            {
                "size": 400,
                "price": 65895
            },
            {
                "size": 18100,
                "price": 65888.3
            },
            {
                "size": 12200,
                "price
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/ticker` — Single-instrument ticker

**Parameters:**
- `symbol` (query, required, string) — BitMEX symbol (XBT = Bitcoin) Example: `XBTUSD`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bitmex-api/v1/ticker?symbol=XBTUSD"
```

**Response:**
```json
{
    "data": {
        "type": "FFWCSX",
        "state": "Open",
        "symbol": "XBTUSD",
        "low_price": 63608,
        "timestamp": "2026-06-15T11:15:40.500Z",
        "high_price": 65955.8,
        "last_price": 65898,
        "mark_price": 65942.12,
        "open_value": 169268587712,
        "underlying": "XBT",
        "volume_24h": 178521800,
        "index_price": 65941.8,
        "funding_rate": 5.1e-5,
        "turnover_24h": 178521800,
        "open_interest": 111619400,
        "quote_currency": "USD"
    },
    "meta": {
        "timestamp": "2026-06-15T11:15:40.646Z",
        "request_id": "f9383a2a-3433-4bfc-8ca4-7880ea4a1738"
    },
    "status": "ok",
    "message": "Ticker retrieved successfully",
    "success": true
}
```

#### `GET /v1/trades` — Recent public trades

**Parameters:**
- `symbol` (query, required, string) — BitMEX symbol Example: `XBTUSD`
- `count` (query, optional, string) — Number of trades (1-100) Example: `25`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bitmex-api/v1/trades?symbol=XBTUSD&count=25"
```

**Response:**
```json
{
    "data": {
        "count": 25,
        "symbol": "XBTUSD",
        "trades": [
            {
                "side": "Buy",
                "size": 800,
                "price": 65894.9,
                "trade_id": "00000000-006d-1000-0000-0032f50eedbd",
                "timestamp": "2026-06-15T11:15:38.523Z",
                "tick_direction": "PlusTick"
            },
            {
                "side": "Buy",
                "size": 800,
                "price": 65891.9,
                "trade_id": "00000000-006d-1000-0000-0032f50eecb4",
                "timestamp": "2026-06-15T11:15:38.516Z",
                "tick_direction": "PlusTick"
            },
            {
                "side": "Buy",
                "size": 1600,
                "price": 65883,
                "trade_id": "00000000-006d-1000-0000-0032f50ec328",
                "timestamp": "2026-06-15T11:15:37.733Z",
                "tick_direction": "ZeroPlusTick"
            },
            {
                "side": "Buy",
                "size": 800,
                "price": 65883,
                "trade_id": "00000000-006d-1000-0000-0032f50ec327",
                "timestamp": "2026-06-15T11:15:37.733Z",
                "tick_direction": "ZeroPlusTick"
            },
            {
                "side": "Buy",
                "size": 1000,
                "price": 65882.9,
                "trade_id": "00000000-006d-1000-0000-0032f50ec326",
                "timestamp": "2026-06-15T11:15:37.733Z",
    
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Venue metadata & endpoint guide

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

**Response:**
```json
{
    "data": {
        "note": "BitMEX uses XBT for Bitcoin — the flagship perpetual is XBTUSD.",
        "venue": "BitMEX",
        "source": "BitMEX public REST (bitmex.com/api/v1), keyless",
        "examples": {
            "ticker": "/v1/ticker?symbol=XBTUSD",
            "trades": "/v1/trades?symbol=XBTUSD&count=10",
            "candles": "/v1/candles?symbol=XBTUSD&binSize=1h&count=100",
            "orderbook": "/v1/orderbook?symbol=XBTUSD&depth=10",
            "instruments": "/v1/instruments?type=FFWCSX"
        },
        "endpoints": {
            "/v1/ticker": "single-instrument ticker (symbol=XBTUSD)",
            "/v1/trades": "recent public trades (symbol, count)",
            "/v1/candles": "bucketed OHLC candles (symbol, binSize in 1m/5m/1h/1d, count)",
            "/v1/orderbook": "live L2 order book split into bids/asks (symbol, depth)",
            "/v1/instruments": "active instruments with mark/last price, funding, OI & 24h volume (filter type)"
        },
        "instrument": "perpetual swaps, futures & FX derivatives",
        "cache_ttl_ms": 5000
    },
    "meta": {
        "timestamp": "2026-06-15T11:15:41.197Z",
        "request_id": "0d1c7663-2166-447c-bc78-3d3e700bafb7"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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