Data tick difference between JS Websocket API V3 vs `https://api-t1.fyers.in/data/history`

When I was recording data for NSE:HCC-EQ security

From Websocket for first 5 min:** logic I used create a 5 min candle**

// Collect live data
const mod = (message.exch_feed_time) % 300;
if ((mod >= 0 && mod <= 5 && stockList[message.symbol][1])) {
    // create a 5 min candle
} else {
    // update a 5 min candle high, low & close
}
[ "2024-09-30T09:15:00.000Z", 42.38, 42.61, 42.17, 42.26, 94143 ]

From Data API for First 5 min:

["2024-09-30T09:15:00.000Z",42.39,42.61,41.76,42.26,756957]

You can see some difference in Open Price, Low Price & Volume (added volume per tick )

My end goal:
I want to make 5 min chart using websocket data feed but due wrong data being posted to websocket API, my final output shows different compared to history API.

Could I get access to log event from websocket? or do we have any source to get 5 min accurate data without any latency while real time?

{"level":"debug","datetime":"2024-10-31T09:45:01.750Z","message":"HSM raw data","data":[{"ltp":73.96,"ltq":268,"cng":7.89,"nc":11.94,"name":"sf","tk":"27297","e":"nse_cm"}],"functionName":"conversion"}

Like to know about the data source for Data API?
@chirag, @WWhYB2qrsx

you have to go through old posts. There are some issues in WS but support is not actively addressing it here.

One thing will be for sure, RTD websocket data will not always match a historical API candle because of the way data is snapshot. Even 2 official vendors will have variation in candles.

That is why EoD, vendor send reconciliation data to update DB.

Hey @jWc5sbHvE5

Can we please get the websocket logs to cehck the same as we had asked earlier , please give the CURL of the history API youa re hitting to get the response

@WWhYB2qrsx, I’m using Fyers API for fetching historical data.

fyers = new FyersAPI()

Hey @jWc5sbHvE5

Requesting you to re-check the function written to convert the socket data into 5 mins resolution , We have done the same from our end and observed that the data is almost similar and we did not find any discrepancies . Please check the logic you have written . If there is any clarity required , please DM your contact details so that we can connect over a call and discuss further .

@WWhYB2qrsx, I’ve sent you a direct message.