> ## 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

#### Notes

* Find a token's contract address on its [CoinGecko](https://www.coingecko.com) page or via [Coins List](/demo/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:
  * 1 day from current time = **5-minutely** data
  * 1 day from any other time = **hourly** data
  * 2–90 days = **hourly** data
  * Above 90 days = **daily** data (00:00 UTC)

<Callout icon="clock-rotate-left" color="#2196F3" iconType="regular">
  **Cache / Update Frequency:**

  | Date Range    | Cache      |
  | ------------- | ---------- |
  | 1 day         | 30 seconds |
  | 2–90 days     | 30 minutes |
  | Above 90 days | 12 hours   |
</Callout>

<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 via the Demo API is restricted to the past 365 days. Subscribe to a [paid plan](https://www.coingecko.com/en/api/pricing) for the full range.
</Warning>

#### SDK Examples

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

  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_="1767024000",
    to="1777564800",
  )

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


## OpenAPI

````yaml openapi-specs/demo-api.json get /coins/{id}/contract/{contract_address}/market_chart/range
openapi: 3.0.0
info:
  title: CoinGecko Demo API
  version: 3.0.0
servers:
  - url: https://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 UNIX timestamp.
          schema:
            type: integer
            default: '1767024000'
        - name: to
          in: query
          required: true
          description: Ending date in UNIX timestamp.
          schema:
            type: integer
            default: '1777564800'
        - 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-demo-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_demo_api_key
      description: >-
        Learn how to [set up your API
        key](https://docs.coingecko.com/docs/setting-up-your-api-key)

````