Fetching Historical Data

genesis
genesis edited December 2018 in Python client
I am trying to fetch historical data for ICICIBank on a particular date

import pandas as pd
data=kite.historical_data(instrument_token='1270529',from_date='2017-08-21',to_date='2017-08-21',interval='minute')
data=pd.DataFrame(data)
data.to_csv('icicibank.csv')

---------------------------------------------------------------------------
PermissionException Traceback (most recent call last)
in ()
1 import pandas as pd
----> 2 data=kite.historical_data(instrument_token='1270529',from_date='2017-08-21',to_date='2017-08-21',interval='minute')
3 data=pd.DataFrame(data)
4 data.to_csv('icicibank.csv')

~\Anaconda3\lib\site-packages\kiteconnect-3.7.4-py3.6.egg\kiteconnect\connect.py in historical_data(self, instrument_token, from_date, to_date, interval, continuous)
606 "to": to_date_string,
607 "interval": interval,
--> 608 "continuous": 1 if continuous else 0
609 })
610

~\Anaconda3\lib\site-packages\kiteconnect-3.7.4-py3.6.egg\kiteconnect\connect.py in _get(self, route, params)
695 def _get(self, route, params=None):
696 """Alias for sending a GET request."""
--> 697 return self._request(route, "GET", params)
698
699 def _post(self, route, params=None):

~\Anaconda3\lib\site-packages\kiteconnect-3.7.4-py3.6.egg\kiteconnect\connect.py in _request(self, route, method, parameters)
764 # native Kite errors
765 exp = getattr(ex, data["error_type"], ex.GeneralException)
--> 766 raise exp(data["message"], code=r.status_code)
767
768 return data["data"]

PermissionException: Insufficient permission for that call.
Tagged:
This discussion has been closed.