WebSocket JSON is the realtime companion for integrations that use REST and JSON tooling. It delivers selected live market and account events without changing the REST request-response workflow.
When to use JSON channels
Choose WebSocket JSON when:
- your integration already uses JSON models and tooling
- readable payloads are more important than compact binary encoding
- the required channel publishes a JSON variant
- you are building a custom client rather than an official SDK realtime client
JSON support is channel-specific. Some account and configuration streams are Protobuf-only.
Telling the variants apart
A stream that offers both encodings publishes them on separate channels. The Protobuf channel name
ends in :proto. Most JSON channel names have no suffix, such as public:spot:market:trades:<symbolId>. Order book deltas are the exception: their JSON channel ends
in :json, as in public:spot:orderbook:deltas:depth:<depth>:<symbolId>:json.
The realtime streams reference shows each documented stream's channel names, encodings, and payload schema. These streams publish a JSON variant:
- Market trades
- Account balances
- Ledger transfers
- User trade executions
- Trigger events
- Account lifecycle flow summaries and lifecycle flow detail
API key, API policy, address book, Subaccount, Subaccount policy, and trigger state updates publish Protobuf only. Order book, candle, and heatmap channels are listed on Realtime channels.
Channel implementation
Choose a JSON channel
Confirm that the required product stream publishes a JSON variant and use its exact channel name and schema.
Decode the channel payload
Validate each message against the channel's JSON contract. Do not infer a JSON shape from a Protobuf-only channel.
Event channels (market trades, your trades, ledger transfers, and trigger events) publish an ordered
array, {"events":[…]}, rather than a single object. Apply the event stream rules.
JSON channels carry enum values as their prefixed protobuf names, unlike REST. A trigger event
reads "eventType": "EVENT_CANCELED" and "cancelReason": "TRIGGER_CANCEL_REASON_USER_REQUEST" on
the trigger events channel, and "CANCELED" and "USER_REQUEST" from GET /v1/triggers/{trigger_id}/events. See Enum values. Market trades keep the REST
form: side is BUY or SELL.