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

# Get candles

> Returns OHLCV candles for a market and interval. Use candles for charts, historical price checks, and pre-trade context; use ticker or order book endpoints when you need a current executable view.



## OpenAPI

````yaml /openapi/openapi.json get /partner/exchange/candles
openapi: 3.1.0
info:
  title: Stabyl API
  description: >-
    REST API for approved Stabyl accounts to automate exchange, wallet, and
    non-production simulation workflows.
  contact:
    name: Stabyl Support
    email: support@stabyl.com
  license:
    name: Proprietary
  version: 1.0.0
servers:
  - url: https://api.stabyl.com/v1
    description: Production
  - url: https://api-staging.stabyl.com/v1
    description: Staging
security: []
tags:
  - name: Exchange
    description: Trading market data and order management for account automation.
  - name: Wallets
    description: >-
      Supported routes, deposit destinations, balances, transactions, and saved
      recipients.
  - name: Webhooks
    description: >-
      Outbound event delivery configuration and eventually consistent delivery
      history. Verify Standard Webhooks webhook-id, webhook-timestamp, and
      webhook-signature headers against the unchanged raw request body before
      parsing JSON.
  - name: Simulation
    description: Non-production endpoints for testing integration behavior.
paths:
  /partner/exchange/candles:
    get:
      tags:
        - Exchange
      summary: Get candles
      description: >-
        Returns OHLCV candles for a market and interval. Use candles for charts,
        historical price checks, and pre-trade context; use ticker or order book
        endpoints when you need a current executable view.
      operationId: get_partner_exchange_candles
      parameters:
        - name: pair_id
          in: query
          description: >-
            Trading pair identifier returned by `GET /partner/exchange/markets`,
            for example `USD/NGN`.
          required: true
          schema:
            type: string
          example: USD/NGN
        - name: interval
          in: query
          description: >-
            Candle interval. Supported values: `1m`, `5m`, `15m`, `1h`, `4h`,
            `1d`.
          required: true
          schema:
            type: string
          example: 1h
        - name: before
          in: query
          description: >-
            Return candles before this UTC timestamp. Omit to read from the
            current server time.
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: limit
          in: query
          description: >-
            Number of candles to return. Defaults to `100` and is capped by the
            API.
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int64
          example: 100
      responses:
        '200':
          description: OHLCV candles
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/CandlesResponse'
                  status:
                    type: string
                    enum:
                      - success
              example:
                data:
                  candles:
                    - close: '1655.00'
                      high: '1660.00'
                      low: '1648.00'
                      open: '1650.00'
                      timestamp: '2026-05-24T12:00:00Z'
                      trade_count: 42
                      volume: '1000.00'
                      volume_quote: '1655000.00'
                  interval: 1h
                  pair_id: USD/NGN
                status: success
        '400':
          description: Invalid interval
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        example: VALIDATION_FAILED
                      message:
                        type: string
                        example: invalid request parameters
                  status:
                    type: string
                    enum:
                      - error
              example:
                error:
                  code: VALIDATION_FAILED
                  message: invalid request parameters
                status: error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        example: UNAUTHORIZED
                      message:
                        type: string
                        example: missing X-Api-Key header
                  status:
                    type: string
                    enum:
                      - error
              example:
                error:
                  code: UNAUTHORIZED
                  message: missing X-Api-Key header
                status: error
      security:
        - api_key: []
components:
  schemas:
    CandlesResponse:
      type: object
      description: OHLCV candle series for a trading pair and interval.
      required:
        - pair_id
        - interval
        - candles
      properties:
        candles:
          type: array
          items:
            $ref: '#/components/schemas/Candle'
          description: List of candles
        interval:
          type: string
          description: Candle interval
          example: 1h
        pair_id:
          type: string
          description: Trading pair identifier
          example: USD/NGN
    Candle:
      type: object
      description: Single OHLCV candle for a trading interval.
      required:
        - timestamp
        - open
        - high
        - low
        - close
        - volume
        - volume_quote
        - trade_count
      properties:
        close:
          type: string
          description: Closing price
          example: '1652.00'
        high:
          type: string
          description: Highest price
          example: '1655.00'
        low:
          type: string
          description: Lowest price
          example: '1648.00'
        open:
          type: string
          description: Opening price
          example: '1650.00'
        timestamp:
          type: string
          description: Candle start timestamp
        trade_count:
          type: integer
          format: int64
          description: Number of trades in this candle
          example: 150
        volume:
          type: string
          description: Volume in base currency
          example: '10000.00'
        volume_quote:
          type: string
          description: Volume in quote currency
          example: '16500000.00'
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        API credential. Withdrawal quote and submit operations additionally
        require the documented Ed25519 timestamp, nonce, and signature headers.
      x-default: sb_test_your_key

````