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

# Get the last N OHLC candles up to a given timestamp

> Returns up to 1000 OHLC candles in ascending order for a specific resolution up to the given specific timestamp. Use this for detailed price analysis at a chosen timeframe. Common resolutions: 60=1 min, 900=15 min, 3600=1 H, 14400=4 H, 86400=1 D. Pass the current ISO timestamp as dt to get the most recent candles.



## OpenAPI

````yaml /openapi-readme.json get /trading/chart/{ticker}/candles/{resolution}/{count}/{dt}
openapi: 3.1.0
info:
  title: Amana API
  version: 1.0.0
  description: API documentation for Amana platform
servers:
  - url: https://gateway.amana.io
    description: Amana app
security: []
tags:
  - name: onboarding
    description: Endpoints related to user onboarding, KYC processes, and account setup.
  - name: auth
    description: Endpoints for user authentication, token management, and session handling.
  - name: trading
    description: >-
      Endpoints related to trading operations, account management, and market
      data retrieval.
  - name: charting
    description: >-
      Endpoints for retrieving historical price data, technical indicators, and
      other charting-related information.
  - name: uaepass
    description: Endpoints for UAE Pass authentication and identity verification.
  - name: alerts
  - name: cms
  - name: dw
  - name: events
  - name: geo-location
  - name: high-leverage
  - name: kyc
  - name: mt
  - name: nafath
  - name: payments
  - name: promo-codes
  - name: smart-money
  - name: support
  - name: symbols
  - name: trading-accounts
  - name: transactions
  - name: user
  - name: watchlists
paths:
  /trading/chart/{ticker}/candles/{resolution}/{count}/{dt}:
    get:
      tags:
        - trading
      summary: Get the last N OHLC candles up to a given timestamp
      description: >-
        Returns up to 1000 OHLC candles in ascending order for a specific
        resolution up to the given specific timestamp. Use this for detailed
        price analysis at a chosen timeframe. Common resolutions: 60=1 min,
        900=15 min, 3600=1 H, 14400=4 H, 86400=1 D. Pass the current ISO
        timestamp as dt to get the most recent candles.
      operationId: getCandles
      parameters:
        - schema:
            type: string
          in: path
          name: ticker
          required: true
          description: Trading symbol, for example XAUUSD, EURUSD, or BTCUSD.
        - schema:
            type: integer
          in: path
          name: resolution
          required: true
          description: >-
            Candle size in seconds, must be a multiple of 60. Common values: 60
            (1 min), 3600 (1 H), 86400 (1 D).
        - schema:
            type: integer
          in: path
          name: count
          required: true
          description: Number of candles to return. Maximum 1000.
        - schema:
            type: string
          in: path
          name: dt
          required: true
          description: >-
            ISO-8601 upper-bound timestamp, for example
            2025-06-01T00:00:00.000Z. Use the current datetime to retrieve the
            most recent candles.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        time:
                          type: integer
                          description: Candle close time as Unix seconds.
                        open:
                          type: number
                          description: Opening price.
                        high:
                          type: number
                          description: Highest price in the period.
                        low:
                          type: number
                          description: Lowest price in the period.
                        close:
                          type: number
                          description: Closing price.
                        volume:
                          type: number
                          description: Trade volume.
                      required:
                        - time
                        - open
                        - high
                        - low
                        - close
                      additionalProperties: false
                    description: Candles in ascending time order.
                  immutable:
                    type: boolean
                    description: True when the right edge is finalized and safe to cache.
                  no_more:
                    type: boolean
                    description: >-
                      True when no further historical data exists beyond this
                      range.
                required:
                  - data
                  - immutable
                additionalProperties: false
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token obtained from authentication endpoints

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.