How to use WebSocket API

ProBit Global WebSocket API communicates in JSON string.
Each single request messege should contain single valid JSON string.

WebSocket API entry point is wss://


In case of Demo API: wss://


Each key and string value of JSON string should be double-quoted("") and should not contain any line breaks.

import websocket from 'websocket';

const ws = new websocket.w3cwebsocket('wss://');

ws.onopen = () => {
  const msg = {
    type: 'subscribe',
    channel: 'marketdata',
    interval: 500,
    market_id: 'BTC-USDT',
    filter: ['ticker', 'order_books']

ws.onmessage = (event) => {


ProBit Global WebSocket API provides channels to subscribe.
You may subscribe multiple channels simultaneously which are listed below.

  • marketdata
  • exchange_rate
  • open_order (Authorization required)
  • trade_history (Authorization required)
  • order_history (Authorization required)
  • balance (Authorization required)

Use "type":"subscribe" or "type":"unsubscribe" message to subscribe or unsubscribe respectively and put channel name to subscribe with channel field.

Multiple requests in same channel updates the existing channel subscription. (In case of marketdata, refer Marketdata section)

Additional fields for each channel should be contained in the message which can be found in API Reference.



In order to subscribe channels which require authorization, the connection should be authorized with "type":"authorization" message. Specify access_token acquired by Authorization API in token field.

A single authorization could be used subscribing authorization required channels and remains until the end of the connection.

Refer API Reference to more information.


Marketdata Channel

For more information, see API Reference

marketdata is public channel which do not require authorization

If you subscribe to marketdata several times, you can subscribe or unsubscribe multiple times for each 'market_id'.
If you subscribe several times to one market, your subscription will change based on the latest message

The parameters required to subscribe to the marketdata channel are market_id, interval, filter

  • market_id: market ID to subscribe or unsubscribe
  • interval: Unit time to synchronize market information (ms)
    • Available units: 100, 500
  • filter: Information you want to receive from the market
    • ticker
    • recent_trades
    • order_books
      • order_books_l0 It does not apply aggregate view, aggregate view is provided in 4 steps
      • order_books_l1
      • order_books_l2
      • order_books_l3
      • order_books_l4