kite.historical_data is returning Null

nickmccullum
The KiteConnect.historical_data is returning null for me. I have the proper API subscription. Here are three examples that I have tried:

kite.historical_data(instrument_token=260105,
from_date=datetime.datetime(2020,10,10).date(),
to_date=datetime.datetime.now().date(),
interval="day",
)

kite.historical_data(instrument_token=260105,
from_date="2020-10-10",
to_date="2020-10-25",
interval="day",
)

kite.historical_data(instrument_token=260105,
from_date=datetime.datetime(2020,10,10),
to_date=datetime.datetime.now(),
interval="day",
)

After subscribing to the additional Kite Connect historical data API earlier today, I regenerated my API secret token.

Can anyone assist?
  • rakeshr
    @nickmccullum
    kite.historical_data(instrument_token=260105,
    from_date=datetime.datetime(2020,10,10).date(),
    to_date=datetime.datetime.now().date(),
    interval="day",
    )
    Input seems fine. Can you enable debug log and paste complete log here?
  • nickmccullum
    Even with `debug=True` specified in the instantiation of the KiteConnect class, the function call still returns None.
  • rakeshr
    Have you set the debug log with logging.basicConfig(level=logging.DEBUG)? We are trying to look at GET request log for historical data. Something like below:
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "GET /instruments/historical/260105/day?from=2020-10-10&to=2020-10-29&interval=day&continuous=0&oi=0 HTTP/1.1" 200 None
  • dinezh
    @nickmccullum so your other kite methods like kite.quote() working fine?
Sign In or Register to comment.