# Get candles

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/candles/{pair}:
    get:
      summary: Get candles
      deprecated: false
      description: >-
        Returns historical OHLCV (open, high, low, close, volume) candlestick
        data for the specified trading pair. Optionally filter by time range or
        limit the number of bars returned, counted back from the end time.
      operationId: getCandles
      tags:
        - API/Market data
        - Candles
      parameters:
        - name: pair
          in: path
          description: Trading pair symbol (e.g. BTC-EUR)
          required: true
          example: BTC-EUR
          schema:
            type: string
        - name: interval
          in: query
          description: Bar interval
          required: false
          example: 5m
          schema:
            type: string
            description: Bar interval
            enum:
              - 1m
              - 5m
              - 10m
              - 15m
              - 30m
              - 1h
              - 4h
              - 1d
            default: 1d
            examples:
              - 5m
        - name: from
          in: query
          description: >-
            Start of the range as Unix timestamp (UTC). Optional — defaults to
            earliest available data.
          required: false
          example: 1718359200
          schema:
            type: integer
            description: >-
              Start of the range as Unix timestamp (UTC). Optional — defaults to
              earliest available data.
            format: int64
            examples:
              - 1718359200
        - name: to
          in: query
          description: >-
            End of the range as Unix timestamp (UTC). Optional — defaults to
            now.
          required: false
          example: 1718445600
          schema:
            type: integer
            description: >-
              End of the range as Unix timestamp (UTC). Optional — defaults to
              now.
            format: int64
            examples:
              - 1718445600
        - name: limit
          in: query
          description: >-
            Number of bars to return, counted back from `to`. When set, `from`
            is ignored. Must be between 1 and 1440.
          required: false
          example: 100
          schema:
            maximum: 1440
            minimum: 1
            type: integer
            description: >-
              Number of bars to return, counted back from `to`. When set, `from`
              is ignored. Must be between 1 and 1440.
            format: int32
            default: 1440
            examples:
              - 100
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    timestamp:
                      type: integer
                      description: Bar open time as Unix timestamp (UTC)
                      format: int64
                      examples:
                        - 1718445600
                    open:
                      type: number
                      description: Opening price
                      examples:
                        - 61200
                    high:
                      type: number
                      description: Highest price in the bar
                      examples:
                        - 61800
                    low:
                      type: number
                      description: Lowest price in the bar
                      examples:
                        - 60900
                    close:
                      type: number
                      description: Closing price
                      examples:
                        - 61500
                    volume:
                      type: number
                      description: Volume traded in the bar
                      examples:
                        - 1200.5
                  x-apidog-orders:
                    - timestamp
                    - open
                    - high
                    - low
                    - close
                    - volume
              examples:
                success:
                  summary: success
                  value:
                    - timestamp: 1718445600
                      open: 61200
                      high: 61800
                      low: 60900
                      close: 61500
                      volume: 1200.5
                    - timestamp: 1718532000
                      open: 61500
                      high: 62100
                      low: 61100
                      close: 61900
                      volume: 980.3
          headers: {}
          x-apidog-name: ''
        '400':
          description: Invalid query parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Machine-readable error code
                          examples:
                            - VALIDATION_ERROR
                        status:
                          type: integer
                          description: HTTP status code
                          format: int32
                          examples:
                            - 400
                        field:
                          type: string
                          description: >-
                            Field that caused the error; null for non-validation
                            errors
                          examples:
                            - limit
                          nullable: true
                        title:
                          type: string
                          description: Human-readable error message
                          examples:
                            - Invalid value for parameter 'limit'
                      x-apidog-orders:
                        - code
                        - status
                        - field
                        - title
                x-apidog-orders:
                  - errors
          headers: {}
          x-apidog-name: ''
        '404':
          description: Pair not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Machine-readable error code
                          examples:
                            - VALIDATION_ERROR
                        status:
                          type: integer
                          description: HTTP status code
                          format: int32
                          examples:
                            - 400
                        field:
                          type: string
                          description: >-
                            Field that caused the error; null for non-validation
                            errors
                          examples:
                            - limit
                          nullable: true
                        title:
                          type: string
                          description: Human-readable error message
                          examples:
                            - Invalid value for parameter 'limit'
                      x-apidog-orders:
                        - code
                        - status
                        - field
                        - title
                x-apidog-orders:
                  - errors
              example:
                errors:
                  - code: 404 NOT_FOUND
                    status: 404
                    field: null
                    title: 'Pair not found: XYZ-EUR'
          headers: {}
          x-apidog-name: ''
        '500':
          description: Unexpected server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Machine-readable error code
                          examples:
                            - VALIDATION_ERROR
                        status:
                          type: integer
                          description: HTTP status code
                          format: int32
                          examples:
                            - 400
                        field:
                          type: string
                          description: >-
                            Field that caused the error; null for non-validation
                            errors
                          examples:
                            - limit
                          nullable: true
                        title:
                          type: string
                          description: Human-readable error message
                          examples:
                            - Invalid value for parameter 'limit'
                      x-apidog-orders:
                        - code
                        - status
                        - field
                        - title
                x-apidog-orders:
                  - errors
          headers: {}
          x-apidog-name: ''
      security:
        - ApiKeyAuth: []
          x-apidog:
            schemeGroups:
              - id: P0I5aE9V07Vmgs3u0ak7V
                schemeIds:
                  - ApiKeyAuth
            required: true
            use:
              id: P0I5aE9V07Vmgs3u0ak7V
            scopes:
              P0I5aE9V07Vmgs3u0ak7V:
                ApiKeyAuth: []
      x-apidog-folder: API/Market data
      x-apidog-status: released
      x-run-in-apidog: https://app.eu.apidog.com/web/project/363759/apis/api-4311313-run
components:
  schemas: {}
  securitySchemes:
    ApiKeyAuth:
      type: apikey
      description: API key for authentication. Issued by Bitpanda.
      name: x-api-key
      in: header
servers:
  - url: https://api.fusion.bitpanda.com
    description: Production
security: []

```