> ## 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 Price by Token Addresses

> To get token price based on the provided token contract 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;
};

#### Notes

* Prices are returned in USD. Addresses not found in GeckoTerminal will be ignored.
* Supports up to **30 contract addresses** per request. [Analyst plan or above](https://www.coingecko.com/en/api/pricing) supports up to 100.
* Unverified token market cap returns `null`. Use `mcap_fdv_fallback=true` to return FDV value (as seen on [GeckoTerminal](https://www.geckoterminal.com/)) when market cap data is unavailable.
* GeckoTerminal's routing selects the best pool for pricing based on liquidity and activity. For full control, use [Specific Pool Data](/demo/reference/pool-address) with a specific pool address.
* Set `include_inactive_source=true` to expand the search to recently active pools (up to 1 year) if no top pool is found.

<CacheInfo paidRate={0} publicRate="60 seconds" />

#### SDK Examples

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.onchain.simple.networks.tokenPrice.getAddresses('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', {
    network: 'eth',
  });

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

  ```python Python theme={null}
  response = client.onchain.simple.networks.token_price.get_addresses(
    "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    network="eth",
  )

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


## OpenAPI

````yaml openapi-specs/demo-api.json get /onchain/simple/networks/{network}/token_price/{addresses}
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:
  /onchain/simple/networks/{network}/token_price/{addresses}:
    get:
      summary: Token Price by Token Addresses
      description: >-
        To get token price based on the provided token contract address on a
        network
      operationId: onchain-simple-price
      parameters:
        - name: network
          in: path
          required: true
          description: |-
            Network ID. 
            *refers to [`/onchain/networks`](/reference/networks-list).
          schema:
            type: string
            default: eth
        - name: addresses
          in: path
          required: true
          description: >-
            Token contract address, comma-separated if more than one token
            contract address.
          schema:
            type: string
            default: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
        - name: include_market_cap
          in: query
          required: false
          description: |-
            Include market capitalization. 
            Default: `false`
          schema:
            type: boolean
        - name: mcap_fdv_fallback
          in: query
          required: false
          description: |-
            Return FDV if market cap is not available. 
            Default: `false`
          schema:
            type: boolean
        - name: include_24hr_vol
          in: query
          required: false
          description: |-
            Include 24hr volume. 
            Default: `false`
          schema:
            type: boolean
        - name: include_24hr_price_change
          in: query
          required: false
          description: |-
            Include 24hr price change. 
            Default: `false`
          schema:
            type: boolean
        - name: include_total_reserve_in_usd
          in: query
          required: false
          description: |-
            Include total reserve in USD. 
            Default: `false`
          schema:
            type: boolean
        - name: include_inactive_source
          in: query
          required: false
          description: >-
            Include token price data from inactive pools using the most recent
            swap. 

            Default: `false`
          schema:
            type: boolean
      responses:
        '200':
          description: Token price data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OnchainSimplePrice'
              example:
                data:
                  id: 49dd0b90-d99d-48b6-8fe2-03e826fbcef2
                  type: simple_token_price
                  attributes:
                    token_prices:
                      '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2': '2084.57379936447'
                    market_cap_usd:
                      '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2': '4706652516.682727'
                    h24_volume_usd:
                      '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2': '313441016.145429'
                    h24_price_change_percentage:
                      '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2': '-1.8867250098940773'
                    total_reserve_in_usd:
                      '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2': '1015673598.896450024556193850116628967'
                    last_trade_timestamp:
                      '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2': '1779882383'
components:
  schemas:
    OnchainSimplePrice:
      type: object
      required:
        - data
      properties:
        data:
          type: object
          required:
            - id
            - type
            - attributes
          properties:
            id:
              type: string
              description: Request ID
            type:
              type: string
              description: Response type
            attributes:
              type: object
              required:
                - token_prices
              properties:
                token_prices:
                  type: object
                  description: Token prices keyed by contract address
                  additionalProperties:
                    type: string
                market_cap_usd:
                  type: object
                  description: Market cap in USD keyed by contract address
                  additionalProperties:
                    type: string
                h24_volume_usd:
                  type: object
                  description: 24hr volume in USD keyed by contract address
                  additionalProperties:
                    type: string
                h24_price_change_percentage:
                  type: object
                  description: 24hr price change percentage keyed by contract address
                  additionalProperties:
                    type: string
                total_reserve_in_usd:
                  type: object
                  description: Total reserve in USD keyed by contract address
                  additionalProperties:
                    type: string
                last_trade_timestamp:
                  type: object
                  description: Last trade timestamp keyed by contract address
                  additionalProperties:
                    type: string
  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)

````