WebSocket
Introduction
Real-time data streaming via WebSocket API
Overview
WebSocket endpoints are available for real-time data streaming and as an alternative to HTTP request sending on the ChainStream exchange. The WebSocket URLs by network are:
- Mainnet:
wss://realtime-dex.chainstream.io/connection/websocket
Connecting
To connect to the WebSocket API, you must establish a WebSocket connection to the respective URL based on your desired network. Once connected, you can start sending subscription messages to receive real-time data updates.
Command Line Example
Using wscat
to test the connection:
This documentation uses TypeScript for defining message types. For Python users, you can find equivalent types in our Python SDK.
Was this page helpful?