API
In API the typical delay after the candle has been closed is about 0.3-2 minutes, depending on the instrument. This happens due to the algorithm which takes time to collect the tick data, form it into the candle, store it in the DB, and for many other manipulations.
WebSocket
In return, if the least possible delay plays a crucial role, the WebSocket would be the right choice with only 170 ms delay and tick level updates.