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

# Get candles

> Handles `GET /v1/candles/{symbol}` via `get.v1.candles.by_symbol`.



## OpenAPI

````yaml /openapi/phoenix-public-api.json get /v1/candles/{symbol}
openapi: 3.1.0
info:
  title: Phoenix Eternal API
  description: >-
    RESTful API for accessing Phoenix Eternal perpetual trading data. Provides
    real-time orderbook levels, asset information, and market metadata.
  termsOfService: https://www.phoenix.trade/terms-of-service
  contact:
    name: Phoenix Development Team
    url: https://github.com/Ellipsis-Labs/phoenix
  license:
    name: Proprietary
  version: 1.0.0
servers:
  - url: https://perp-api.phoenix.trade
    description: Phoenix Eternal Perp API
security: []
tags:
  - name: Auth
    description: Wallet and session authentication.
  - name: Exchange
    description: Exchange, market, candle, and no-referral register-instruction workflows.
  - name: Invite
    description: Invite validation, referral activation, and wallet allowlist checks.
  - name: Notifications
    description: Trader notification reads and acknowledgement helpers.
  - name: Trader
    description: Trader state, account history, and transaction builders.
externalDocs:
  url: https://docs.phoenix.trade
  description: Phoenix developer documentation
paths:
  /v1/candles/{symbol}:
    get:
      tags:
        - Exchange
      summary: Get candles
      description: Handles `GET /v1/candles/{symbol}` via `get.v1.candles.by_symbol`.
      operationId: get.v1.candles.by_symbol
      parameters:
        - name: symbol
          in: path
          description: Trading symbol
          required: true
          schema:
            type: string
        - name: timeframe
          in: query
          description: Timeframe
          required: true
          schema:
            type: string
        - name: startTime
          in: query
          description: Start time in milliseconds since Unix epoch
          required: false
          schema:
            type: integer
            format: int64
        - name: endTime
          in: query
          description: End time in milliseconds since Unix epoch
          required: false
          schema:
            type: integer
            format: int64
        - name: limit
          in: query
          description: 'Max number of candles (default: 2500)'
          required: false
          schema:
            type: integer
            format: int64
        - name: enableExternalSource
          in: query
          description: 'Opt-in external candles stored in the DB (default: false)'
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Asset candles
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiCandle'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '500':
          $ref: '#/components/responses/ErrorResponse'
      security:
        - PhoenixBearerAuth: []
components:
  schemas:
    ApiCandle:
      type: object
      description: |-
        API Candle structure (Trading View Bar interface)
        Note: This is a simplified version. The full implementation with From
        conversions is in eternal-api/src/api/candles.rs to avoid heavy
        dependencies.
      required:
        - time
        - low
        - high
        - open
        - close
      properties:
        close:
          type: number
          format: double
        externalSource:
          type:
            - string
            - 'null'
          description: |-
            External candle source name (e.g., "binance", "coinbase").
            Omitted from JSON for exchange candles to preserve backward
            compatibility.
        high:
          type: number
          format: double
        low:
          type: number
          format: double
        markClose:
          type: number
          format: double
        markHigh:
          type: number
          format: double
        markLow:
          type: number
          format: double
        markOpen:
          type: number
          format: double
        open:
          type: number
          format: double
        time:
          type: integer
          format: int64
          description: Candle timestamp as a Unix timestamp in milliseconds (UTC).
        tradeCount:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        volume:
          type:
            - number
            - 'null'
          format: double
        volumeQuote:
          type:
            - number
            - 'null'
          format: double
          description: Quote currency volume (e.g. USDC) for the candle period.
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  responses:
    ErrorResponse:
      description: Standard JSON error payload.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    PhoenixBearerAuth:
      type: http
      scheme: bearer
      description: Bearer access token issued by `/v1/auth/*` login endpoints.

````