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

# Get OHLC (Open, High, Low, Close) Data for an Asset

> This endpoint retrieves historical Open, High, Low, Close (OHLC) price data for both the primary market (on-chain token) and underlying market (off-chain stock) for a specified asset.

Prices are intended for display only. For real-time trading prices, use the [Soft Attestation Quote](https://docs.ondo.finance/api-reference/attestations/request-a-soft-attestation-quote) API. We do not recommend using the price feeds as an oracle for these assets. An official oracle is in development and will be documented when available. For questions, contact [support@ondo.finance](mailto:support@ondo.finance).

The `interval` parameter determines the bucket size for data points, while the `range` parameter determines how far back historically to look for price data. See below for valid interval/range pairs.

Valid `interval`/`range` pairs:
- 1min/1day *(rolling 24-hour period of open market data)*
- 5min/1day
- 15min/1day
- 1hour/1month
- 4hour/1month
- 12hour/3month
- 1day/3month
- 1day/6month
- 1day/1year
- 1day/all *(all historical data)*

For caching details on this endpoint, please see: [Endpoint Caching](https://docs.ondo.finance/api-reference/endpoint-caching).




## OpenAPI

````yaml /gm-be-api-spec.json get /v1/assets/{symbol}/prices/ohlc
openapi: 3.0.4
info:
  title: GM Backend API
  description: An API spec for the Ondo GM Backend API.
  version: 1.0.0
servers:
  - url: https://api.gm.ondo.finance
    description: GM Backend API
security: []
tags:
  - name: Attestations
    description: Get Mint and Redeem Attestations
  - name: Assets
    description: Get Asset Price Information
  - name: Tickers
    description: Get Ticker Information
  - name: Chains
    description: Get On Chain Data
  - name: Limits
    description: Get Trading Limits
  - name: Status
    description: Get Market and Trading Statuses
paths:
  /v1/assets/{symbol}/prices/ohlc:
    get:
      tags:
        - Assets
      summary: Get OHLC (Open, High, Low, Close) Data for an Asset
      description: >
        This endpoint retrieves historical Open, High, Low, Close (OHLC) price
        data for both the primary market (on-chain token) and underlying market
        (off-chain stock) for a specified asset.


        Prices are intended for display only. For real-time trading prices, use
        the [Soft Attestation
        Quote](https://docs.ondo.finance/api-reference/attestations/request-a-soft-attestation-quote)
        API. We do not recommend using the price feeds as an oracle for these
        assets. An official oracle is in development and will be documented when
        available. For questions, contact
        [support@ondo.finance](mailto:support@ondo.finance).


        The `interval` parameter determines the bucket size for data points,
        while the `range` parameter determines how far back historically to look
        for price data. See below for valid interval/range pairs.


        Valid `interval`/`range` pairs:

        - 1min/1day *(rolling 24-hour period of open market data)*

        - 5min/1day

        - 15min/1day

        - 1hour/1month

        - 4hour/1month

        - 12hour/3month

        - 1day/3month

        - 1day/6month

        - 1day/1year

        - 1day/all *(all historical data)*


        For caching details on this endpoint, please see: [Endpoint
        Caching](https://docs.ondo.finance/api-reference/endpoint-caching).
      operationId: getOHLCPrices
      parameters:
        - name: symbol
          in: path
          description: The GM token symbol
          example: AAPLon
          required: true
          schema:
            type: string
        - name: interval
          in: query
          description: The time interval between data points.
          required: true
          schema:
            $ref: '#/components/schemas/IntervalEnum'
        - name: range
          in: query
          description: The lookback range for historical data.
          required: true
          schema:
            $ref: '#/components/schemas/RangeEnum'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OHLCResponse'
              example:
                interval: 1day
                range: 3month
                primaryMarket:
                  symbol: BABAon
                  data:
                    - timestamp: 1750723200000
                      open: '117.0544'
                      high: '117.3426'
                      low: '117.0544'
                      close: '117.3426'
                    - timestamp: 1750809600000
                      open: '117.87'
                      high: '117.87'
                      low: '114.3677'
                      close: '114.8076'
                    - ...
                underlyingMarket:
                  ticker: BABA
                  data:
                    - timestamp: 1750723200000
                      open: '117.0544'
                      high: '117.3426'
                      low: '117.0544'
                      close: '117.3426'
                    - timestamp: 1750809600000
                      open: '117.87'
                      high: '117.87'
                      low: '114.3677'
                      close: '114.8076'
                    - ...
        '400':
          description: >-
            One of the request parameters is invalid. Please see the returned
            message and documentation for details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  value:
                    message: One of the request parameters is invalid.
                    documentation: https://docs.ondo.finance/api-reference/error-codes
                    code: INVALID_SYMBOL
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  value:
                    message: missing API key
                    code: MISSING_API_KEY
        '404':
          description: >-
            The provided asset symbol does not exist and cannot be found. Please
            see the returned message and documentation for details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  value:
                    message: >-
                      The provided asset symbol does not exist and cannot be
                      found.
                    code: ASSET_NOT_FOUND
        '500':
          description: >-
            An internal server error occurred. Please see the returned message
            and documentation for details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  value:
                    message: >-
                      An internal server error occurred. Please see the returned
                      message and documentation for details.
                    code: INTERNAL_ERROR
      security:
        - apiKey: []
components:
  schemas:
    IntervalEnum:
      type: string
      description: The time interval between data points.
      enum:
        - 1min
        - 5min
        - 15min
        - 1hour
        - 4hour
        - 12hour
        - 1day
    RangeEnum:
      type: string
      description: >-
        The look back range for historical data. (Note that '1day' will return a
        rolling 24-hour period of data and 'all' will return all historical
        data.)
      enum:
        - 1day
        - 1month
        - 3month
        - 6month
        - 1year
        - all
    OHLCResponse:
      type: object
      properties:
        interval:
          $ref: '#/components/schemas/IntervalEnum'
        range:
          $ref: '#/components/schemas/RangeEnum'
        primaryMarket:
          type: object
          properties:
            symbol:
              type: string
              description: The GM symbol associated with the asset.
              example: AAPLon
            data:
              type: array
              items:
                $ref: '#/components/schemas/OHLCDataPoint'
        underlyingMarket:
          type: object
          properties:
            ticker:
              type: string
              description: The stock ticker associated with the asset.
              example: AAPL
            data:
              type: array
              items:
                $ref: '#/components/schemas/OHLCDataPoint'
      required:
        - interval
        - primaryMarket
        - underlyingMarket
        - range
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable message providing more details about the error.
        documentation:
          type: string
          description: A URL to the relevant documentation for this error.
        code:
          type: string
          description: >-
            A reason code identifying the specific type of error. See the Error
            Codes reference for a full list of possible values.
      required:
        - code
        - message
    OHLCDataPoint:
      type: object
      properties:
        timestamp:
          type: number
          description: The Unix timestamp in milliseconds when the data point was recorded.
          example: 1746655938000
        open:
          type: string
          description: >-
            The opening price for the interval, represented as a string-encoded
            decimal with up to 18 digits after the decimal point.
          example: '10.000000000000000000'
        high:
          type: string
          description: >-
            The highest price during the interval, represented as a
            string-encoded decimal with up to 18 digits after the decimal point.
          example: '12.500000000000000000'
        low:
          type: string
          description: >-
            The lowest price during the interval, represented as a
            string-encoded decimal with up to 18 digits after the decimal point.
          example: '8.500000000000000000'
        close:
          type: string
          description: >-
            The closing price for the interval, represented as a string-encoded
            decimal with up to 18 digits after the decimal point.
          example: '9.000000000000000000'
      required:
        - timestamp
        - open
        - high
        - low
        - close
  securitySchemes:
    apiKey:
      type: apiKey
      name: x-api-key
      in: header

````