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

# 💼 Coin OHLC Chart within Time Range by ID

> This endpoint allows you to **get the OHLC chart (Open, High, Low, Close) of a coin within a range of timestamps based on particular coin ID**

<Tip>
  ### Tips

  * You may obtain the coin ID (API ID) via several ways:
    * Refer to respective coin page and find 'API ID'.
    * Refer to [`/coins/list`](/reference/coins-list) endpoint.
    * Refer to Google Sheets [here](https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?usp=sharing).
  * For historical chart data with better granularity, you may consider using [/coins/\{id}/market\_chart](/reference/coins-id-market-chart) endpoint.
  * Supports ISO date strings (`YYYY-MM-DD` or\
    `YYYY-MM-DDTHH:MM`, recommended for best compatibility) or UNIX timestamps.
</Tip>

<Note>
  ### Note

  * The timestamp displayed in the payload (response) indicates the end (or close) time of the OHLC data.
  * Interval Options:
    * Daily Interval (`interval=daily`):
      * up to 180 days per request / 180 daily interval candles.
    * Hourly Interval (`interval=hourly`):
      * up to 31 days per request / 744 hourly interval candles.
  * Data availability:
    * Available from 9 February 2018 onwards (`1518147224` epoch time).
  * Exclusive for Paid Plan Subscribers (Analyst, Lite, Pro and Enterprise).
  * Cache / Update Frequency:
    * Every 15 minutes for all the API plans.
</Note>


## OpenAPI

````yaml api-reference/coingecko-pro.json get /coins/{id}/ohlc/range
openapi: 3.0.0
info:
  title: CoinGecko Pro API
  version: 3.0.0
servers:
  - url: https://pro-api.coingecko.com/api/v3
security:
  - apiKeyAuth: []
  - apiKeyQueryParam: []
paths:
  /coins/{id}/ohlc/range:
    get:
      tags:
        - Coins
      summary: 💼 Coin OHLC Chart within Time Range by ID
      description: >-
        This endpoint allows you to **get the OHLC chart (Open, High, Low,
        Close) of a coin within a range of timestamp based on particular coin
        ID**
      operationId: coins-id-ohlc-range
      parameters:
        - name: id
          in: path
          description: |-
            coin ID 
             *refers to [`/coins/list`](/reference/coins-list).
          required: true
          schema:
            type: string
            example: bitcoin
            default: bitcoin
        - name: vs_currency
          in: query
          description: |-
            target currency of price data 
             *refers to [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies).
          required: true
          schema:
            type: string
            example: usd
            default: usd
        - name: from
          in: query
          description: >-
            starting date in ISO date string (`YYYY-MM-DD` or
            `YYYY-MM-DDTHH:MM`) or UNIX timestamp. 
             **use ISO date string for best compatibility**
          required: true
          schema:
            type: string
            default: '2024-01-01'
          examples:
            iso_date:
              value: '2024-01-01'
            iso_datetime:
              value: 2024-01-01T00:00
            unix_timestamp:
              value: '1609459200'
        - name: to
          in: query
          description: >-
            ending date in ISO date string (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`)
            or UNIX timestamp. 
             **use ISO date string for best compatibility**
          required: true
          schema:
            type: string
            default: '2024-12-31'
          examples:
            iso_date:
              value: '2024-12-31'
            iso_datetime:
              value: 2024-12-31T23:59
            unix_timestamp:
              value: '1640995200'
        - name: interval
          in: query
          description: data interval
          required: true
          schema:
            type: string
            enum:
              - daily
              - hourly
      responses:
        '200':
          description: Get coin's OHLC within time range
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoinsOHLC'
components:
  schemas:
    CoinsOHLC:
      type: array
      items:
        type: array
        items:
          type: number
      example:
        - - 1709395200000
          - 61942
          - 62211
          - 61721
          - 61845
        - - 1709409600000
          - 61828
          - 62139
          - 61726
          - 62139
        - - 1709424000000
          - 62171
          - 62210
          - 61821
          - 62068
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-cg-pro-api-key
    apiKeyQueryParam:
      type: apiKey
      in: query
      name: x_cg_pro_api_key

````