I had made the payment for fetching historical and current market data. however i am getting Insufficient permission error. i am using pykiteconnect. i had used the invalidate_access_token multiple times, still issue persists.
below python code used: import os from config import Myapi_key, Myapi_secret from kiteconnect import KiteConnect import json from datetime import datetime import logging
try: logging.basicConfig(level=logging.DEBUG) kite_api_key = Myapi_key kite_api_secret = Myapi_secret kite = KiteConnect(api_key=kite_api_key) print("INFO --Getting Access Token --") if os.path.exists(f"AccessToken/{datetime.now().date()}.json"): with open(f"AccessToken/{datetime.now().date()}.json","r") as f: access_token = json.load(f) kite.set_access_token(access_token) #data = kite.invalidate_access_token(access_token) #orders = kite.orders() #print(orders) ltp= kite.ltp('NSE:ETERNAL') print("LTP of ETERNAL is: ", ltp['NSE:ETERNAL']['last_price']) data = kite.quote('NSE:ETERNAL') print(data)
else: print("Access Token -access token not found for today. generate it. ",True) logging.info("Order placement failed: {}".format(e))
except Exception as e: logging.info("Error: {}".format(e)) exit()
Error received: INFO --Getting Access Token -- DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443 DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "GET /quote/ltp?i=NSE%3AETERNAL HTTP/1.1" 403 None INFO:root:Error: Insufficient permission for that call.
If you have created multiple apps, please ensure that you're using the API key and access token for the Connect app (paid version), rather than the Personal app (free version). This issue typically arises when the credentials from the Personal app are used instead, or your Kite Connect subscription has expired.
It looks like you have created the personal app instead of the paid version. You can create a Connect app using the free credits available and try the same.
Users can create multiple apps for multiple strategies if they want. The developers account doesn't restrict number of apps. You may create new Kite Connect app and delete personal app if not required.