Live Data of more than 10000 instruments using web sockets

Nandu
I want to subscribe to ~10000 instruments but don't need continuous streaming data just wanted live data whenever I run the script.Im currently using the HTTP call kite.quote but because of the 500 instrument limit it takes more than a minute and the price changes.......Is there a possibility to run the websockets in a similar way...Chunk 10000 instrument list into 3000,3000,3000 and 1000 and run it in a loop?
  • tonystark
    There is a limit of 3000 subscriptions at a time in WebSockets. So you will have to unsubscribe them before subscribing to next 3000 instruments.
  • Nandu
    Could you please post a code snippet on how to do this it would be really helpful
  • rakeshr
    @Nandu
    Is there a possibility to run the websockets in a similar way...Chunk 10000 instrument list into 3000,3000,3000 and 1000 and run it in a loop?
    Yes, you can use WebSocket to fetch tick data for 10000 scrips in 4 different threads(not in loop) with the same API key. Maximum instrument subscription allowed per thread is 3000.
    But make sure, you don't block on_tick thread while writing tick data to database or excel.
  • Nandu
    @rakeshr Thank you for your prompt reply will try this out....Also can this be scaled even higher?..Suppose I need 20000 instruments then can I run 7 threads?
  • krtrader
    Hi @rakeshr ,

    How many instruments allowed to be subscribed per websocket?
    and how many websockets allowed per api account?
  • rakeshr
    rakeshr edited January 2019
    @krtrader
    How many instruments allowed to be subscribed per WebSocket?
    Max 3000 instrument subscriptions can be done in a single WebSocket connection. We have a soft limit of 3 WebSocket connection per API Account.
  • krtrader
    Official document suggest 1000 instruments in single websocket. Please update it or have thread which gives latest updates on api rate limits
Sign In or Register to comment.