Websocket failed after sometime

Could you please share the code you’re using to connect to the WebSocket? Are you using our Python SDK?

If not, we recommend checking it out for a quicker and easier implementation:

thanks pradeep sir and i will check and do let u know i donot know the technical terms, i have two algo that are absolutely running great in other brokers terminal. I just want to ask you can you just simply say: let say i want to run algo on ATM option strike only with and for that i need OI data and OI change data delta vega gamma along with this, i need historical data from current candle to atleast 100 backcandle in 30 min timeframe so that i will calculate indicator vwap and ichimoko cloud and other indicator aslso and then i can apply multiple condition on it. I will also need live data that will be merge with historical data so that the indicator calculation and option chain parameter can be calculated for multiple timeframe . Kindly guide.

For ATM Option Strike(s) use the Option Chain REST endpoint:

GET /option-chain?instrument_key={underlying}&expiry_date=YYYY-MM-DD

  • Returns all strikes (calls + puts) with OI, previous OI, Greeks (vega, gamma, delta, theta, iv)
  • From this data, pick the strike(s) where the strike_price ≈ current underlying spot.

For candle data, please use the latest v3 APIs for both historical and intraday timeframes:

To access real-time market data, you’ll need to subscribe using the v3 WebSocket API:

We recommend using the official Upstox Python SDK for seamless integration.

For reference, you can check out the WebSocket code snippet here.