Histroical OI and Expiry Related - Not able to fetch the data

Hello Upstox API Team,

I am trying to use the /v2/historical-candle/expired/ API endpoint to download historical data for expired options contracts, as per your documentation.

However, every request I make returns a 404 Resource not Found error, even for valid, recently expired contracts.

For example, when I make a GET request to the following URL for the NIFTY 22250 PE 12 JUN 25 contract (instrument key NSE_FO|44719|12-06-2025):

https://api.upstox.com/v2/historical-candle/expired/NSE_FO|44719|12-06-2025/5minute/2025-06-11/2025-06-11

The server responds with a 404 status and the following JSON body:

JSON{ "status": "error", "errors": [ { "errorCode": "UDAPI100060", "message": "Resource not Found." } ] }

This happens for every day I request data for this contract. Could you please confirm if this endpoint is live and if historical candle data for expired options is currently available?

Thank you.

You’re currently using the incorrect URL. The correct endpoint for the v2 API is:

https://api.upstox.com/v2/historical-candle/

However, we recommend switching to the new v3 API, which supports a wider range of intervals.

You can refer to the example code and documentation here: