Websocket "candles" channel | set candle granularity

Advanced Trade API > Websocket Feed > Channels

documentation says: “Subscribe to the candles channel to receive candles messages for specific products with updates every second. Candles are grouped into buckets (granularities) of five minutes.”

I want to subscribe to that candles channel granularity of 4 hours, 1 hour, and 15 min, but I can’t find anywhere on docs that I can change the granularity. Is it possible?

1 Like

Hey @enis, Welcome to the Coinbase Developer Forum Community.

To get candles of different granularity, we suggest you to use the Get Product Candles endpoint.

Sample example for granularity of ONE_HOUR: https://api.coinbase.com/api/v3/brokerage/products/BTC-USDC/candles?start=1689053834&end=1691752034&granularity=ONE_HOUR

Available intervals:
ONE MINUTE
FIVE_MINUTE
FIFTEEN MINUTE
THIRTY MINUTE
ONE_HOUR
TWO_HOUR
SIX HOUR
ONE DAY

Please note: The maximum number of data points for a single request is 300 candles.

We hope this helps. We’d be happy to answer any more questions.

Thank you and have a nice day!