The Order & Position Streaming API provides real-time streaming updates for:
The API uses a secure WebSocket (wss://) connection and pushes updates instantly whenever state changes occur in the trading system.
This API eliminates the need for polling and ensures low-latency state synchronization.
wss://<baseurl>/realtime
Replace <baseurl> with the value returned from the /tradeApiValidate API.
Example:
wss://e21.kotaksecurities.com/realtime
const ws =newWebSocket(`wss://${baseurl}/realtime`);
Immediately after onopen, send authentication string:
{type:cn,Authorization:<token>,Sid:<sid>,src:WEB}