def token_lookup(ticker, exchange='NSE'):
for i in instrument_list:
if i['symbol'] == ticker and i['exch_seg'] == exchange:# and i['symbol'].split('-')[-1] == 'EQ':
return i['token']
token_lookup('NIFTY50')
def symbol_lookup(token, exchange='NSE'):
for i in instrument_list:
if i['token'] == token and i['exch_seg'] == exchange and i['symbol'].split('-')[-1] == 'EQ':
return i['name']
@mdzainj you can check the API details on the SmartAPI documentation, an alternate workaround that you asked for would be using websocket 2.0 for your use case.