v1.2 stableJSON over HTTPS · WSS

NIOX Developer API

Introduction

The NIOX API gives you programmatic access to market data, trading, and account operations. Field names, JSON shapes, and pagination conventions match the de-facto industry standard used by major centralized exchanges so existing bot tooling (CCXT-style libraries) works without per-exchange shims.

There are three layers — explore each from the sidebar:

  • Public Market Data — REST endpoints, no auth, IP-rate-limited.
  • WebSocket Streams — push-style market data over a single multiplexed connection.
  • Trading + Account — JWT (web UI) or HMAC-signed API key (bots). Same endpoints, two auth methods.

Base URLs

REST:

https://api.niotx.com

WebSocket (combined stream):

wss://ws.niotx.com/ws/v1/stream

Authentication

Endpoints under /api/v1/public/ need no authentication. Trading and account endpoints accept either:

  • JWT — used by the web UI. Standard Authorization: Bearer <token> header.
  • HMAC-signed API key — used by bots. See the next section for the full signing protocol.

When both styles are valid on the same endpoint, the API key path takes priority if the X-API-Key header is present. Otherwise the JWT path runs unchanged.

HMAC signing

Create an API key from your account page. The plaintext secret is returned exactly once at creation — store it immediately. Every signed request carries three headers:

  • X-API-Key — your public key id (niox_pk_…).
  • X-Timestamp — current time in ms epoch. Tolerance ±30s.
  • X-Signature — hex HMAC-SHA256 of the canonical message, signed with your secret.

Canonical message

<timestamp_ms> + <METHOD> + <path> + <query_string> + sha256(body)

