Historical Data is incorrect

SivakumarN
I used the JavaKiteConnect API to get historical data of ADANIENT - (Token = 6401; NSE) from 8-Sep-2025 to 11-Sep-2025 for 5 min interval. The data I got was "Timestamp: 2025-09-08T09:15:00+0530 | OHLC : 2290.0;2297.6;2286.0;2297.6 | Vol : 3380 "; but when I checked using the chart in Kite web portal, it was different for the same timestamp. "OHLC : 2290.0;2304.20;2286.0;2301.60 | Vol: 15.31K". Could you please look into it? My application is completely dependent on the data I get using your API.

I am using # The Kite Connect 3.4.0 API Java client.
  • SivakumarN
    I checked with latest KiteConnect API - 3.5.1 version as well. The above error persists.
  • tanavamsikrishna
    Another location wrong data is provided is while using pykiteconnect python API. For example the following code `kite_client.historical_data(256265, "2024-01-20", "2024-01-20", "day")` is returning data for the date, 2024-01-20, which is on a Saturday and was a holiday.
  • AS1100K
    The API is correct, on 20th Jan, 2024 Special Trading session happened.

    Special Trading Session Announcement
  • SivakumarN
    The parameters I used while testing historical data using Java connect API are ...
    fromDate : Mon Sep 01 00:00:00 IST 2025 | toDate : Mon Sep 08 09:16:00 IST 2025 | Token = 6401 | timeInterval = "5minute" | isContinuos = false | isoi = false
  • nagavenij
    We have verified from our end and it appears to be working fine. You can share us the raw API response along with a screenshot of the chart or timeframe where you are observing the discrepancy.
  • SivakumarN
    I tested the API on 19th Sep with from, to & timeinterval as 2025-09-01T00:00:00+0530, 2025-09-08T09:16:00+0530 and 5minute respectively. Ideally I shouldn't have received the data of 2025-09-08T09:15:00 candle as 9:15 candle represents the data from 09:15:00 to 09:19:59.

    But I guess your system is computing the data between 2025-09-08T09:15:00 and 2025-09-08T09:16:00+0530 (which is the 'To Date' parameter sent in the API call) , sending it in 2025-09-08T09:15:00 candle.

    I made updated my application to check the time difference between the toDate&Time and the last candle timestamp returned by the API in the historical data. If the difference is less than the timeinterval (in my case, 5 min), I am ignoring that candle. After this work around, I don't see any issue.

    You may close the ticket.
  • Nivas
    When you request historical candle data via the API, it's important to understand how the from and to parameters work. The to parameter sets the end of the time range you're interested in, but it doesn't specifically refer to the closing time of any candle. It simply includes all the candle data between the 'from' and 'to' times you provide.

    For example, if you set the to parameter to 9:16, you'll receive data up until the 9:15 candle, because that candle falls within your specified range. If you wish to exclude the 9:15 candle, you should set your to parameter to a time before 9:15.
This discussion has been closed.