Types
All data types used in REST and WebSocket API responses, including candles, heatmaps, trades, and envelope types.
All data types used in API responses.
JSON & CBOR Use Identical Field Names: All types use the same field names in both JSON and CBOR formats. The only difference is the encoding—CBOR is more compact on the wire (~30-40% smaller).
JSON: {"t": 1704067200, "o": 42150.5, "h": 42200.0, ...} CBOR: {t: 1704067200, o: 42150.5, h: 42200.0, ...} (binary encoded)
Data Types
Candle (OHLCVT)
OHLCVT candle with volume and trade counts.
{"t": 1704067200, "o": 42000.5, "h": 42150.0, "l": 41950.0, "c": 42100.0, "vb": 1500000.0, "vs": 1400000.0, "tb": 1250, "ts": 1180}| Field | Type | Description |
|---|---|---|
t | int64 | Unix timestamp (seconds) |
o, h, l, c | float64 | Open, high, low, close price |
vb, vs | float64 | Buy/sell volume (USD) |
tb, ts | int64 | Buy/sell trade count |
OI / VD Candle (OHLC)
Simple OHLC candle for Open Interest and Volume Delta.
{"t": 1704067200, "o": 5000000000, "h": 5100000000, "l": 4950000000, "c": 5050000000, "n": 60}| Field | Type | Description |
|---|---|---|
t | int64 | Unix timestamp (seconds) |
o, h, l, c | float64 | Open, high, low, close value |
n | int64 | Sample count |
Stat
Market statistics including funding, liquidations, depth, and TPS.
{"t": 1704067200, "mp": 42050.0, "lp": 42100.0, "fr": 0.0001, "lb": 50000.0, "ls": 75000.0, "tlb": 15, "tls": 22, "vb": 1500000.0, "vs": 1400000.0, "tb": 1250, "ts": 1180, "sk": [0.15, 0.22], "as": [500000, 1500000], "bs": [600000, 1800000], "mxt": 250, "mnt": 10, "avt": 85.5, "it": 95}| Field | Type | Description |
|---|---|---|
t | int64 | Unix timestamp (seconds) |
mp, lp | float64 | Mark price, last price (mp can be 0 when mark price is unavailable) |
fr | float64 | Funding rate |
lb, ls | float64 | Liquidation buy/sell volume (USD) |
tlb, tls | int64 | Liquidation buy/sell count |
vb, vs | float64 | Buy/sell volume (USD) |
tb, ts | int64 | Buy/sell trade count |
sk | []float64 | Orderbook skews at depth levels |
as, bs | []float64 | Ask/bid depth sums (USD) at levels |
mxt, mnt | int64 | Max/min TPS in period |
avt | float64 | Avg TPS in period |
it | int64 | Instantaneous TPS |
Volume
Volume profile showing buy/sell at price levels.
{"t": 1704067200, "p": [41900, 41950, 42000], "b": [50000, 75000, 120000], "s": [45000, 60000, 100000], "pg": 50}| Field | Type | Description |
|---|---|---|
t | int64 | Unix timestamp (seconds) |
p | []float64 | Price levels |
b, s | []float64 | Buy/sell volumes at each price (USD) |
pg | float64 | Price grouping/bucket size |
Heatmap
Orderbook heatmap with explicit price array. Used by WebSocket heatmap_sd and heatmap_hd channels. Flat heatmap channels (flat_heatmap_sd, flat_heatmap_hd, stop_heatmap, tp_heatmap, liquidation_heatmap) and all REST heatmap endpoints return the FlatHeatmap format.
{"t": 1704067200, "pg": 10, "p": [41500, 41510, 41520], "s": [100000, 250000, 500000], "si": 50, "lp": 42050.0, "minp": 41500.0, "maxp": 42500.0, "mins": 10000, "maxs": 1000000}| Field | Type | Description |
|---|---|---|
t | int64 | Unix timestamp (seconds) |
pg | float64 | Price grouping/bucket size |
p | []float64 | Price levels |
s | []float64 | Size values at each price |
si | int64 | Split index (divides bids/asks) |
lp | float64 | Last traded price |
minp, maxp | float64 | Min/max price in range |
mins, maxs | float64 | Min/max size value |
FlatHeatmap
Orderbook heatmap with dense size array (no explicit prices).
{"t": 1704067200, "pg": 10, "s": [100000, 250000, 500000], "lp": 42050.0, "si": 50, "minp": 41500.0, "maxp": 42500.0, "mins": 10000, "maxs": 1000000}| Field | Type | Description |
|---|---|---|
t | int64 | Unix timestamp (seconds) |
pg | float64 | Price grouping/bucket size |
s | []float64 | Size values (dense array) |
lp | float64 | Last traded price |
si | int64 | Split index (divides bids/asks) |
minp, maxp | float64 | Min/max price in range |
mins, maxs | float64 | Min/max size value |
Price at index i = minp + (i * pg)
Trade
Real-time trade (WebSocket only).
{"id": "3065401760", "t": 1704067200123, "p": 42050.0, "q": 0.5, "b": true}| Field | Type | Description |
|---|---|---|
id | string | Trade ID from exchange |
t | int64 | Unix timestamp (milliseconds) |
p | float64 | Price |
q | float64 | Quantity |
b | bool | Side (true = buy) |
Liquidation
A single liquidation event.
{"t": 1704067200, "p": 42050.0, "q": 0.5, "s": "buy"}| Field | Type | Description |
|---|---|---|
t | int64 | Unix timestamp (seconds) |
p | float64 | Price |
q | float64 | Quantity |
s | string | Side ("buy" or "sell") |
Market
Market overview data.
{"t": 1704067200, "p": 42050.0, "p24": 41500.0, "pc": 1.33, "vb24": 1500000.0, "vs24": 1400000.0, "tb24": 1250, "ts24": 1180, "mc": 820000000000, "fdv": 880000000000, "cs": 19500000, "ts": 21000000, "ms": 21000000}| Field | Type | Description |
|---|---|---|
t | int64 | Unix timestamp (seconds) |
p | float64 | Current price |
p24 | float64 | Price 24h ago |
pc | float64 | Price change 24h |
vb24, vs24 | float64 | Buy/sell volume 24h (USD) |
tb24, ts24 | float64 | Buy/sell trade count 24h |
mc | float64 | Market cap |
fdv | float64 | Fully diluted valuation |
cs | float64 | Circulating supply |
ts | float64 | Total supply |
ms | float64 | Max supply |
Orderbook
Orderbook snapshot/update (REST and WebSocket).
{"t": 1704067200123, "a": [[42001, 1.2], [42002, 1.8]], "b": [[42000, 1.5], [41999, 2.0]], "lp": 42050.0, "snapshot": true, "seq": 123456}| Field | Type | Description |
|---|---|---|
t | int64 | Unix timestamp (milliseconds) |
a | [][2]float64 | Asks as [price, size] pairs (ascending) |
b | [][2]float64 | Bids as [price, size] pairs (descending) |
lp | float64 | Last traded price |
snapshot | bool | Full snapshot flag |
seq | int64 | Sequence number |
Envelope Types
WSDataMessage
WebSocket data message envelope (realtime streams).
{"type": "data", "channel": "candles", "exchange": "binancef", "symbol": "btc/usd", "tf": "1m", "data": {...}, "id": "candles.binancef.btc/usd.60"}| Field | Type | Description |
|---|---|---|
type | string | Always "data" |
channel | string | Channel name (candles, stats, trades, etc.) |
exchange | string | Exchange ID |
symbol | string | Trading pair |
tf | string | Timeframe (if applicable) |
data | any | The data payload (type depends on channel) |
id | string | Subscription identifier |
RangeResponse
REST API response envelope.
{"data": [...], "exchange": "binancef", "symbol": "btc/usd", "tf": "1m", "from": 1704067200, "to": 1704153600, "points": 1440}| Field | Type | Description |
|---|---|---|
data | any[] | Array of data points |
exchange | string | Exchange ID |
symbol | string | Trading pair |
tf | string | Timeframe |
from, to | int64 | Unix timestamps (seconds) |
points | int64 | Number of data points |
ErrorResponse
Error response format.
{"error": {"code": "INVALID_PARAMS", "message": "Invalid request parameters", "details": {"field": "from"}}}| Field | Type | Description |
|---|---|---|
error.code | string | Error code |
error.message | string | Human-readable message |
error.details | object | Additional details (optional) |
WebSocket Control Messages
Connected
{"type": "connected", "tier": "pro", "max_subscriptions": 100, "format": "json"}Subscribed / Unsubscribed
{"type": "subscribed", "id": "my-id", "channel": "candles", "exchange": "binancef", "symbol": "btc/usd", "tf": "1m"}Disconnecting
{"type": "disconnecting", "reason": "backpressure"}Reasons: backpressure, timeout, server_shutdown, normal
Pong
{"type": "pong"}Subscriptions
{"type": "subscriptions", "count": 2, "max": 100, "subscriptions": [{"id": "candles.binancef.btc/usd.60", "channel": "candles", "exchange": "binancef", "symbol": "btc/usd", "tf": "1m"}]}Reference Types
UsageResponse
{"limit": 10000, "remaining": 8500, "used": 1500, "reset": 1704067260, "window_seconds": 60}limit, remaining, and used are dynamic values returned for your current key and plan.
| Field | Type | Description |
|---|---|---|
limit | int64 | Max weight per minute |
remaining | int64 | Remaining weight |
used | int64 | Weight consumed |
reset | int64 | Window reset timestamp |
window_seconds | int64 | Window duration (60) |
BucketGroupInfo
{"id": 3, "name": "1K-10K", "description": "$1,000 - $10,000"}| ID | Name | Range |
|---|---|---|
| 1 | all | All trades |
| 2 | 1-1K | $1 - $1,000 |
| 3 | 1K-10K | $1,000 - $10,000 |
| 4 | 10K-25K | $10,000 - $25,000 |
| 5 | 25K-50K | $25,000 - $50,000 |
| 6 | 50K-100K | $50,000 - $100,000 |
| 7 | 100K-250K | $100,000 - $250,000 |
| 8 | 250K-500K | $250,000 - $500,000 |
| 9 | 500K-1M | $500,000 - $1,000,000 |
| 10 | 1M-5M | $1,000,000 - $5,000,000 |
| 11 | 5M+ | $5,000,000+ |