Historical Data Error

I am consistently receiving a 400 Bad Request error when trying to fetch historical data for expired options contracts. I can successfully fetch the list of expired instruments, but the subsequent call for candle data fails.

Here is an example of the failing request URL: https://api.upstox.com/v2/expired-instruments/historical-candle/NSE_FO%7C40346%7C05-06-2025/60minute/2025-06-05/2025-06-05

Can someone let me know why this request is being rejected? Is there an issue with the instrument key format, the date range, or my account permissions?

your format for mentioning the timeframe seems wrong try with this format : https://api.upstox.com/v3/historical-candle/BSE_INDEX|SENSEX/minutes/5/2025-10-07/2025-10-07

Thank you for the help, it failed with this format as well

Hi @NEETU_34647727, Expired OHLC data is available only for the intervals listed below. Since you’re passing 60minute, you’re receiving a 400 error.

1minute, 3minute, 5minute, 15minute, 30minute and day

Refer for more details: Expired Historical Candle Data | Upstox Developer API