nifty = [i for i in instruments if i["name"] == "NIFTY 50"] banknifty = [i for i in instruments if i["name"] == "NIFTY BANK"] print(nifty) print(banknifty) nifty_token = nifty[0]["instrument_token"] banknifty_token = banknifty[0]["instrument_token"]
This is my code , which is just a small snippet , i just wanted to confirm that how come we use both representations (either passing a token or hardcoding a symbol is working ) , like in the github repo i saw that it is mentioned to use instrument symbol exchange:Trading symbol then how tokens do work ? also is there a method that gives us the exchange:trading symbol rather than hardcoding one ?
Kite Connect supports both instrument_token and Exchange: Tradingsymbol representations, but they are not interchangeable across all endpoints. The Exchange: Tradingsymbol format is a convenience alias supported only in quote-type APIs (quote, ltp, ohlc), where it is internally resolved to the instrument token. instrument_token is the primary identifier used for historical data and WebSocket subscriptions. There is no separate API to fetch Exchange: Tradingsymbol; it must be derived from the instruments dump file (exchange + tradingsymbol). You may refer to the similar discussion here.
Exchange: Tradingsymbolrepresentations, but they are not interchangeable across all endpoints. TheExchange: Tradingsymbolformat is a convenience alias supported only in quote-type APIs (quote, ltp, ohlc), where it is internally resolved to the instrument token.instrument_tokenis the primary identifier used for historical data and WebSocket subscriptions.There is no separate API to fetch
Exchange: Tradingsymbol; it must be derived from the instruments dump file (exchange + tradingsymbol).You may refer to the similar discussion here.