WebSocket API

Real-time consolidated order book data across 20 exchanges via a single WebSocket connection.

Quick Start

Connect and get live BTC-USDT order book data in three lines:

const ws = new WebSocket("wss://api.microversesystems.com");
ws.onopen = () => ws.send('{"op":"subscribe","channel":"fullbook:BTC-USDT","depth":20}');
ws.onmessage = (e) => console.log(JSON.parse(e.data));

You'll receive a subscribed ack followed by continuous snapshot updates with the consolidated order book from all exchanges.

Connection

Connect via WebSocket to the API endpoint:

EnvironmentEndpoint
Productionwss://api.microversesystems.com
Local devws://localhost:8081

No authentication is required. The server sends a snapshot immediately after each successful subscription, then pushes updates at ~100ms intervals when the book changes.

subscribe

Subscribe to a market data channel. The server responds with a subscribed ack and an initial snapshot.

{
  "op": "subscribe",
  "channel": "fullbook:BTC-USDT",
  "depth": 20,
  "mode": "inc"
}

Parameters

channel string required — Channel to subscribe to. Format: {type}:{SYMBOL}. See Channel Types.
depth integer optional — Number of price levels per side (1–100). Default: server configured max. Ignored for top: (always 1).
mode string optional — Update mode. "snapshot" (default) sends full book on every push. "inc" sends an initial full snapshot then only incremental deltas.

Channel examples

ChannelDescription
top:BTC-USDTBBO — best bid/offer, 1 level, aggregated across exchanges
consbook:ETH-USDTConsolidated book — multi-level aggregated, no exchange attribution
fullbook:BTC-USDTFull book — all exchanges, with exchange attribution
binance:BTC-USDTSingle exchange book — Binance only

unsubscribe

Unsubscribe from a channel. Server responds with an unsubscribed ack.

{
  "op": "unsubscribe",
  "channel": "fullbook:BTC-USDT"
}
channel string required — Channel to unsubscribe from.

ping

Keepalive. Server responds with pong.

{ "op": "ping" }

exchanges

Request the list of available exchanges with live symbol counts.

{ "op": "exchanges" }

symbols

Request available symbols. Optionally filter by quote asset or exchange.

{
  "op": "symbols",
  "quote": "USDT",
  "exchange": "binance"
}
quote string optional — Filter by quote asset (e.g. USDT, USD).
exchange string optional — Filter by exchange ID (e.g. binance).

snapshot

Book data pushed after subscribe and on each update. Format varies by channel type.

Full book fullbook:

Each level includes exchange attribution: [price, qty, orders, exchange_id]

{
  "type": "snapshot",
  "channel": "fullbook:BTC-USDT",
  "data": {
    "bids": [
      [45000.50, 1.234, 5, "binance"],
      [45000.25, 2.456, 3, "okx"],
      [45000.10, 0.789, 2, "coinbase"]
    ],
    "asks": [
      [45001.00, 0.789, 2, "binance"],
      [45001.50, 3.456, 7, "okx"]
    ],
    "ts": 1711100000000
  }
}

BBO top-of-book top:

Best bid/offer aggregated across all exchanges. Always 1 level per side: [price, qty, orders]

{
  "type": "snapshot",
  "channel": "top:BTC-USDT",
  "data": {
    "bids": [[45000.50, 4.234, 9]],
    "asks": [[45001.00, 4.245, 9]],
    "ts": 1711100000000
  }
}

Consolidated book consbook:

Multi-level aggregated across exchanges at the same price. No exchange attribution: [price, qty, orders]

{
  "type": "snapshot",
  "channel": "consbook:BTC-USDT",
  "data": {
    "bids": [
      [45000.50, 4.234, 9],
      [45000.10, 0.789, 2]
    ],
    "asks": [
      [45001.00, 4.245, 9],
      [45001.50, 3.456, 7]
    ],
    "ts": 1711100000000
  }
}

Single exchange {exchange}:

Book from one exchange only. No exchange attribution: [price, qty, orders]

