After successfully login to kite using access_token. I have tried getting the list of instruments for "NSE". I have got the below exception: print(kite.instruments(exchange="NSE"))
I want to get the list of Nifty stock futures listed NSE and the lot size of the each stock future. Please give me sample code to get ?
Warning (from warnings module): File "C:\Users\tannirus\AppData\Local\Programs\Python\Python35\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 821 InsecureRequestWarning) InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html Exception in thread Thread-1: Traceback (most recent call last): File "C:\Users\tannirus\AppData\Local\Programs\Python\Python35\lib\threading.py", line 914, in _bootstrap_inner self.run() File "C:\Users\tannirus\AppData\Local\Programs\Python\Python35\lib\threading.py", line 862, in run self._target(*self._args, **self._kwargs) File "C:\personal\kiteAPI\kitelogin.py", line 157, in tradeFunc print(kite.instruments(exchange="NSE")) File "C:\Users\tannirus\AppData\Local\Programs\Python\Python35\lib\site-packages\kiteconnect\__init__.py", line 376, in instruments return self._parse_csv(self._get("market.instruments", params)) File "C:\Users\tannirus\AppData\Local\Programs\Python\Python35\lib\site-packages\kiteconnect\__init__.py", line 421, in _parse_csv reader = csv.reader(StringIO(data.strip())) TypeError: initial_value must be str or None, not bytes
We don't have the list. You can find all the instruments on exchange website and get all the instruments tokens here.
You can go to documentation and find the URL there. I have pointed to the right section of the documentation.