I have created valid access token. If i try to get LTP for a stock; i get correct value returned. However when i use same access token to get historical data; I get error as InvalidToken. My app is valid, subscription is also active; still i face the error. Refer the code below. What am i missing -
try: data = kite.historical_data(instrument_token, start_date, end_date, "5minute") except Exception as e: print("❌ Historical API error:", str(e))
Here the error is Invalid token. Any help would be appreciated.