Skip to main content
This page documents WebSocket channels, how to subscribe/unsubscribe, and the message formats for each channel.

Supported Channels

ChannelDescriptionSupported Markets
tickerReal-time ticker updatesForex, Metals, Indices, US Stocks, HK Stocks, A-Shares, Crypto
depthOrder book depth updatesUS Stocks, HK Stocks, A-Shares, Crypto
tradeTrade recordsUS Stocks, HK Stocks, Crypto

ticker Channel

Subscribe

{
  "cmd": "subscribe",
  "data": {
    "channel": "ticker",
    "symbols": ["AAPL.US", "BTCUSDT"],
    "type": "stock"
  }
}
type is optional. Not required when the symbol is unambiguous; if the server returns an AMBIGUOUS_SYMBOL error, pass the value as indicated. Values: stock, indices, crypto, forex

Unsubscribe

{
  "cmd": "unsubscribe",
  "data": {
    "channel": "ticker",
    "symbols": ["AAPL.US"]
  }
}

Server Response

The ticker message returns different fields based on market type.

Index

{
  "cmd": "ticker",
  "data": {
    "symbol": "SPX",
    "last_price": "7342.86",
    "timestamp": 1779204386000
  }
}

Metals

{
  "cmd": "ticker",
  "data": {
    "symbol": "XAUUSD",
    "last_price": "5130.72000",
    "ask_price": "5131.07000",
    "bid_price": "5130.37000",
    "spread": "0.70000",
    "exchange": 48,
    "timestamp": 1773334355000
  }
}

Forex

{
  "cmd": "ticker",
  "data": {
    "symbol": "EURUSD",
    "last_price": "1.15200",
    "ask_price": "1.15202",
    "bid_price": "1.15199",
    "spread": "0.00003",
    "exchange": 48,
    "timestamp": 1773334426000
  }
}

Stocks

US Stocks:
{
  "cmd": "ticker",
  "data": {
    "symbol": "NVDA",
    "last_price": "221.25",
    "volume_24h": "462724",
    "high_24h": "223.44",
    "low_24h": "220.04",
    // Only present outside regular trading hours
    // Values: pre_market, post_market, overnight
    "trade_session": "overnight",
    "timestamp": 1779171600000
  }
}
HK Stocks:
{
  "cmd": "ticker",
  "data": {
    "symbol": "700",
    "last_price": "461.4",
    "volume_24h": "24687716",
    "high_24h": "468.8",
    "low_24h": "448.6",
    "timestamp": 1779171608000
  }
}
A-Shares:
{
  "cmd": "ticker",
  "data": {
    "symbol": "600519",
    "last_price": "1319.01",
    "volume_24h": "37263",
    "high_24h": "1329.99",
    "low_24h": "1318",
    "price_change_24h": "-3.99",
    "price_change_percent_24h": "-0.30",
    "timestamp": 1779171605000
  }
}

Crypto

{
  "cmd": "ticker",
  "data": {
    "symbol": "BTCUSDT",
    "last_price": "70480.57000000",
    "volume_24h": "23737.52989000",
    "high_24h": "71321.00000000",
    "low_24h": "69205.91000000",
    "price_change_24h": "-362.06000000",
    "price_change_percent_24h": "-0.511",
    "timestamp": 1773335135026
  }
}

Fields

FieldTypeDescriptionMarkets
symbolstringTrading symbolAll
last_pricestringLast traded priceAll
timestampintServer timestamp in msAll
ask_pricestringAsk priceForex, Metals
bid_pricestringBid priceForex, Metals
spreadstringBid-ask spreadForex, Metals
exchangeintExchange codeForex, Metals
volume_24hstring24-hour trading volumeStocks, Crypto
high_24hstring24-hour high priceStocks, Crypto
low_24hstring24-hour low priceStocks, Crypto
price_change_24hstring24-hour price changeA-Shares, Crypto
price_change_percent_24hstring24-hour price change percentageA-Shares, Crypto
trade_sessionstringPresent outside regular trading hours, see exampleUS Stocks

depth Channel

Subscribe

{
  "cmd": "subscribe",
  "data": {
    "channel": "depth",
    "symbols": ["AAPL.US", "BTCUSDT"],
    "type": "stock"
  }
}
type is optional. Not required when the symbol is unambiguous; if the server returns an AMBIGUOUS_SYMBOL error, pass the value as indicated. Values: stock, indices, crypto, forex

Unsubscribe

{
  "cmd": "unsubscribe",
  "data": {
    "channel": "depth",
    "symbols": ["AAPL.US"]
  }
}

Server Response

{
  "cmd": "depth",
  "data": {
    "symbol": "BTCUSDT",
    "bids": [
      ["43250.50", "0.125"],
      ["43250.00", "0.250"]
    ],
    "asks": [
      ["43251.00", "0.180"],
      ["43251.50", "0.320"]
    ],
    "timestamp": 1703123456789
  }
}

Fields

FieldTypeDescription
symbolstringTrading symbol
bidsarrayBid levels: [price, quantity]
asksarrayAsk levels: [price, quantity]
timestampintServer timestamp in ms
Ordering
  • bids: price descending
  • asks: price ascending

trade Channel

Subscribe

{
  "cmd": "subscribe",
  "data": {
    "channel": "trade",
    "symbols": ["700.HK", "BTCUSDT"],
    "type": "stock"
  }
}
type is optional. Not required when the symbol is unambiguous; if the server returns an AMBIGUOUS_SYMBOL error, pass the value as indicated. Values: stock, indices, crypto, forex

Unsubscribe

{
  "cmd": "unsubscribe",
  "data": {
    "channel": "trade",
    "symbols": ["700.HK"]
  }
}

Server Response

{
  "cmd": "trade",
  "data": {
    "symbol": "700.HK",
    "trades": [
      {
        "id": "20950",
        "price": "553.000",
        "quantity": "100",
        "side": "buy",
        "timestamp": 1773371154
      }
    ]
  }
}

Fields

FieldTypeDescription
symbolstringTrading symbol
tradesarrayArray of trade records
└─ idstringTrade ID
└─ pricestringTrade price
└─ quantitystringTrade quantity
└─ sidestringbuy or sell
└─ timestampintTrade timestamp (seconds)