> ## 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 by Token Address

> To get the historical chart data including time in UNIX, 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](/demo/reference/coins-list) with `include_platform=true`.
* Auto-granularity when `interval` is not specified:
  * 1 day from current time = **5-minutely** data
  * 2–90 days = **hourly** data
  * Above 90 days = **daily** data (00:00 UTC)

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

<CacheInfo rate="5 minutes" />

#### SDK Examples

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.coins.contract.marketChart.get('0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', {
    id: 'ethereum',
    vs_currency: 'usd',
    days: '1',
  });

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

  ```python Python theme={null}
  response = client.coins.contract.market_chart.get(
    "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    id="ethereum",
    vs_currency="usd",
    days="1",
  )

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


## OpenAPI

````yaml openapi-specs/demo-api.json get /coins/{id}/contract/{contract_address}/market_chart
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:
    get:
      summary: Coin Historical Chart Data by Token Address
      description: >-
        To get the historical chart data including time in UNIX, price, market
        cap and 24hrs volume based on asset platform and particular token
        contract address
      operationId: contract-address-market-chart
      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: days
          in: query
          required: true
          description: |-
            Data up to number of days ago. 
            You may use any integer or `max` for number of days.
          schema:
            type: string
            default: '1'
        - name: interval
          in: query
          required: false
          description: Data interval, leave empty for auto granularity.
          schema:
            type: string
            enum:
              - daily
              - hourly
        - 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 by token address
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoinsMarketChart'
              example:
                prices:
                  - - 1779619498604
                    - 0.9997624087636037
                  - - 1779619877081
                    - 0.9997817655336941
                market_caps:
                  - - 1779619498604
                    - 76419636272.78033
                  - - 1779619877081
                    - 76424065983.84229
                total_volumes:
                  - - 1779619498604
                    - 9374311493.936354
                  - - 1779619877081
                    - 9390008044.485624
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)

````