General exception raised in Historical data API access

krishnakant
Hi,

I am receiving this General Exception - missing api key quite frequently and randomly. The API calls work for the first few times and then throws this error. Please help me in resolving this.

kiteconnect.exceptions.GeneralException: Missing api_key
  • sujith
    @krishnakant,
    As the error says, you are not sending api key. All the HTTP calls to Kite Connect are authenticated using api key and access token.
  • krishnakant
    @sujith

    In my Python code, I create a 'kite' object with the api_key and then make API calls using that object throughout. It works for some calls but fails for others. I think something else is the issue.

    kite = KiteConnect(api_key=my_api_key)
    kite.set_access_token(my_access_token)

    # API Calls using the historical_data() function

    What else could be causing this error? Can the same object be used to make multiple calls?
Sign In or Register to comment.