Skip to main content

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

TypeSocket.IO
Versionv4
Base URLwss://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:

ExchangeNamespace
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:

  1. Connect to the namespace.
  2. emit the event name with a subscribe payload that includes the symbol you care about (in BASE,QUOTE format — note the comma, not slash).
  3. 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