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

# Token OHLCV Chart by Token Address

> To get the OHLCV chart (Open, High, Low, Close, Volume) of a token based on the provided token address on a network

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

export const PlanExclusivity = ({tier}) => {
  if (tier === "enterprise") {
    return <Callout icon="crown" color="#FFC107" iconType="regular">
        <strong>Enterprise Only</strong><br />This endpoint is exclusively available to <strong>Enterprise</strong> plan.<br /><a href="https://www.coingecko.com/en/api/enterprise">→ Contact sales</a>
      </Callout>;
  }
  if (tier === "analyst_above") {
    return <Callout icon="briefcase" color="#FFC107" iconType="regular">
        <strong>Analyst Plan and Above</strong><br />This endpoint is only available to <strong>Analyst, Lite, Pro, and Enterprise</strong> plan.<br /><a href="https://www.coingecko.com/en/api/pricing">→ View pricing</a>
      </Callout>;
  }
  if (tier === "basic_above") {
    return <Callout icon="briefcase" color="#FFC107" iconType="regular">
        <strong>Basic Plan and Above</strong><br />This endpoint is only available to <strong>Basic, Analyst, Lite, Pro, and Enterprise</strong> plan.<br /><a href="https://www.coingecko.com/en/api/pricing">→ View pricing</a>
      </Callout>;
  }
  throw new Error(`PlanExclusivity: invalid tier "${tier}". Use "basic_above", "analyst_above", or "enterprise".`);
};

#### Notes

* Returns OHLCV data from the **most liquid pool** of the token. Use [Top Pools by Token Address](/reference/top-pools-contract-address) to check which pool is used.
* Timestamps use epoch/unix format (e.g. `1708850449`).
* [Analyst plan and above](https://www.coingecko.com/en/api/pricing) can access data from **September 2021 to present** (depending on pool tracking start). Each call retrieves a **max 6-month range** — use `before_timestamp` for older data.
* Each `ohlcv_list` element:
  ```
  [
    timestamp,
    open,
    high,
    low,
    close,
    volume
  ]
  ```
* Intervals with no swaps are skipped by default. Set `include_empty_intervals=true` to fill gaps (OHLC = previous close, volume = 0).

<PlanExclusivity tier="analyst_above" />

<CacheInfo rate="10 seconds" />

#### SDK Examples

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.onchain.networks.tokens.ohlcv.getTimeframe('day', {
    network: 'solana',
    token_address: 'So11111111111111111111111111111111111111112',
  });

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

  ```python Python theme={null}
  response = client.onchain.networks.tokens.ohlcv.get_timeframe(
    "day",
    network="solana",
    token_address="So11111111111111111111111111111111111111112",
  )

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


## OpenAPI

````yaml openapi-specs/pro-api.json get /onchain/networks/{network}/tokens/{token_address}/ohlcv/{timeframe}
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:
  /onchain/networks/{network}/tokens/{token_address}/ohlcv/{timeframe}:
    get:
      summary: Token OHLCV Chart by Token Address
      description: >-
        To get the OHLCV chart (Open, High, Low, Close, Volume) of a token based
        on the provided token address on a network
      operationId: token-ohlcv-token-address
      parameters:
        - name: network
          in: path
          required: true
          description: |-
            Network ID. 
            *refers to [`/onchain/networks`](/reference/networks-list).
          schema:
            type: string
            default: solana
        - name: token_address
          in: path
          required: true
          description: Token contract address.
          schema:
            type: string
            default: So11111111111111111111111111111111111111112
        - name: timeframe
          in: path
          required: true
          description: Timeframe of the OHLCV chart.
          schema:
            type: string
            default: day
            enum:
              - day
              - hour
              - minute
              - second
        - name: aggregate
          in: query
          required: false
          description: |-
            Time period to aggregate each OHLCV. 
            Available values (day): `1` 
            Available values (hour): `1`, `4`, `12` 
            Available values (minute): `1`, `5`, `15` 
            Available values (second): `1`, `15`, `30` 
            Default value: 1
          schema:
            type: string
        - name: before_timestamp
          in: query
          required: false
          description: >-
            Return OHLCV data before this timestamp (integer seconds since
            epoch).
          schema:
            type: integer
        - name: limit
          in: query
          required: false
          description: |-
            Number of OHLCV results to return, maximum 1000. 
            Default value: 100
          schema:
            type: integer
        - name: currency
          in: query
          required: false
          description: |-
            Return OHLCV in USD or quote token. 
            Default: `usd`
          schema:
            type: string
            enum:
              - usd
              - token
        - name: include_empty_intervals
          in: query
          required: false
          description: |-
            Include empty intervals with no trade data. 
            Default: `false`
          schema:
            type: boolean
        - name: include_inactive_source
          in: query
          required: false
          description: |-
            Include token data from inactive pools using the most recent swap. 
            Default: `false`
          schema:
            type: boolean
      responses:
        '200':
          description: Token OHLCV chart data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OHLCV'
              example:
                data:
                  id: 2dea0d2f-bf0f-4fa6-a934-db61d9375dbe
                  type: ohlcv_request_response
                  attributes:
                    ohlcv_list:
                      - - 1779926400
                        - 82.26780088646034
                        - 83.8971583220568
                        - 79.9616
                        - 80.4112417847994
                        - 31314919.221351475
                      - - 1779840000
                        - 83.65257586508716
                        - 84.8896434634975
                        - 81.99
                        - 82.26780088646034
                        - 118334565.59596911
                meta:
                  base:
                    name: Wrapped SOL
                    symbol: SOL
                    coingecko_coin_id: wrapped-solana
                    address: So11111111111111111111111111111111111111112
                  quote:
                    name: USD Coin
                    symbol: USDC
                    coingecko_coin_id: usd-coin
                    address: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
components:
  schemas:
    OHLCV:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: object
          required:
            - id
            - type
            - attributes
          properties:
            id:
              type: string
              description: Request ID
            type:
              type: string
              description: Resource type
            attributes:
              type: object
              required:
                - ohlcv_list
              properties:
                ohlcv_list:
                  type: array
                  description: >-
                    OHLCV data as [timestamp, open, high, low, close, volume]
                    arrays
                  items:
                    type: array
                    items:
                      type: number
        meta:
          type: object
          properties:
            base:
              type: object
              description: Base token metadata
              properties:
                name:
                  type: string
                symbol:
                  type: string
                coingecko_coin_id:
                  type: string
                  nullable: true
                address:
                  type: string
            quote:
              type: object
              description: Quote token metadata
              properties:
                name:
                  type: string
                symbol:
                  type: string
                coingecko_coin_id:
                  type: string
                  nullable: true
                address:
                  type: string
  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)

````