Following the below steps: created a new app at https://developers.kite.trade/apps obtained the `API key` from the app details page obtained the `API secret` from the app details page
called the instrument API -> working fine called the quote or quote ohlc API -> giving API key error called the historic API -> giving API key error
have regenerated the API secret as well. Am I missing anything?
ok, do I need to go through the login flow even when I just want to use the quote and historic API for my script? I don't have any requirements related to order or any other API?
ok, thank you so much. One last question, once I get the access token, will it expire or I can use the same one daily. The reason why I am asking this because I just want to run the API script daily and if it will expire automatically, I will have to keep on updating the request token manually. Pls suggest
tried it with your official python lib as well, the error is same i.e kiteconnect.exceptions.TokenException: Token is invalid or has expired.
this is the debug log: DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443 DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /session/token HTTP/1.1" 403 None Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.9/site-packages/kiteconnect/connect.py", line 257, in generate_session resp = self._post("api.token", params={ File "/usr/local/lib/python3.9/site-packages/kiteconnect/connect.py", line 840, in _post return self._request(route, "POST", url_args=url_args, params=params, is_json=is_json, query_params=query_params) File "/usr/local/lib/python3.9/site-packages/kiteconnect/connect.py", line 912, in _request raise exp(data["message"], code=r.status_code)
" -H 'Authorization: token api_key:api_secret
I cannot find anywhere in the documentation to generate API token separately?
{"status":"error","message":"Token is invalid or has expired.","data":null,"error_type":"TokenException"}
I am using following command to generate sha256:
Digest::SHA256.hexdigest(@api_key + @request_token + @api_secret)
this is the debug log:
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443
DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /session/token HTTP/1.1" 403 None
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.9/site-packages/kiteconnect/connect.py", line 257, in generate_session
resp = self._post("api.token", params={
File "/usr/local/lib/python3.9/site-packages/kiteconnect/connect.py", line 840, in _post
return self._request(route, "POST", url_args=url_args, params=params, is_json=is_json, query_params=query_params)
File "/usr/local/lib/python3.9/site-packages/kiteconnect/connect.py", line 912, in _request
raise exp(data["message"], code=r.status_code)