Get Instrument Token of Required Trading Symbol for Websocket Ticker
Please follow the Video instructions and Download CSV File from this Particular Website https://api.kite.trade/instruments and name them as instruments.csv
import pandas as pd
import csv
exchange='NSE'
instruments=pd.read_csv('instruments.csv')
NSE=instruments[instruments['exchange'].str.match(exchange)]
symbol=pd.read_csv('symbol.csv',names=['tradingsymbol'])
for token in symbol['tradingsymbol']:
symbol=NSE[NSE['tradingsymbol']==token]
tradingsymbol=symbol['tradingsymbol'].to_string(index=False)
instrument_token=symbol['instrument_token'].to_string(index=False)
symbol_list=[tradingsymbol,instrument_token]
with open('tradingsymbol.csv','a') as csvfile:
wr=csv.writer(csvfile)
wr.writerow(symbol_list)