Connecting to Spot WebSockets
Public market-data sockets for spot use Socket.IO v4 with multiplexed namespaces — one connection, many exchanges via different namespaces.
Connection details
| Type | Socket.IO |
| Version | v4 |
| Base URL | wss://ws.coinswitch.co/ |
| Handshake path | /pro/realtime-rates-socket/spot/{exchange} |
{exchange} in the handshake path is one of coinswitchx, c2c1, c2c2 (case-insensitive).
Namespaces
Each exchange is a separate Socket.IO namespace on the same connection:
| Exchange | Namespace |
|---|---|
coinswitchx | /coinswitchx |
c2c1 | /c2c1 |
c2c2 | /c2c2 |
To stream data from multiple exchanges in one application, connect to multiple namespaces on the same socket.
Subscription protocol
Each event (Order Book, Candlestick, Trades) follows the same shape:
- Connect to the namespace.
emitthe event name with asubscribepayload that includes the symbol you care about (inBASE,QUOTEformat — note the comma, not slash).- The server pushes updates back on the same event name.
The symbol convention for socket subscriptions is BASE,QUOTE (e.g. BTC,INR, BTC,USDT). REST endpoints use BASE/QUOTE — these are different on purpose.
Authentication
Public market-data sockets are unauthenticated — anyone with the URL can subscribe.
User-data sockets (Order Updates, Balance Updates) are authenticated. They use a different handshake path and namespace and require your API key on the subscribe payload.
Next
- Order Book — real-time depth snapshots
- Candlestick — 1-minute candles
- Trades — real-time trade prints
- Order Updates — your own order state changes (authenticated)
- Balance Updates — your own wallet balance changes (authenticated)