{
  "type": "snapshot",
  "channel": "binance:BTC-USDT",
  "data": {
    "bids": [[45000.50, 1.234, 5]],
    "asks": [[45001.00, 0.789, 2]],
    "ts": 1711100000000
  }
}

Level fields

IndexFieldTypeDescription
0pricefloatPrice level
1qtyfloatTotal quantity at this level
2ordersintegerNumber of orders at this level
3exchange_idstringExchange ID (fullbook: only)

Bids are sorted descending by price. Asks are sorted ascending. Timestamp ts is milliseconds since epoch.

delta

When subscribed with "mode":"inc", the first message is a full snapshot. Subsequent messages are delta updates containing only levels that changed. No message is sent when nothing changes.

{
  "type": "delta",
  "channel": "consbook:BTC-USDT",
  "data": {
    "bids": [
      [45000.50, 1.200, 3],
      [44998.00, 0, 0]
    ],
    "asks": [
      [45001.00, 0.500, 1]
    ],
    "ts": 1711100000100
  }
}

A level with qty = 0 means the level was removed. Apply deltas on top of the last snapshot to maintain the current book state.

subscribed / unsubscribed

Acknowledgment messages confirming subscription changes.

{ "type": "subscribed", "channel": "fullbook:BTC-USDT" }
{ "type": "unsubscribed", "channel": "fullbook:BTC-USDT" }

exchanges response

{
  "type": "exchanges",
  "data": [
    {
      "id": "binance",
      "name": "Binance",
      "quote": "USDT",
      "symbols": 145,
      "status": "live"
    }
  ]
}
FieldTypeDescription
idstringExchange identifier (lowercase)
namestringDisplay name
quotestringDefault quote asset
symbolsintegerCount of live symbols
statusstringlive or down

symbols response

{
  "type": "symbols",
  "data": [
    {
      "symbol": "BTC-USDT",
      "exchanges": ["binance", "coinbase", "okx"]
    }
  ]
}
FieldTypeDescription
symbolstringCanonical symbol (BASE-QUOTE, uppercase)
exchangesstring[]Exchange IDs carrying this symbol

pong

{ "type": "pong" }

error

{ "type": "error", "msg": "missing channel" }

Possible error messages:

MessageCause
missing opNo op field in message
unknown opUnrecognized operation
missing channelSubscribe/unsubscribe without channel
unknown channelInvalid channel format
unknown symbolSymbol not found in any exchange
unknown exchangeExchange ID not recognized
already subscribedDuplicate subscription

Channel Types

PrefixExampleDescriptionLevel Format
top: top:BTC-USDT BBO — best bid/offer, 1 level, aggregated across exchanges [price, qty, orders]
consbook: consbook:ETH-USDT Consolidated book — multi-level aggregated, no attribution [price, qty, orders]
fullbook: fullbook:BTC-USDT Full book from all exchanges with attribution [price, qty, orders, exchange_id]
{exchange}: binance:BTC-USDT Single exchange book [price, qty, orders]

Symbols use canonical format BASE-QUOTE (uppercase, hyphen-separated). Example: BTC-USDT, ETH-USD, SOL-USDT.

Exchanges

21 exchanges are supported. Use the exchange id as the channel prefix for single-exchange subscriptions.

#IDNameQuote
0binanceBinanceUSDT
1coinbaseCoinbaseUSD
2okxOKXUSDT
3bybitBybitUSDT
4krakenKrakenUSDT
5geminiGeminiUSD
6cryptocomCrypto.comUSDT
7gateioGate.ioUSDT
8kucoinKuCoinUSDT
9upbitUpbitUSDT
10bitgetBitgetUSDT
11mexcMEXCUSDT
12htxHTXUSDT
13bitfinexBitfinexUSD
14bingxBingXUSDT
15phemexPhemexUSDT
16lbankLBankUSDT
17bitmartBitMartUSDT
18coinexCoinExUSDT
19ascendexAscendEXUSDT
20deribitDeribitUSD

Try It

Connect to the API and send commands interactively.