> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdp.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Candles

> Real-time updates on product candles, grouped into five-minute buckets,
with updates every second.




## AsyncAPI

````yaml api-reference/advanced-trade-api/advanced-trade-asyncapi.json candles
id: candles
title: Candles
description: |
  Real-time updates on product candles, grouped into five-minute buckets,
  with updates every second.
servers:
  - id: production
    protocol: wss
    host: advanced-trade-ws.coinbase.com
    bindings: []
    variables: []
address: candles
parameters: []
bindings: []
operations:
  - &ref_1
    id: candlesSubscribe
    title: Subscribe to candles
    description: Client sends a subscribe or unsubscribe request for the candles channel.
    type: receive
    messages:
      - &ref_3
        id: subscribe_request
        contentType: application/json
        payload:
          - name: Subscription request
            description: Subscribe or unsubscribe to the candles channel.
            type: object
            properties:
              - name: type
                type: string
                enumValues:
                  - subscribe
                  - unsubscribe
                required: true
              - name: channel
                type: string
                required: true
              - name: product_ids
                type: array
                description: Products to subscribe to, for example BTC-USD.
                required: true
                properties:
                  - name: item
                    type: string
                    required: false
              - name: jwt
                type: string
                description: >-
                  CDP JWT. Optional here; recommended for connection
                  reliability.
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - channel
            - product_ids
          properties:
            type:
              type: string
              enum:
                - subscribe
                - unsubscribe
              default: subscribe
              x-parser-schema-id: <anonymous-schema-13>
            channel:
              type: string
              default: candles
              x-parser-schema-id: <anonymous-schema-14>
            product_ids:
              type: array
              items:
                type: string
                x-parser-schema-id: <anonymous-schema-16>
              description: Products to subscribe to, for example BTC-USD.
              x-parser-schema-id: <anonymous-schema-15>
            jwt:
              type: string
              description: CDP JWT. Optional here; recommended for connection reliability.
              x-parser-schema-id: <anonymous-schema-17>
          x-parser-schema-id: <anonymous-schema-12>
        title: Subscription request
        description: Subscribe or unsubscribe to the candles channel.
        example: |-
          {
            "type": "subscribe",
            "channel": "candles",
            "product_ids": [
              "BTC-USD"
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe_request
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: candles
  - &ref_2
    id: candlesStream
    title: Candles stream
    description: Server streams candle updates to subscribed clients.
    type: send
    messages:
      - &ref_4
        id: candles
        contentType: application/json
        payload:
          - name: Candles message
            type: object
            properties:
              - name: channel
                type: string
                description: The channel that produced this message.
                required: false
              - name: timestamp
                type: string
                description: Server time the message was sent (RFC 3339).
                required: false
              - name: sequence_num
                type: integer
                description: >-
                  Per-connection message sequence number; use it to detect
                  dropped or out-of-order messages.
                required: false
              - name: events
                type: array
                required: false
                properties:
                  - name: type
                    type: string
                    enumValues:
                      - snapshot
                      - update
                    required: false
                  - name: candles
                    type: array
                    required: false
                    properties:
                      - name: start
                        type: string
                        description: >-
                          String representation of the UNIX timestamp of the
                          candle.
                        required: false
                      - name: high
                        type: string
                        description: Highest price during the bucket interval.
                        required: false
                      - name: low
                        type: string
                        description: Lowest price during the bucket interval.
                        required: false
                      - name: open
                        type: string
                        description: Price of the first trade in the bucket.
                        required: false
                      - name: close
                        type: string
                        description: Price of the last trade in the bucket.
                        required: false
                      - name: volume
                        type: string
                        description: Base amount traded during this interval.
                        required: false
                      - name: product_id
                        type: string
                        description: Product identifier for this candle.
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            channel:
              type: string
              description: The channel that produced this message.
              const: candles
              x-parser-schema-id: <anonymous-schema-18>
            timestamp:
              type: string
              format: date-time
              description: Server time the message was sent (RFC 3339).
              x-parser-schema-id: <anonymous-schema-19>
            sequence_num:
              type: integer
              description: >-
                Per-connection message sequence number; use it to detect dropped
                or out-of-order messages.
              x-parser-schema-id: <anonymous-schema-20>
            events:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - snapshot
                      - update
                    x-parser-schema-id: <anonymous-schema-23>
                  candles:
                    type: array
                    items:
                      type: object
                      properties:
                        start:
                          type: string
                          description: >-
                            String representation of the UNIX timestamp of the
                            candle.
                          x-parser-schema-id: <anonymous-schema-25>
                        high:
                          type: string
                          description: Highest price during the bucket interval.
                          x-parser-schema-id: <anonymous-schema-26>
                        low:
                          type: string
                          description: Lowest price during the bucket interval.
                          x-parser-schema-id: <anonymous-schema-27>
                        open:
                          type: string
                          description: Price of the first trade in the bucket.
                          x-parser-schema-id: <anonymous-schema-28>
                        close:
                          type: string
                          description: Price of the last trade in the bucket.
                          x-parser-schema-id: <anonymous-schema-29>
                        volume:
                          type: string
                          description: Base amount traded during this interval.
                          x-parser-schema-id: <anonymous-schema-30>
                        product_id:
                          type: string
                          description: Product identifier for this candle.
                          x-parser-schema-id: <anonymous-schema-31>
                      x-parser-schema-id: Candle
                    x-parser-schema-id: <anonymous-schema-24>
                x-parser-schema-id: <anonymous-schema-22>
              x-parser-schema-id: <anonymous-schema-21>
          x-parser-schema-id: CandlesEnvelope
        title: Candles message
        example: No examples found
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: candles
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
receiveOperations:
  - *ref_2
sendMessages:
  - *ref_3
receiveMessages:
  - *ref_4
extensions:
  - id: x-parser-unique-object-id
    value: candles
securitySchemes: []

````