Overview

How to use the generated Spot Trading WebSocket reference on this site.

The WS reference documents every channel and command of the Spot Trading WebSocket, generated from its AsyncAPI specification. Each page is one channel or one command: how to subscribe, the updates it sends and how to unsubscribe, or the request and its responses, with the fields of every message and examples.

SectionWhat it is
GeneralAuthenticate a connection, and the errors the server may send at any time
Market DataOrder book and public trades of a market. No authentication needed
TradingCreate and cancel orders, one by one or in batch, and the kill switch, and follow your orders, trades and executions. Needs an authenticated connection
FundingYour balance and working capital. Needs an authenticated connection

Connection

URL: wss://ws.bit2me.com/v1/trading. Every message is a JSON text frame with an event (subscribe, add-order…).

The server pings the connection every 20 seconds and closes it when no pong arrives within 10 seconds. WebSocket clients answer pings on their own.

Authentication

Public channels need no authentication. For private channels and order commands, get a token with POST /v1/signin/apikey, signed with your API key, and send it on the socket with authenticate within 1 minute, the token's lifetime. The connection stays authenticated after the token expires.

Limits and errors

Connections and messages are limited per IP, and each command has its own limit per connection: reaching one closes the connection. See WebSocket rate limits. Order error codes are on Errors.

Samples

Official samples: trading-spot-samples (node/auth/ws.js, node/ws/{public,private}).

This socket is not the notification socket of the gateway. Notifications (wallet, KYC, teller) are on Wallet → Notifications.

On this page