About the Developer API category

I want Upstox to:

  1. Automatically open the chart of :

    • The highest gainer,and

    • The highest loser,
      in real-time from a specific watchlist, index (like Nifty 50), or market.

  2. Continuously monitor in real-time, and:

    • Switch the chart if the highest gainer/loser changes,

    • So I can

    • always viewing the chart of the current top gainer or loser.

Searched here and there and got to know that there is an HFT endpoint we can use to reduce latency, but not sure if we can place multi order with the hft endpoint and if we can what url should we use https://api-hft.upstox.com/v2/order/multi/place does this url work ?

Hi @Sushma_50979572 Correct — HFT is applicable only for the Place, Modify, and Cancel Order APIs. The Place Multi Order API does not have an HFT endpoint.

I tried getting historical data but kept getting an error both with v2 and v3 apis. Can someone suggest if v3 is the correct api version to use for all api communications?
Historical candle data
Intraday candle data
Live feed to get alerts
Placing order

Hi @Shubham_51538267, Yes, V3 is the correct version for all the APIs you mentioned.

Please share the error message you’re receiving so we can look into it further.

Thanks

Sure, below are the errors when trying to get historical candle data and live market quotes.

— Verifying Real Live Data Fetching —
UpstoxClient is authenticated. Proceeding with live data fetch tests.
[Upstox Client] Fetching live market data (latest 1-min candle) for NSE_INDEX|Nifty 50 from https://api.upstox.com/v3/market-quote/ohlc with params: {‘instrumentKey’: ‘NSE_INDEX|Nifty 50’, ‘interval’: ‘1minute’}
[Upstox Client] Error fetching live market data via API (V3 market-quote/ohlc): 400 Client Error: Bad Request for url: https://api.upstox.com/v3/market-quote/ohlc?instrumentKey=NSE_INDEX|Nifty+50&interval=1minute

Failed to fetch live Nifty 50 Spot data for NSE_INDEX|Nifty 50.
[Upstox Client] Fetching live option quote for NSE_FO|52759 from https://api.upstox.com/v2/market-quote/quotes with params: {‘instrumentKey’: ‘NSE_FO|52759’}
[Upstox Client] Error fetching live option quote via API: 400 Client Error: Bad Request for url: https://api.upstox.com/v2/market-quote/quotes?instrumentKey=NSE_FO|52759

Failed to fetch live Nifty 50 Weekly Call Option quote for NSE_FO|52759.

FYI: I am trying to get this data for Sensex/Nifty 50 weekly expiry options. Additionally please suggest the correct instrument keys for these.
Thanks in advance

Hi @Shubham_51538267, It seems the query parameter you’re using is incorrect. Please try the URL below — it should work. Thanks!

https://api.upstox.com/v2/market-quote/quotes?instrument_key=NSE_FO|52759

Thanks for the previous answers. I am facing a handshake error and issue in getting live data from websocket even when the connection is successful.

FYI I am trying to subscribe for Nifty 50 live data and below is the error I see:
DEBUG: Auth Response:{“status”:“success”,“data”:{“authorizedRedirectUri”:“wss://wsfeeder-api.upstox.com/market-data-feeder/v3/upstox-developer-api/feeds?requestId=1d7axxxxxxxxxxxxxxxxxxxxxxxxxxx”,“authorized_redirect_uri”:“wss://wsfeeder-api.upstox.com/market-data-feeder/v3/upstox-developer-api/feeds?requestId=1d7axxxxxxxxxxxxxxxxxxxxxxxxx”}}
DEBUG: Current WebSocket URL obtained: wss://wsfeeder-api.upstox.com/market-data-feeder/v3/upstox-developer-api/feeds?requestId=1d7a1d43-8d

INFO: Connecting to:wss://wsfeeder-api.upstox.com/market-data-feeder/v3/upstox-developer-api/feeds?requestId=1d7axxxxxxxxxxxxxxxxxxxxxxx
ERROR:root:WebSocket ERROR: Handshake status 403 Forbidden -±± {‘date’: ‘Fri, 05 Dec 2025 14:05:03 GMT’, ‘transfer-encoding’: ‘chunked’, ‘connection’: ‘keep-alive’} -±± None
ERROR:websocket:Handshake status 403 Forbidden -±± {‘date’: ‘Fri, 05 Dec 2025 14:05:03 GMT’, ‘transfer-encoding’: ‘chunked’, ‘connection’: ‘keep-alive’} -±± None - goodbye
ERROR: WebSocket ERROR: Handshake status 403 Forbidden -±± {‘date’: ‘Fri, 05 Dec 2025 14:05:03 GMT’, ‘transfer-encoding’: ‘chunked’, ‘connection’: ‘keep-alive’} -±± None
INFO: WebSocket CLOSED. Code: None, Reason: None

@Shubham_51538267

Hello. How to connect to websocket. I’ve extracted the instrument key. What to do next. Ill be grateful for any guidance :folded_hands: