It looks like you're new here. If you want to get involved, click one of these buttons!
Traceback (most recent call last):
File "openko_functions.py", line 28, in <module>
print kite.quote("NSE","RELIANCE")
File "C:\Program Files (x86)\Python27\lib\site-packages\kiteconnect\__init__.py", line 501, in quote
return self._get("market.quote", {"exchange": exchange, "tradingsymbol": tradingsymbol})
File "C:\Program Files (x86)\Python27\lib\site-packages\kiteconnect\__init__.py", line 577, in _get
return self._request(route, "GET", params)
File "C:\Program Files (x86)\Python27\lib\site-packages\kiteconnect\__init__.py", line 668, in _request
raise(exp(data["message"], code=r.status_code))
kiteconnect.exceptions.TokenException: Invalid token
-----
#!python
from kiteconnect import KiteConnect
import raz_tokens
# Initialise.
my_api_key = raz_tokens.api_key
my_access_token = raz_tokens.access_token
kite = KiteConnect(api_key = my_api_key, access_token = my_access_token)
kite.set_access_token(my_access_token)
rel_quote = kite.quote("NSE","RELIANCE")
print rel_quote
print kite.positions()
------
Do update if there is a problem with the quote api for python client. I read another discussion where
get_quote
was causing a problem since 26th Sep. Not sure if these two are related. Do update.Thanks
Ravi
Can you update here? Is this still now resolved - quote api in python
I think you need to create a new session when it happens.
Quote and positions are from the source.
Don't use PI or NEST for monitoring, use Kite for monitoring purpose. If you log out from any platform then also this can happen.