Skip to Content
Connection

Unsubscribe

Send
/
Serverwss://streams.fast.onetrading.com

Send UNSUBSCRIBE with the names of the channels to leave. Unlike SUBSCRIBE, one message can name several channels. Unsubscribing from a market data channel drops all of its instruments. The server answers with one UNSUBSCRIBED per channel, or an UNSUBSCRIBE_ERROR for a channel it cannot unsubscribe, such as an unknown name.

Connection-level messages on the shared socket: authentication, generic subscribe and unsubscribe, heartbeats and errors.

Code Sample
const payload = {  "type": "UNSUBSCRIBE",  "channels": [    "ORDER_BOOK",    "PRICE_TICKS"  ]};const socket = new WebSocket("wss://streams.fast.onetrading.com/");socket.addEventListener("open", () => {  socket.send(JSON.stringify(payload));});

Messages

channels lists plain channel names, not the objects SUBSCRIBE takes. Unsubscribing from a market data channel drops all of its instruments; to keep some, subscribe to them again afterwards.

application/json
  1. payload
type*string
channels*array<>

The channels to leave, as plain channel names. Unlike SUBSCRIBE, several can be named in one message.

Items1 <= items
orderBookAndPriceTicks

Unsubscribe from ORDER_BOOK and PRICE_TICKS

{  "type": "UNSUBSCRIBE",  "channels": [    "ORDER_BOOK",    "PRICE_TICKS"  ]}

Reply

Receive

Sent back on the same channel.