Historical Candle API returns bad request error And Instrument Key

  1. I am getting Bad Request error when tried to retrieve data using following values
    BANKNIFTY230CT38500CE InstrumentKey as “NSE_FO|52619”;
    interval as"1minute";
    ToDate as “2023-10-26”;
    FromDate as “2023-10-25”;

  2. How to get expired Instrument keys for the year 2023, 2022? What is the use of Historical Candle Api when previous year instruments keys are unknown?. I can see only latest instrument keys in NSE.csv provide by upstock.c

  1. Could you provide the sample curl request you’re using to retrieve the BANKNIFTY230CT38500CE data?
  2. Data on expired contracts is on our development roadmap. Currently, I don’t have an estimated time of arrival, but we will inform you when we start considering it for development.

Please check request and response below
curl -L -X GET ‘https://api.upstox.com/v2/historical-candle/NSE_FO|52619/1minute/2023-10-25/2023-10-25
-H ‘Accept: application/json’

curl response

{
“status”: “error”,
“errors”: [{
“errorCode”: “UDAPI100011”,
“message”: “Invalid Instrument key”,
“propertyPath”: null,
“invalidValue”: null,
“error_code”: “UDAPI100011”,
“property_path”: null,
“invalid_value”: null
}]
}

Got Bad request error when used upstock sdk

  1. Data on expired contracts is on our development roadmap. Currently, I don’t have an estimated time of arrival, but we will inform you when we start considering it for development.

    But as per documentation user can view past data also.
    Historical Candle Data | Upstox Developer API

I missed the details in the earlier thread. Data on expired contracts is not accessible via API. The historical data referenced in the documentation pertains to equity (for the previous years) and contracts that are currently active. We plan to revise the documentation to include this information, ensuring it is clear to users.

As said, data on expired contracts is on our development roadmap. Currently, I don’t have an estimated time of arrival, but we will inform you when we start considering it for development.

Is there any other means where the expired contract prices can be fetched?
I reached this thread, post getting errors for expired contracts historical data fetch.
For backtesting intraday option trading strategies, it becomes a bit of blocker, if we don’t have the ability to trace the movement for the expired contracts. Any particular reason why this is not exposed as of now?