WebSocket

Public WebSocket

Upgrade to a WebSocket connection for real-time public market data.

Public WebSocket streams do not require authentication.

Subscribe

{"action":"subscribe","channel":"ticker","market":"BTCZAR"}
{"action":"subscribe","channel":"orderbook","market":"BTCZAR","limit":10}
{"action":"subscribe","channel":"trades","market":"BTCZAR"}

Unsubscribe

{"action":"unsubscribe","channel":"ticker","market":"BTCZAR"}

Client message fields

FieldTypeDescription
actionstringsubscribe or unsubscribe.
channelstringticker, orderbook, or trades.
marketstringMarket symbol, for example BTCZAR.
limitintegerOrder book depth. Applies to orderbook only. Default 50, maximum 200.

Server frames

{"channel":"subscribed","market":"BTCZAR","subscription":"ticker"}
{"channel":"ticker","market":"BTCZAR","data":{}}
{"channel":"orderbook","market":"BTCZAR","data":{}}
{"channel":"trades","market":"BTCZAR","data":[]}
{"channel":"error","message":"..."}

Poll intervals

ChannelInterval
ticker1 second
orderbook500 milliseconds
trades1 second

Frames are only pushed when data changes. The server sends a WebSocket ping every 45 seconds. Clients must respond with a pong within 60 seconds or the connection is closed.

get/ws

Changes