Zerodha codebase error

hi team,i have just tried zerodha code base and its lots of error everywhere.some code are running fine but so many things are not running.error and error,

[tsl.get_long_term_hist_data(name: str, exchange: str, interval: str, length: int, oi: bool = False)](https://tsl.get_long_term_hist_data(name: str, exchange: str, interval: str, length: int, oi: bool = False))

[data = tsl.get_short_term_hist_data(name=“NIFTY25OCTFUT”, exchange=“NFO”, interval=“minute”, oi = True) ](https://data = tsl.get_short_term_hist_data(name=“NIFTY25OCTFUT”, exchange=“NFO”, interval=“minute”, oi = True) )

this is the error shown in debug console

data = tsl.get_short_term_hist_data(name=“NIFTY25OCTFUT”, exchange=“NFO”, interval=“minute”, oi = True)
‘NFO:NIFTY25OCTFUT’
Traceback (most recent call last):
File “c:\Users\SAURABH\AppData\Local\Programs\Python\Python312\Lib\site-packages\Zerodha_Tradehull\Zerodha_Tradehull.py”, line 223, in get_short_term_hist_data
instrument_token = self.kite.ltp(exchange+“:”+name)[exchange+“:”+name][‘instrument_token’]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: ‘NFO:NIFTY25OCTFUT’

i feel thath zerodha code base is not updated?kindly chek form your end beacuse i can see very less code library than dhan and its incomplete

please check and let me know

Hi @surabh88 ,

Itseems you have been calling the function for expired contract, the code is working fine, refer the below-

data = tsl.get_short_term_hist_data(name="NIFTY26APRFUT", exchange="NFO", interval="minute", oi = True)

Thanks mam. Will check for sure. My bad for not looking in the code itself.
Need to reread before posting

1 Like