unable to get tick data error is "ERROR:kiteconnect.ticker:Connection error: 1006

rjamitsharm
what is going wrong here in my code please tell me
import logging
from kiteconnect import KiteTicker

logging.basicConfig(level=logging.DEBUG)

kws = KiteTicker(api, token) // api is my api key and token is token got from url after login

def on_ticks(ws, ticks):
logging.debug("Ticks: {}".format(ticks))

def on_connect(ws, response):
ws.subscribe([738561, 5633])
ws.set_mode(ws.MODE_FULL, [738561])

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()
when i run this it shows error like "ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (403 - Forbidden))"

please help me
Tagged:
  • sujith
    The token you receive after logging in is the request token. You need to send an access token while connecting Kite Ticker.
    You can know more here.
Sign In or Register to comment.