Skip to content

Choose a client ​

Use RestClient for individual requests and WebsocketClient for ongoing market and account updates. Both cover Spot and derivatives.

  • RestClient: public market data, authenticated account reads and order commands over REST.
  • WebsocketClient: public and private subscriptions, connection lifecycle events and low-level WebSocket API requests.
  • WebsocketAPIClient: promise-based order commands over WebSockets.

Combine REST requests and subscriptions ​

Use one long-lived REST client for your account and region. Start with getTicker(), then configure credentials for getBalance(). The same client covers Spot and derivatives: select the instrument and trading mode in each request rather than choosing a separate futures class.

Use WebsocketClient for ongoing prices and account state. It selects the public, private or business connection from the channel, signs private logins and restores subscriptions after reconnects. After a disconnect, use REST to recover changes missed by the stream.

Send WebSocket API requests ​

Use await and try/catch just as you would with a REST API call. The SDK matches responses to requests and manages the WebSocket connection for you. Requests over a persistent WebSocket can offer lower overhead and latency, depending on the exchange, network and workload.

WebsocketAPIClient exposes methods such as submitNewOrder(), amendOrder() and cancelOrder(). Use the private orders subscription to follow fills and other order changes after a command is accepted.

New applications should use WebsocketClient, not the exported legacy client. See WebSocket API requests for the request and response differences.

Built by Siebly. Open source SDKs for exchange APIs.