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

# Querying Onchain Data

> Network IDs, DEX IDs, pool and token queries, and common onchain API patterns

Onchain endpoints use identifiers from [GeckoTerminal](https://www.geckoterminal.com), not CoinGecko.

<Warning>
  CoinGecko Asset Platform IDs and GeckoTerminal Network IDs are **not** the same.

  * Asset Platform: `ethereum`
  * Network ID: `eth`

  Always use Network IDs for `/onchain` endpoints.
</Warning>

## Finding Network IDs

Use [/onchain/networks](/reference/networks-list), or copy the slug from a GeckoTerminal URL: `geckoterminal.com/`**`eth`**`/pools/...`

```json {2} theme={null}
{
  "id": "eth",
  "type": "network",
  "attributes": {
    "name": "Ethereum",
    "coingecko_asset_platform_id": "ethereum"
  }
}
```

## Finding DEX IDs

Use [/onchain/networks/\{network}/dexes](/reference/dexes-list), or copy from a GeckoTerminal URL: `geckoterminal.com/eth/`**`uniswap_v3`**

```json {2} theme={null}
{
  "id": "uniswap_v3",
  "type": "dex",
  "attributes": {
    "name": "Uniswap V3"
  }
}
```

## Querying by Pool Address

**network ID + pool address** — e.g. [/onchain/networks/\{network}/pools/\{address}](/reference/pool-address):

```bash wrap theme={null}
https://pro-api.coingecko.com/api/v3/onchain/networks/eth/pools/0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc
```

Find pool addresses on the pool page at [GeckoTerminal](https://www.geckoterminal.com):

<Frame>
  <img src="https://mintcdn.com/coingecko/i9l2MT4etZGYjSx8/assets/images/get-gt-pool-addr.png?fit=max&auto=format&n=i9l2MT4etZGYjSx8&q=85&s=54c29ddaf21978fb6edadd9d1cc9e40b" width="2996" height="1602" data-path="assets/images/get-gt-pool-addr.png" />
</Frame>

## Querying by Token Address

**network ID + token address** — e.g. [/onchain/networks/\{network}/tokens/\{address}/pools](/reference/top-pools-contract-address):

```bash wrap theme={null}
https://pro-api.coingecko.com/api/v3/onchain/networks/eth/tokens/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48/pools
```

Find token addresses on the token page at [GeckoTerminal](https://www.geckoterminal.com):

<Frame>
  <img src="https://mintcdn.com/coingecko/i9l2MT4etZGYjSx8/assets/images/get-gt-token-addr.png?fit=max&auto=format&n=i9l2MT4etZGYjSx8&q=85&s=6cf6a1be06a8673951bf8f53e5a35cfc" width="2996" height="1602" data-path="assets/images/get-gt-token-addr.png" />
</Frame>

***

## Common Patterns

| Pattern                      | How                                                                                                                                       |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **Pool liquidity**           | Use [Pool Data](/reference/pool-address)<br />Read `reserve_in_usd`                                                                       |
| **Token liquidity**          | Use [Token Data](/reference/token-data-contract-address)<br />Read `total_reserve_in_usd` (across all pools)                              |
| **Filter pools**             | Use [/pools/megafilter](/reference/pools-megafilter)<br />Filter by liquidity, FDV, volume, network, DEX                                  |
| **Launchpad data**           | Use [/pools/megafilter](/reference/pools-megafilter)<br />Set `sort=pool_created_at_desc` and filter by DEX                               |
| **Token security**           | Use [Token Info](/reference/token-info-contract-address)<br />Returns GT scores, holder distribution, mint/freeze authority               |
| **Inactive tokens**          | Set `include_inactive_source=true` on supported endpoints<br />Read `last_trade_timestamp` for last swap time                             |
| **CoinGecko vs GT networks** | **CoinGecko:** [/asset\_platforms](/reference/asset-platforms-list)<br />**GeckoTerminal:** [/onchain/networks](/reference/networks-list) |
