Historical data download of expired contract (Error 400 Ambiguous URI empty segment)

Hi, can anyone explain what should be valid input parameters to download Historical data ?

Attached postman screenshot

Below is curl command which throwing error:
curl --location ‘https://api.upstox.com/v3//historical-candle/NSE_FO|62316|31-07-2025/minutes/1/2025-07-31/2025-07-01’
–header ‘Api-Version: 2.0’
–header ‘Accept: application/json’
–header ‘Authorization: mytoken’

Able to retrieved the expired contracts

1 - Error is coming when I am trying to download historical data of a expired contract, any idea what is incorrect ?

2- how can I give range of approx 90 days of a derivative contract as a equity contract can be traded for 90 days

Thanks

@Ketan @Ketan_Gupta @Pradeep_Jaiswar any input on above issue

The previous error is rectified, now I am getting error ‘Instrument key is of invalid format‘

1- first I retrieved the instrument token, attached image below:

2- then I tried one of the instrument in historical-API and got error “Instrument key is of invalid format“ although I entered the key which provided by api.

please check and assist.

@RAM_KRISHN_1864028 It looks like the /expired-instruments part is missing in your URL.

Please refer to the example code for guidance.

1 Like