Websocket API giving wrong data

VibhorMeshram
Hi I am using kite api version 311.
I am trying to get historical data using kite api and current day's data using websocket api. I am seeing a mismatch between websocket OLHC data of current day after the markets are closed. Following is the data - row 0 and 1 are fetched using kite api historical data. Whereas row 2 is fetched from websocket after the markets are closed. the close value of row 2 coincidently seems to be matching with row 1 (data 1 day prior). Ideally row 1 and row 2 should show same data. since the dates are same.

************BPCL*****************
date open high low close volume
0 2025-06-20 00:00:00+05:30 310.9 315.9 310.0 313.50 8522458
1 2025-06-23 00:00:00+05:30 310.0 315.5 308.2 313.25 6812699
2 2025-06-23 00:00:00+05:30 310.0 315.5 308.2 313.50 6848410
************HDFCBANK*****************
date open high low close volume
0 2025-06-20 00:00:00+05:30 1931.6 1969.9 1931.6 1964.7 16450204
1 2025-06-23 00:00:00+05:30 1948.4 1957.9 1941.8 1948.1 5634587
2 2025-06-23 00:00:00+05:30 1948.4 1957.9 1941.8 1964.7 5869759
************BAJAJFINSV*****************
date open high low close volume
0 2025-06-20 00:00:00+05:30 1974.8 1998.9 1965.0 1986.2 1931248
1 2025-06-23 00:00:00+05:30 1976.3 2008.4 1950.7 1995.0 1123477
2 2025-06-23 00:00:00+05:30 1976.3 2008.4 1950.7 1986.2 1125629
************HEROMOTOCO*****************
date open high low close volume
0 2025-06-20 00:00:00+05:30 4380.5 4382.4 4204.9 4338.5 1159015
1 2025-06-23 00:00:00+05:30 4320.0 4324.7 4245.0 4247.2 578026
2 2025-06-23 00:00:00+05:30 4320.0 4324.7 4245.0 4338.5 580717
************HCLTECH*****************
date open high low close volume
0 2025-06-20 00:00:00+05:30 1713.9 1742.6 1709.1 1739.9 2719770
1 2025-06-23 00:00:00+05:30 1729.2 1729.8 1699.2 1699.9 2215146
2 2025-06-23 00:00:00+05:30 1729.2 1729.8 1699.2 1739.9 2221446
  • Nivas
    It looks like you're trying to fetch historical data on the same day after the market closes. Ideally, it's best to wait until the EOD process completes. After that, you can fetch the data and cross-check the details, which should align, though the closing price might differ. This is because WebSocket streams quotes for instruments, while the close price declared by the exchange is based on the weighted average of the last 30 minutes of trading (from 3:00 PM to 3:30 PM).

    You may fetch the data on the next working day and verify it. I just fetched the data, and everything seems to be fine.
Sign In or Register to comment.