Upstox Websocket Questions

Hello Everyone,

I’m trying to move my algo from Zerodha to Upstox. Few Questions on the Upstox API Websocket, can you please provide answers.

  1. What is the maximum number of instrument keys that I can subscribe using the websocket market feed Url? Zerodha’s kite API supports 3000 instrument keys in 1 connection?
    2). Say if maximum is 500 keys and to be subscribed in batches of 100 keys, how will I get the response? All 500 in one data packet ? or 5 different data packets? Here by data packets I mean the data in the following script.
ws.on("message", (data) => {console.log(JSON.stringify(decodeProfobuf(data)))})
  1. How reliable is the websocket connection? What is the frequency of disconnections? If a disconnect happens do I have to subscribe to all the tokens again?

Thank you.

@Pradeep_Jaiswar Tagging you for response

Hi @andiamvinay,

Few pointers as response to your queries

  1. Websocket is reliable. You can check status of Upstox wide services here -
  2. You can subscribe to 100 instrument keys as per official documentation. But depending on different modes, you can get more instruments subscribed depending on the size of data.
  3. We are working on improving the WebSocket and number of connections and scale it up considerably. We will inform the API community once we have an update on that.
  4. All data come in a single data packet

You can check Python implementation of the websocket here - Sample Implementation | Upstox Developer API

Hope this helps.

Thank you for your response