@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
@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
(kite3) 01:22 ~/tisha $ python kite3.py
Traceback (most recent call last):
File "kite3.py", line 6, in
print(kite.ltp("NSE:INFY"))
File "/home/Tisha1806/.virtualenvs/kite3/local/lib/python3.6/site-packages/kiteconnect/connect.py", line 571, in ltp
return self._get("market.quote.ltp", {"i": ins})
File "/home/Tisha1806/.virtualenvs/kite3/local/lib/python3.6/site-packages/kiteconnect/connect.py", line 693, in _get
return self._request(route, "GET", params)
File "/home/Tisha1806/.virtualenvs/kite3/local/lib/python3.6/site-packages/kiteconnect/connect.py", line 762, in _request
raise exp(data["message"], code=r.status_code)
kiteconnect.exceptions.TokenException: Incorrect `api_key` or `access_token
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
api_key=open('api_key.txt','r').read()
api_secret=open('api_secret.txt','r').read()
kite=KiteConnect(api_key=api_key)
kite.set_access_token(open('access_token.txt','r').read())
print(kite.ltp("NSE:INFY"))
Are you using Pi or NEST?
And access token through kite Zerodha
"https://kite.trade/?status=success&request_token=zhemy8jkwdp8dkedj3jgq3uaor7od8qt"
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.
You can have look at this thread.