i am using code example given in github sdk for retrieving historical candle data of expired option contracts but i am getting empty data
here is my code example
from future import print_function
import upstox_client
from upstox_client.rest import ApiException
from pprint import pprint
import pandas as pd
Configure OAuth2 access token for authorization: OAUTH2
configuration = upstox_client.Configuration()
configuration.access_token = ‘access token’ #from file in pc
create an instance of the API class
api_instance = upstox_client.ExpiredInstrumentApi(upstox_client.ApiClient(configuration))
expired_instrument_key = ‘NSE_FO|79830|24-04-2025’ # str | Expired Instrument Key of asset
interval = ‘day’ # str | Interval to get expired ohlc data
to_date = ‘2025-04-15’ # str | to date
from_date = ‘2025-04-01’ # str | from date
try:
# Expired Historical candle data
api_response = api_instance.get_expired_historical_candle_data(expired_instrument_key, interval, to_date, from_date)
pprint(api_response)
except ApiException as e:
print(“Exception when calling ExpiredInstrumentApi->get_expired_historical_candle_data: %s\n” % e)
the output is this
{‘data’: {‘candles’: [ ] }, ‘status’: ‘success’}
it works when is use get expired options contracts but doesnt work for expired historical candle