I was wanting to analyze NIFTY options data on some specific days but the contracts are no more active now. Is there a way I can retrieve or approximate expired instrument tokens to use the historical data API to get this data. Any help is greatly appreciated.
You can get intraday historical data for the active options contract. Historical data won't be available for the expired option contract. However, you can get the day-period data for futures using the continuous. Go through the documentation here.