It looks like you're new here. If you want to get involved, click one of these buttons!
sub_list=[738561, 5633]
from kiteconnect import KiteTicker
kws = KiteTicker(api, access_token)
def on_ticks(ws, ticks):
print(ticks)
def on_connect(ws, response):
ws.subscribe(sub_list)
ws.set_mode(ws.MODE_FULL, sub_list)
def on_close(ws, code, reason):
ws.stop()
kws.on_ticks = on_ticks
kws.on_connect = on_connect
kws.on_close = on_close
kws.connect()
in this I have subscribed to two tickers for live data
You can go through Websocket Python client FAQs with thread to Websocket subscription in real-time.