> ## 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 Historical Chart Data within Time Range by Token Address

> To get the historical chart data within certain time range in UNIX along with price, market cap and 24hrs volume based on asset platform and particular token contract address

export const CacheInfo = ({publicRate, paidRate, rate}) => {
  const fmt = v => v === 0 ? 'Real-time (Cacheless)' : `Every ${v}`;
  if (rate !== undefined) {
    return <Callout icon="clock-rotate-left" color="#2196F3" iconType="regular">
        <strong>Cache / Update Frequency:</strong><br />{fmt(rate)}
      </Callout>;
  }
  if (publicRate !== undefined && paidRate !== undefined) {
    return <Callout icon="clock-rotate-left" color="#2196F3" iconType="regular">
        <strong>Cache / Update Frequency:</strong><ul><li>{fmt(paidRate)} (Paid API)</li><li>{fmt(publicRate)} (Demo / Keyless API)</li></ul>
      </Callout>;
  }
  return null;
};

#### Notes

* Find a token's contract address on its [CoinGecko](https://www.coingecko.com) page or via [Coins List](/reference/coins-list) with `include_platform=true`.

* Accepts ISO date strings (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`, recommended) or UNIX timestamps for `from` and `to`.

* Auto-granularity when `interval` is not specified:

  | Date range | Granularity |
  | - | - |
  | 1 day from current time | **5-minutely** |
  | 1 day from any other time | **hourly** |
  | 2–90 days | **hourly** |
  | Above 90 days | **daily** (00:00 UTC) |

* Enterprise plan subscribers can bypass auto-granularity:

  | `interval` | Per request |
  | - | - |
  | `hourly` | **Any 100 days** |
  | `5m` | **Any 10 days** |
  | `1m` | **Any 1 day** (**Beta**) |

* Data availability: `1m` from 1 Jun 2026, `5m` from 9 Feb 2018, `hourly` from 30 Jan 2018.

<Note>
  The last completed UTC day (00:00) is available 35 minutes after midnight (00:35 UTC). Cache expires at 00:40 UTC.
</Note>

<Warning>
  Historical data on the **Basic plan** is restricted to the past 2 years. Subscribe to [Analyst plan & above](https://www.coingecko.com/en/api/pricing) for the full range.
</Warning>

<CacheInfo rate="5 minutes" />

#### SDK Examples

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.coins.contract.marketChart.getRange('0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', {
    id: 'ethereum',
    vs_currency: 'usd',
    from: '2025-12-22',
    to: '2025-12-31',
  });

  console.log(JSON.stringify(response, null, 2));
  ```

  ```python Python theme={null}
  response = client.coins.contract.market_chart.get_range(
    "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    id="ethereum",
    vs_currency="usd",
    from_="2025-12-22",
    to="2025-12-31",
  )

  print(response.model_dump_json(indent=2))
  ```
</CodeGroup>


## OpenAPI

````yaml openapi-specs/pro-api.json get /coins/{id}/contract/{contract_address}/market_chart/range
openapi: 3.0.0
info:
  title: CoinGecko Pro API
  version: 3.0.0
servers:
  - url: https://pro-api.coingecko.com/api/v3
security:
  - headerAuth: []
  - queryAuth: []
paths:
  /coins/{id}/contract/{contract_address}/market_chart/range:
    get:
      summary: Coin Historical Chart Data within Time Range by Token Address
      description: >-
        To get the historical chart data within certain time range in UNIX along
        with price, market cap and 24hrs volume based on asset platform and
        particular token contract address
      operationId: contract-address-market-chart-range
      parameters:
        - name: id
          in: path
          required: true
          description: |-
            Asset platform ID. 
            *refers to [`/asset_platforms`](/reference/asset-platforms-list).
          schema:
            type: string
            default: ethereum
        - name: contract_address
          in: path
          required: true
          description: The contract address of token.
          schema:
            type: string
            default: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
        - name: vs_currency
          in: query
          required: true
          description: >-
            Target currency of market data. 

            *refers to
            [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies).
          schema:
            type: string
            default: usd
        - name: from
          in: query
          required: true
          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.**
          schema:
            type: string
            default: '2025-12-22'
        - name: to
          in: query
          required: true
          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.**
          schema:
            type: string
            default: '2025-12-31'
        - name: interval
          in: query
          required: false
          description: Data interval, leave empty for auto granularity.
          schema:
            type: string
            enum:
              - 1m
              - 5m
              - hourly
              - daily
        - name: precision
          in: query
          required: false
          description: Decimal place for currency price value.
          schema:
            type: string
            enum:
              - full
              - '0'
              - '1'
              - '2'
              - '3'
              - '4'
              - '5'
              - '6'
              - '7'
              - '8'
              - '9'
              - '10'
              - '11'
              - '12'
              - '13'
              - '14'
              - '15'
              - '16'
              - '17'
              - '18'
      responses:
        '200':
          description: Coin historical chart data within time range by token address
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoinsMarketChart'
              example:
                prices:
                  - - 1735689600000
                    - 1.000540738607754
                  - - 1735776000000
                    - 0.9995995563541714
                market_caps:
                  - - 1735689600000
                    - 43945617394.42927
                  - - 1735776000000
                    - 43740787028.36501
                total_volumes:
                  - - 1735689600000
                    - 6544488766.849924
                  - - 1735776000000
                    - 5447401746.320422
components:
  schemas:
    CoinsMarketChart:
      type: object
      required:
        - prices
        - market_caps
        - total_volumes
      properties:
        prices:
          type: array
          description: Price data points as [timestamp, price] pairs
          items:
            type: array
            items:
              type: number
        market_caps:
          type: array
          description: Market cap data points as [timestamp, market_cap] pairs
          items:
            type: array
            items:
              type: number
        total_volumes:
          type: array
          description: Total volume data points as [timestamp, volume] pairs
          items:
            type: array
            items:
              type: number
  securitySchemes:
    headerAuth:
      type: apiKey
      in: header
      name: x-cg-pro-api-key
      description: >-
        Learn how to [set up your API
        key](https://docs.coingecko.com/docs/setting-up-your-api-key)
    queryAuth:
      type: apiKey
      in: query
      name: x_cg_pro_api_key
      description: >-
        Learn how to [set up your API
        key](https://docs.coingecko.com/docs/setting-up-your-api-key)

````

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