While I am trying to get historic data with the below code: it is giving error . The error is also appended below records = kite.historical_data(token,from_date =from_dt,to_date = to_dt,interval=interval)
Error: kiteconnect.exceptions.InputException: Invalid `api_key` or `access_token`.
I have checked and my api_key is correct and historic data dont need access token as a parameter. What could be the reason. My I have subscribed to Historic data as an add-on
Hi Sujit, shall I send you the entire code for my historical data extraction to your personal mail. Can you help me.. My phone / whatsapp number is 7606057921
@vpkartha, We don't provide support for writing code. The pykiteconnect is a stable library that is being used in production on many of our platforms and third-party users as well. We don't see any issue from our end. According to the above debug logs, the issue seems to be happening from place order, and in the above code product value being sent is wrong. Your debug logs and the error description doesn't match. You need to debug code at your end.
kite.holdings()
I tried tp get the margin. Same error
Did you generate a new access token after subscribing to historical data API?
C:\Users\DELL\Desktop\Python Files>py getaccesstoken.py
Generate Access Token : https://kite.trade/connect/login?api_key=58w567phg1riwrq5&v=3
[+])Enter your request token here :bmmKd7ysC2mjXa6NVxtKqqvKR023WFqMN4
R0liGCeuKy505B1GSta135ePHcPrR4i
DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /orders/regular HTTP/1.1" 400 109
Traceback (most recent call last):
File "C:\Users\DELL\Desktop\Python Files\import logging.py", line 18, in
order_id = kite.place_order(tradingsymbol="INFY",
File "C:\Users\DELL\AppData\Roaming\Python\Python38\site-packages\kiteconnect\connect.py", line 346, in place_order
return self._post("order.place", params)["order_id"]
File "C:\Users\DELL\AppData\Roaming\Python\Python38\site-packages\kiteconnect\connect.py", line 821, in _post
return self._request(route, "POST", params)
File "C:\Users\DELL\AppData\Roaming\Python\Python38\site-packages\kiteconnect\connect.py", line 886, in _request
raise exp(data["message"], code=r.status_code)
kiteconnect.exceptions.InputException: Invalid `api_key` or `access_token`.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\DELL\Desktop\Python Files\import logging.py", line 28, in
logging.info("Order placement failed: {}".format(e.message))
AttributeError: 'InputException' object has no attribute 'message'
[Finished in 1.3s]
api_secret : xxxxxxxxxxxxxxxxxxxxx
access_token : xxxxxxxxxxxxxxxxxx
I have masked the actual keys
We don't provide support for writing code. The pykiteconnect is a stable library that is being used in production on many of our platforms and third-party users as well.
We don't see any issue from our end.
According to the above debug logs, the issue seems to be happening from place order, and in the above code product value being sent is wrong.
Your debug logs and the error description doesn't match. You need to debug code at your end.