issue on last trading day data without historical data subscription

kskaruna
Hi ,

I just subscribed for Kite API. I am trying to fetch the Friday data alone.

But I am getting the below error

"Ensure you have subscribed to Historic API
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib64/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/usr/lib64/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "lynna_lenna.py", line 120, in get_nifty_data
df = pd.DataFrame().from_dict(histdata)
File "/usr/local/lib64/python3.7/site-packages/pandas/core/frame.py", line 1309, in from_dict
return cls(data, index=index, columns=columns, dtype=dtype)
File "/usr/local/lib64/python3.7/site-packages/pandas/core/frame.py", line 529, in __init__
raise ValueError("DataFrame constructor not properly called!")
ValueError: DataFrame constructor not properly called!"

Note : I am not subscribed for Historical Data. but I am trying to fetch only Friday data.
I am using below code
todate = get_trade_day(datetime.now().astimezone(to_india) - timedelta(days=0))
start_period1 = 0
fromdate = get_trade_day(datetime.strptime(todate1, "%Y-%m-%d") - timedelta(days=start_period1))
hist_data = kite.historical_data(scrip.get("instrument_token"), fromdate, todate, ohlcinterval)

kindly advise.
  • dinezh
    Nope you cannot fetch even single day data without subscribing to Kite Historical Data.
    If you want to save money by not subscribing to ktie historical data
    You can save your tick data to a Database and resample the tick data to any timeframe like 1 minute, 5 minute or 1 day
  • kskaruna
    ok Thanks.
This discussion has been closed.