incorrect api key or access token

While running python coding, I am getting following error: Can anybody help me?

kiteconnect.exceptions.TokenException: Incorrect `api_key` or `access_token`.
  • sujith
    Your access token might be expired. You need to fetch new access token.
  • Ashok121
    I generated new access token 2 mins back and still getting same below problem while running python coding.

    (kite3) 01:22 ~/tisha $ python
    Traceback (most recent call last):
    File "", line 6, in
    File "/home/Tisha1806/.virtualenvs/kite3/local/lib/python3.6/site-packages/kiteconnect/", line 571, in ltp
    return self._get("market.quote.ltp", {"i": ins})
    File "/home/Tisha1806/.virtualenvs/kite3/local/lib/python3.6/site-packages/kiteconnect/", line 693, in _get
    return self._request(route, "GET", params)
    File "/home/Tisha1806/.virtualenvs/kite3/local/lib/python3.6/site-packages/kiteconnect/", line 762, in _request
    raise exp(data["message"], code=r.status_code)
    kiteconnect.exceptions.TokenException: Incorrect `api_key` or `access_token
  • Ashok121
    Dear Sujith,

    For your information, I am running below python coding when I get above problem: let me know any issue of coding in that.

    from kiteconnect import KiteConnect
  • sujith
    Are you using Pi or NEST?
  • Ashok121
    I am running code through python 3.6 on
    And access token through kite Zerodha
  • Ashok121
    does access and request token are different?

    I am using above request token as access token in python coding.

    If access and request token is not same. let me know how to generate access token.
  • piyushgarg2323
    piyushgarg2323 edited August 3
    @sujith - I am facing the same error. I am using the right access token. have confirmed it multiple times. I am using Pi. Kindly suggest a way out here
  • indiatechpython
    @sujit - need your guidance and recommendation for hosting server where kiteconnet API works fine. Was thinking to host my Python application at pythonanywhere but seek your guidance or recommendations if any other server
Sign In or Register to comment.