Getting InputException when trying to fetch historical data

yeshari
yeshari edited September 2023 in Java client
I am trying to fetch historical data using the following code
logger.info("Getting Data for " + tradingSymbol);
logger.info("from = " + tempFromDate + " to = " + tempToDate + " instrumentToken = " + instrumentToken + " interval = " + intervalType.label);
HistoricalData historicalData = kiteConnect.getHistoricalData(tempFromDate, tempToDate, instrumentToken, intervalType.label, false, true);
The output is below.
[2023-09-28T17:53:18.249+05:30] mytrading.stockdata.StockDataService: Getting Data for VOLTAS23NOVFUT
[2023-09-28T17:53:18.249+05:30] mytrading.stockdata.StockDataService: from = Fri Sep 01 00:00:00 IST 2023 to = Thu Sep 28 23:59:59 IST 2023 instrumentToken = 14883842 interval = minute
com.zerodhatech.kiteconnect.kitehttp.exceptions.InputException
at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.dealWithException(KiteResponseHandler.java:55)
at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.handle(KiteResponseHandler.java:21)
at com.zerodhatech.kiteconnect.kitehttp.KiteRequestHandler.getRequest(KiteRequestHandler.java:72)
at com.zerodhatech.kiteconnect.KiteConnect.getHistoricalData(KiteConnect.java:842)
It was working 2 days before. I am not able to download yesterday's and today's data. I then reset the date to download the data for this whole month. I am getting this exception for all the instruments. The exception is very generically worded.

Because of this, I don't have data for yesterday and today. Please let me know if I am doing anything wrong.
  • sujith
    You need to enable debug logs and check the error json from the response. You can enable while initializing the Kite Connect object.
Sign In or Register to comment.