All concatenated as one string, no delimiters. The body hash is the hex SHA-256 of the raw request body (empty string when there's no body). Query string is the raw URL-encoded string (no leading ?).

curl example — signed GET

TS=$(date +%s000)
PATH_="/api/v1/trade/orders/open/"
MSG="${TS}GET${PATH_}"
SIG=$(printf '%s' "$MSG" | openssl dgst -sha256 -hmac "$NIOX_API_SECRET" | awk '{print $2}')

curl "https://api.niotx.com${PATH_}" \
  -H "X-API-Key: $NIOX_API_KEY" \
  -H "X-Timestamp: $TS" \
  -H "X-Signature: $SIG"

curl example — signed POST (place LIMIT BUY)

BODY='{"symbol":"BTCUSDT","side":"BUY","type":"LIMIT","quantity":"0.001","price":"50000","timeInForce":"GTC"}'
TS=$(date +%s000)
BODY_HASH=$(printf '%s' "$BODY" | openssl dgst -sha256 | awk '{print $2}')
MSG="${TS}POST/api/v1/trade/order${BODY_HASH}"
SIG=$(printf '%s' "$MSG" | openssl dgst -sha256 -hmac "$NIOX_API_SECRET" | awk '{print $2}')

curl -X POST https://api.niotx.com/api/v1/trade/order \
  -H "X-API-Key: $NIOX_API_KEY" \
  -H "X-Timestamp: $TS" \
  -H "X-Signature: $SIG" \
  -H "Content-Type: application/json" \
  -d "$BODY"

Permissions are checked per request — keys with onlyread are rejected on trading endpoints, etc. Granting thewithdraw permission requires a current TOTP code in the create/update request.

Rate limits

Public market-data endpoints: 1200 req/min/IP(industry-standard default). Listing-format endpoints:60 req/min/IP. Authenticated endpoints use per-user DRF throttles.

Every public response carriesX-Used-Weight-1m and the alias X-MBX-USED-WEIGHT-1m(for CCXT-style libraries that already look for that name) — track these to pace your requests against your IP's rolling-60s weight total. Heavier endpoints cost more weight per call (ping = 1, exchangeInfo = 10, ticker/24hr all-symbols = 40).

Conventions

  • All numeric values are JSON strings to preserve full decimal precision.
  • Timestamps are unix milliseconds (UTC).
  • Symbol format: standard endpoints use BTCUSDT (concatenated, uppercase). Listing-format endpoints use BTC_USDT (underscore-delimited).
  • WebSocket subscribe payloads accept both {"action":"subscribe"} (native) AND {"method":"SUBSCRIBE"} (CCXT-style).
Public Market Data
GET/api/v1/public/ping

Ping

Connectivity check. Returns an empty object on success.

GET/api/v1/public/time

Server Time

Server's current Unix epoch time in milliseconds. Use this if your local clock drifts more than 30s from ours (HMAC signature requests will be rejected outside that window).

Response fields

NameTypePresenceDescription
serverTimeintegerAlwaysServer time, ms since epoch.
GET/api/v1/public/exchangeInfo

Exchange Info

Exchange metadata + every active symbol with its trading filters (PRICE_FILTER, LOT_SIZE, NOTIONAL). Read this on startup; cache it for the session.

Response fields

NameTypePresenceDescription
timezonestringAlwaysAlways "UTC".
serverTimeintegerAlwaysServer time, ms epoch.
rateLimitsarrayAlwaysDocumented IP/weight rate limits.
symbolsarrayAlwaysPer-symbol info: status, base/quote asset + precision, supported orderTypes, filters.
GET/api/v1/public/depth

Order Book Depth

Top-N bid/ask levels. bids are sorted highest-first, asks lowest-first. Each level is [price, quantity], both string-encoded.

Query parameters

NameTypeRequiredDescription
symbolstringMandatoryPair symbol (e.g. BTCUSDT). Uppercase.
limitintegerRecommendedOne of 5, 10, 20, 50, 100, 500, 1000. Default 20.

Response fields

NameTypePresenceDescription
lastUpdateIdintegerAlwaysMonotonic update counter — use to order consecutive snapshots.
bidsarrayAlways[price, quantity] arrays, highest-price first.
asksarrayAlways[price, quantity] arrays, lowest-price first.
GET/api/v1/public/trades

Recent Trades

Most recent trades (newest first). Includes the trade ID, fill price, quantity, and which side was the maker.

Query parameters

NameTypeRequiredDescription
symbolstringMandatoryPair symbol.
limitintegerRecommended1..1000, default 500.

Response fields

NameTypePresenceDescription
idintegerAlwaysTrade ID (monotonic per pair).
pricedecimalAlwaysExecution price.
qtydecimalAlwaysBase-asset quantity.
quoteQtydecimalAlwaysQuote-asset quantity (price × qty).
timeintegerAlwaysTrade time, ms epoch.
isBuyerMakerbooleanAlwaystrue = buyer was the resting maker (so taker sold).
isBestMatchbooleanAlwaysAlways true on our exchange (no aggregator inheritance).
GET/api/v1/public/historicalTrades

Historical Trades (cursor)

Trade history with cursor pagination. Pass fromId to walk forward from a known ID.

Query parameters

NameTypeRequiredDescription
symbolstringMandatoryPair symbol.
limitintegerRecommended1..1000, default 500.
fromIdintegerOptionalReturn trades with id >= fromId (inclusive). Omit for newest-first.

Response fields

NameTypePresenceDescription
idintegerAlwaysTrade ID.
pricedecimalAlwaysExecution price.
qtydecimalAlwaysBase quantity.
quoteQtydecimalAlwaysQuote quantity.
timeintegerAlwaysTrade time, ms epoch.
isBuyerMakerbooleanAlwaysSame as /trades.
GET/api/v1/public/klines

Klines (candles)

OHLCV candles for a symbol + interval. Returns oldest-first. Each row is the 12-element industry-standard array: [openTime, open, high, low, close, volume, closeTime, quoteVolume, trades, takerBuyBaseVolume, takerBuyQuoteVolume, ignore].

Query parameters

NameTypeRequiredDescription
symbolstringMandatoryPair symbol.
intervalstringMandatoryOne of: 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w.
limitintegerRecommended1..1000, default 500.
startTimeintegerOptionalInclusive ms epoch.
endTimeintegerOptionalInclusive ms epoch.
GET/api/v1/public/ticker/24hr

24h Ticker

Full 24h price/volume statistics. Returns one object when symbol is given, or an array of every active pair when omitted. Heavy endpoint when called without symbol (weight 40); prefer the WebSocket !ticker@arr stream for continuous updates.

Query parameters

NameTypeRequiredDescription
symbolstringOptionalOmit to fetch every pair.

Response fields

NameTypePresenceDescription
symbolstringAlwaysPair symbol.
lastPricedecimalAlwaysMost recent trade price.
priceChangedecimalAlwaysAbsolute 24h price change.
priceChangePercentdecimalAlways24h percent change.
openPricedecimalAlwaysPrice 24h ago.
highPricedecimalAlways24h high.
lowPricedecimalAlways24h low.
bidPricedecimalAlwaysBest current bid.
askPricedecimalAlwaysBest current ask.
volumedecimalAlways24h base-asset volume.
quoteVolumedecimalAlways24h quote-asset volume.
openTimeintegerAlwaysWindow start, ms epoch.
closeTimeintegerAlwaysWindow end, ms epoch.
countintegerAlwaysTrade count in the window.
GET/api/v1/public/ticker/price

Last Price

Last trade price only. Lightest ticker endpoint. Returns one object or an array of all pairs.

Query parameters

NameTypeRequiredDescription
symbolstringOptionalOmit for all pairs.

Response fields

NameTypePresenceDescription
symbolstringAlwaysPair symbol.
pricedecimalAlwaysLast traded price.
GET/api/v1/public/ticker/bookTicker

Book Ticker

Best bid/ask + quantity only. Use this to spot quote when you don't need the full 24h stats.

Query parameters

NameTypeRequiredDescription
symbolstringOptionalOmit for all pairs.

Response fields

NameTypePresenceDescription
symbolstringAlwaysPair symbol.
bidPricedecimalAlwaysBest current bid.
bidQtydecimalAlwaysQuantity at best bid.
askPricedecimalAlwaysBest current ask.
askQtydecimalAlwaysQuantity at best ask.
GET/api/v1/public/avgPrice

Average Price

Mean trade price over the last 5 minutes. Returns 404 if no trades occurred in that window.

Query parameters

NameTypeRequiredDescription
symbolstringMandatoryPair symbol.

Response fields

NameTypePresenceDescription
minsintegerAlwaysWindow length (always 5).
pricedecimalAlwaysMean trade price.
closeTimeintegerAlwaysComputation time, ms epoch.
GET/api/v1/public/summary

Exchange Summary (CMC)

Per-pair summary in CoinMarketCap-compatible schema. Used by CMC's exchange-tracking integration.

Response fields

NameTypePresenceDescription
trading_pairsstringAlwaysPair ID like BTC_USDT.
base_currencystringAlwaysBase asset symbol.
quote_currencystringAlwaysQuote asset symbol.
last_pricedecimalAlwaysLast trade price.
lowest_askdecimalAlwaysBest ask.
highest_biddecimalAlwaysBest bid.
base_volumedecimalAlways24h volume in base units.
quote_volumedecimalAlways24h volume in quote units.
price_change_percent_24hdecimalAlways24h percent change.
highest_price_24hdecimalAlways24h high.
lowest_price_24hdecimalAlways24h low.
Listing Format
GET/api/v1/public/pairs

Pairs

Every active trading pair on the exchange. Used by aggregators to discover what is tradable before subscribing to ticker / orderbook / trade streams.

Response fields

NameTypePresenceDescription
ticker_idstringAlwaysPair identifier with underscore delimiter (e.g. BTC_USDT).
basestringAlwaysBase asset symbol.
targetstringAlwaysQuote asset symbol.
GET/api/v1/public/tickers

Tickers

24-hour pricing and volume for every active pair. Polled by listing aggregators at ~1-minute intervals.

Response fields

NameTypePresenceDescription
ticker_idstringAlwaysPair identifier with underscore delimiter.
base_currencystringAlwaysBase asset symbol.
target_currencystringAlwaysQuote asset symbol.
last_pricedecimalAlwaysLast traded price (string-encoded).
base_volumedecimalAlways24h single-sided volume in base units.
target_volumedecimalAlways24h single-sided volume in quote units.
biddecimalConditionalBest bid; omitted when the book is empty or crossed.
askdecimalConditionalBest ask; omitted when the book is empty or crossed.
highdecimalConditional24h high price; omitted when no trades.
lowdecimalConditional24h low price; omitted when no trades.
GET/api/v1/public/orderbook

Orderbook (listing format)

Top-of-book depth for a single pair. Each entry is [price, quantity], both string-encoded for full precision.

Query parameters

NameTypeRequiredDescription
ticker_idstringMandatoryPair identifier with underscore delimiter (e.g. BTC_USDT).
depthintegerRecommendedLevels per side. Default 100, max 500. Pass 0 for full book (still capped at 500).

Response fields

NameTypePresenceDescription
ticker_idstringAlwaysEchoes the requested pair.
timestampintegerAlwaysSnapshot time (ms epoch).
bidsarrayAlways[price, quantity] arrays sorted by price descending. Empty when no bids.
asksarrayAlways[price, quantity] arrays sorted by price ascending. Empty when no asks.
GET/api/v1/public/historical_trades

Historical Trades (listing format)

Recent trades for a pair, grouped by side. trade_id is the engine execution ID, never a unix timestamp.

Query parameters

NameTypeRequiredDescription
ticker_idstringMandatoryPair identifier with underscore delimiter.
typestringOptionalFilter to "buy" or "sell". Omit for both.
limitintegerRecommendedNumber of trades. Default 100, max 500.

Response fields

NameTypePresenceDescription
trade_idstringAlwaysEngine-assigned execution identifier (not a timestamp).
pricedecimalAlwaysExecution price in target currency.
base_volumedecimalAlwaysAmount in base units.
target_volumedecimalAlwaysAmount in quote units.
trade_timestampintegerAlwaysExecution time (ms epoch).
typestringAlways"buy": taker lifted an ask. "sell": taker hit a bid.
Trading
POST/api/v1/trade/orderJWT or HMAC

Place Order

Place a limit, market, stop-loss, or take-profit order. Both /api/v1/trade/order (singular, for CCXT-style libraries) and /api/v1/trade/orders/ (plural, used by the web UI) route to the same handler. Accepts both industry-standard and internal field names — the endpoint normalises before validation.

Body fields

NameTypeRequiredDescription
symbolstringMandatoryPair symbol, e.g. BTCUSDT. Internal alias: pair_symbol.
sidestringMandatoryBUY or SELL (case-insensitive). Internal: lowercase buy/sell.
typestringMandatoryLIMIT, MARKET, STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT. Internal alias: order_type (lowercase).
quantitydecimalMandatoryBase-asset quantity. Internal alias: orig_qty.
pricedecimalConditionalRequired for LIMIT orders. Omit for MARKET.
timeInForcestringOptionalGTC (default), IOC, or FOK. Internal alias: time_in_force.
stopPricedecimalConditionalTrigger price; required for STOP_* and TAKE_PROFIT_* orders. Internal alias: stop_price.
quoteOrderQtydecimalConditionalRequired for MARKET BUY (spend this much quote currency). Internal alias: quote_order_qty.
newClientOrderIdstringOptionalClient-supplied order ID (max 64 chars). Internal alias: client_order_id.

Response fields

NameTypePresenceDescription
idintegerAlwaysServer-assigned order ID.
statusstringAlwaysnew | partially_filled | filled | cancelled | rejected.
pair_symbolstringAlwaysPair (echoed).
sidestringAlwaysbuy or sell.
order_typestringAlwaysOrder type.
orig_qtydecimalAlwaysOriginal quantity.
executed_qtydecimalAlwaysFilled so far.
pricedecimalConditionalOrder price (null for MARKET).
created_atstringAlwaysISO timestamp.

curl

BODY='{"symbol":"BTCUSDT","side":"BUY","type":"LIMIT","quantity":"0.001","price":"50000","timeInForce":"GTC"}'
TS=$(date +%s000)
BODY_HASH=$(printf '%s' "$BODY" | openssl dgst -sha256 | awk '{print $2}')
MSG="${TS}POST/api/v1/trade/order${BODY_HASH}"
SIG=$(printf '%s' "$MSG" | openssl dgst -sha256 -hmac "$NIOX_API_SECRET" | awk '{print $2}')

curl -X POST https://api.niotx.com/api/v1/trade/order \
  -H "X-API-Key: $NIOX_API_KEY" \
  -H "X-Timestamp: $TS" \
  -H "X-Signature: $SIG" \
  -H "Content-Type: application/json" \
  -d "$BODY"
DELETE/api/v1/trade/orders/{order_id}/JWT or HMAC

Cancel Order

Cancel an open order by its server-assigned ID. The singular alias /api/v1/trade/order/{order_id} resolves to the same view.

Query parameters

NameTypeRequiredDescription
order_idintegerMandatoryOrder ID from the create response.

Response fields

NameTypePresenceDescription
idintegerAlwaysOrder ID.
statusstringAlwayscancelled (or partially_filled if already partially filled).
GET/api/v1/trade/orders/open/JWT or HMAC

Open Orders

Your currently open orders (status = new or partially_filled). Paginated.

Query parameters

NameTypeRequiredDescription
pairstringOptionalFilter to a specific pair (e.g. BTCUSDT).
pageintegerOptionalPage number, default 1.
page_sizeintegerOptionalPage size, default 10.

Response fields

NameTypePresenceDescription
resultsarrayAlwaysArray of order objects.
current_pageintegerAlwaysCurrent page (1-based).
total_pagesintegerAlwaysTotal page count.
total_countintegerAlwaysTotal open-order count.
GET/api/v1/trade/orders/history/JWT or HMAC

Order History

Filled, cancelled, and rejected orders. Same pagination as open orders.

Query parameters

NameTypeRequiredDescription
pairstringOptionalFilter by pair.
pageintegerOptionalPage, default 1.
page_sizeintegerOptionalDefault 10.
GET/api/v1/trade/fills/JWT or HMAC

Trade Fills

Individual fill records (one per match). Use this to compute realized P&L per trade.

Query parameters

NameTypeRequiredDescription
pairstringOptionalFilter by pair.
pageintegerOptionalPage, default 1.
Account & API Keys
GET/api/v1/accounts/profile/JWT only

My Profile

Your account profile: email, base currency, total balance, KYC status, 2FA status.

Response fields

NameTypePresenceDescription
idintegerAlwaysUser ID.
emailstringAlwaysAccount email.
is_activebooleanAlwaysAccount active.
base_currencystringAlwaysDisplay currency (e.g. USDT).
total_balancedecimalAlwaysTotal balance in base currency.
is_totpbooleanAlwaysWhether 2FA is enabled.
is_kyc_verifiedbooleanAlwaysKYC status.
POST/api/v1/accounts/apiKeys/JWT only

Create API Key

Issue a new API key. The plaintext `secret` is returned in this response exactly once — save it immediately. After this, only the public `key` is ever returned. Granting `can_withdraw: true` requires submitting a current TOTP code in the same request.

Body fields

NameTypeRequiredDescription
labelstringMandatoryFree-text name, max 100 chars. Just for your own reference.
can_readbooleanOptionalAccount info, balances, order history. Default true.
can_tradebooleanOptionalPlace and cancel orders. Default false.
can_withdrawbooleanOptionalInitiate withdrawals. Requires totp_code AND 2FA enabled on the account. Default false.
ip_whitelistarrayOptionalArray of allowed source IPs (e.g. ["1.2.3.4"]). Empty array = any IP.
totp_codestringConditionalCurrent 6-digit TOTP code. Required ONLY when can_withdraw is true.

Response fields

NameTypePresenceDescription
idintegerAlwaysServer-assigned key ID.
keystringAlwaysPublic key id (niox_pk_…). Safe to log.
secretstringAlwaysPlaintext secret (niox_sk_…). SHOWN ONCE. Never returned again.
labelstringAlwaysEchoed from request.
permissionsarrayAlwaysArray of granted permissions: ["read", "trade", "withdraw"].
ip_whitelistarrayAlwaysEchoed.
warningstringAlways"Save your secret now. It will not be shown again."
GET/api/v1/accounts/apiKeys/JWT only

List API Keys

All your API keys. Secrets are never returned — use them from your own records.

Response fields

NameTypePresenceDescription
idintegerAlwaysKey ID.
keystringAlwaysPublic key id.
labelstringAlwaysYour label.
permissionsarrayAlwaysGranted permissions.
ip_whitelistarrayAlwaysAllowed IPs.
is_activebooleanAlwaysDisabled keys still appear in the list.
last_used_atstringConditionalISO timestamp; null if never used.
last_used_ipstringConditionalIP of the last request; null if never used.
created_atstringAlwaysWhen the key was issued.
PATCH/api/v1/accounts/apiKeys/{key_id}/JWT only

Update API Key

Update label, IP whitelist, or permissions. Granting `can_withdraw: true` (turning it on for a key that was previously without it) requires a TOTP code.

Query parameters

NameTypeRequiredDescription
key_idintegerMandatoryKey ID from create/list response.

Body fields

NameTypeRequiredDescription
labelstringOptionalNew label.
can_readbooleanOptionalToggle read permission.
can_tradebooleanOptionalToggle trade permission.
can_withdrawbooleanOptionalToggle withdraw permission. Requires totp_code if granting (false→true).
ip_whitelistarrayOptionalReplace the IP whitelist entirely.
is_activebooleanOptionalDisable a key without deleting it.
totp_codestringConditionalRequired when granting can_withdraw.
DELETE/api/v1/accounts/apiKeys/{key_id}/JWT only

Revoke API Key

Permanently revoke a key. The deletion is immediate — any in-flight request signed with this key will start failing within seconds.

Query parameters

NameTypeRequiredDescription
key_idintegerMandatoryKey ID to revoke.
WebSocket Streams

One WSS connection multiplexes many streams. Subscribe via JSON after connect, or pass ?streams=foo/bar in the URL for instant subscription. Up to 30 streams per connection; the server auto-closes after 24 hours (clients should reconnect).

Subscribe

{"method":"SUBSCRIBE","params":["btcusdt@trade","btcusdt@depth"],"id":1}

Unsubscribe

{"method":"UNSUBSCRIBE","params":["btcusdt@trade"],"id":2}

Connect via wscat

wscat -c "wss://ws.niotx.com/ws/v1/stream?streams=btcusdt@trade/btcusdt@depth"
WS<symbol>@trade

Trade

Individual trades as they execute. Carries the trade ID `t` for client-side dedup. The high-water mark guarantees each trade is emitted at most once per connection.

Subscribe param

btcusdt@trade

Event fields

NameTypePresenceDescription
estringAlways"trade".
EintegerAlwaysEvent time, ms epoch.
sstringAlwaysPair symbol, uppercase.
tintegerAlwaysTrade ID (monotonic per pair, resets on engine restart).
pdecimalAlwaysExecution price.
qdecimalAlwaysBase quantity.
TintegerAlwaysTrade time, ms epoch.
mbooleanAlwaystrue = buyer was the maker.

Example message

{
  "stream": "btcusdt@trade",
  "data": {
    "e": "trade",
    "E": 1779011120306,
    "s": "BTCUSDT",
    "t": 70141750,
    "p": "78156.03",
    "q": "0.000497",
    "T": 1779011120306,
    "m": false
  }
}
WS<symbol>@ticker

24h Ticker

Full 24h rolling ticker. Fires once per real trade (≈5/s on active pairs).

Subscribe param

btcusdt@ticker

Event fields

NameTypePresenceDescription
estringAlways"24hrTicker".
EintegerAlwaysEvent time, ms epoch.
sstringAlwaysPair symbol.
cdecimalAlwaysLast trade price.
odecimalAlwaysOpen price (24h ago).
hdecimalAlways24h high.
ldecimalAlways24h low.
vdecimalAlways24h base-asset volume.
qdecimalAlways24h quote-asset volume.
pdecimalAlwaysAbsolute price change.
PdecimalAlwaysPercent price change.
bdecimalAlwaysBest bid.
adecimalAlwaysBest ask.
nintegerAlways24h trade count.

Example message

{"stream":"btcusdt@ticker","data":{"e":"24hrTicker","E":1779011200000,"s":"BTCUSDT","c":"78119.71","o":"78100.69","h":"78369.88","l":"77654.50","v":"94.32","q":"7367633.28","p":"19.02","P":"0.0244","b":"78097.06","a":"78143.94","n":19896}}
WS<symbol>@miniTicker

Mini Ticker

Lightweight 24h subset — close, open, high, low, volume. No bid/ask, no count.

Subscribe param

btcusdt@miniTicker

Event fields

NameTypePresenceDescription
estringAlways"24hrMiniTicker".
EintegerAlwaysEvent time, ms epoch.
sstringAlwaysPair symbol.
cdecimalAlwaysLast price.
odecimalAlwaysOpen price.
hdecimalAlways24h high.
ldecimalAlways24h low.
vdecimalAlways24h base volume.
qdecimalAlways24h quote volume.

Example message

{"stream":"btcusdt@miniTicker","data":{"e":"24hrMiniTicker","E":1779011200000,"s":"BTCUSDT","c":"78119.71","o":"78100.69","h":"78369.88","l":"77654.50","v":"94.32","q":"7367633.28"}}
WS<symbol>@bookTicker

Book Ticker

Best bid/ask + quantity only. The lightest live-quote stream.

Subscribe param

btcusdt@bookTicker

Event fields

NameTypePresenceDescription
estringAlways"bookTicker".
uintegerAlwaysBook update ID.
sstringAlwaysPair symbol.
bdecimalAlwaysBest bid price.
BdecimalAlwaysBest bid quantity.
adecimalAlwaysBest ask price.
AdecimalAlwaysBest ask quantity.

Example message

{"stream":"btcusdt@bookTicker","data":{"e":"bookTicker","u":1779011200,"s":"BTCUSDT","b":"78097.06","B":"0.045","a":"78143.94","A":"0.038"}}
WS<symbol>@depth | <symbol>@depth@100ms | <symbol>@depth@1000ms

Order Book Depth (full)

Full top-20 orderbook snapshot. Optional cadence suffix: @100ms or @1000ms.

Subscribe param

btcusdt@depth

Event fields

NameTypePresenceDescription
sstringAlwaysPair symbol.
bidsarrayAlwaysTop-20 bids: [price, quantity] highest-first.
asksarrayAlwaysTop-20 asks: [price, quantity] lowest-first.
lastUpdateIdintegerAlwaysMonotonic update counter.

Example message

{"stream":"btcusdt@depth","data":{"s":"BTCUSDT","bids":[["78097.06","0.04"]],"asks":[["78143.94","0.03"]],"lastUpdateId":1779011200}}
WS<symbol>@depth5 | <symbol>@depth10 | <symbol>@depth20

Order Book Depth (partial)

Partial-book snapshot. The server slices the full top-20 to your requested level count before sending — useful for bandwidth-sensitive clients.

Subscribe param

btcusdt@depth5

Event fields

NameTypePresenceDescription
sstringAlwaysPair symbol.
bidsarrayAlwaysTop N bids (5/10/20).
asksarrayAlwaysTop N asks (5/10/20).
lastUpdateIdintegerAlwaysMonotonic counter (shared with full @depth).

Example message

{"stream":"btcusdt@depth5","data":{"s":"BTCUSDT","bids":[…5 levels…],"asks":[…5 levels…],"lastUpdateId":1779011200}}
WS<symbol>@kline_<interval>

Kline / Candle

Live updates for the current candle. Intervals: 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w.

Subscribe param

btcusdt@kline_1m

Event fields

NameTypePresenceDescription
estringAlways"kline".
EintegerAlwaysEvent time, ms epoch.
sstringAlwaysPair symbol.
kobjectAlwaysKline object: {t, T, s, i, o, c, h, l, v, q, n, x} — open/close time, interval, OHLCV, trade count, is_closed flag.

Example message

{"stream":"btcusdt@kline_1m","data":{"e":"kline","E":1779011200000,"s":"BTCUSDT","k":{"t":1779011160000,"T":1779011219999,"s":"BTCUSDT","i":"1m","o":"78100","c":"78120","h":"78130","l":"78090","v":"0.5","q":"39062.5","n":3,"x":false}}}
WS!ticker@arr

All Tickers

Array of every pair's 24h ticker in a single message. Fires once every 5 seconds.

Subscribe param

!ticker@arr

Event fields

NameTypePresenceDescription
estringAlways"allMiniTickers".
EintegerAlwaysEvent time, ms epoch.
tickersarrayAlwaysArray of per-pair ticker objects (s, c, o, h, l, v, q, P).

Example message

{"stream":"!ticker@arr","data":{"e":"allMiniTickers","E":1779011200000,"tickers":[{"s":"BTCUSDT","c":"78119.71",...},{"s":"ETHUSDT","c":"2222.47",...}]}}
WS!miniTicker@arr

All Mini Tickers

Same cadence as !ticker@arr but with the mini-ticker subset only.

Subscribe param

!miniTicker@arr

Event fields

NameTypePresenceDescription
estringAlways"allMiniTickers".
EintegerAlwaysEvent time, ms epoch.
tickersarrayAlwaysArray of mini-ticker objects.

Example message

{"stream":"!miniTicker@arr","data":{"e":"allMiniTickers","E":1779011200000,"tickers":[…]}}

Errors

Public market-data endpoints use the industry-standard{code, msg} shape with negative integer codes:

CodeHTTPMeaning
-1100400Illegal characters in a parameter.
-1102400Mandatory parameter missing or empty.
-1121400Invalid symbol.
-1130400Invalid value for parameter.
401HMAC signature failed, key disabled/expired, or IP not whitelisted.
403Permission denied (e.g. API key lacks trade).
429Rate limit exceeded. Back off and retry.

Trading endpoints use DRF's standard{error, message, details} shape on 4xx responses.