Web Socket connection

Ninja2020
Dear Friends,

I am analysing Bank Nifty, Nifty and some stocks with Python REST historic API .
I am planning to switch my code to Web socket development. I have few clarification on web socket.
1. Do we receive real time data faster from Exchange then historic data.
2. Can we disconnect Web socket after every retrieval so that we i can use more 3 Web sockets.
3. Do each retrieval of data consider as one request . I am getting error like "too many request " in REST Api after few hours of execution.

Thanks
  • rakeshr
    Do we receive real time data faster from Exchange then historic data.
    We stream WebSocket data, as we get from it exchange. You can go through this thread to know more. In the case of WebSocket streaming, one major benefit you have is you can stream up to 3000 scrips in a single WebSocket connection.
    Can we disconnect Web socket after every retrieval so that we i can use more 3 Web sockets.
    You can parallelly run up to 3 Websocket connection(for 1 API key). You don't need to disconnect after every fetch. Just make sure, you are not exceeding cap of max 3 websocket connection per API key.
    Do each retrieval of data consider as one request . I am getting error like "too many request " in REST Api after few hours of execution.
    Yes, each API request you make is considered as one request.
Sign In or Register to comment.