- Blockchain Networks
- DEXs
- Pool Contract Address
- Token Contract Address
Blockchain Networks
Notes
- Please do not use CoinGecko Asset Platform ID as the Network ID in Onchain DEX API Endpoints (CoinGecko Asset Platform ID ≠ GT Network ID)
-
Example:
- Asset Platform on CoinGecko:
ethereum
- Onchain Network ID:
eth
- Asset Platform on CoinGecko:
-
Use /onchain/networks endpoint, example of response:
-
Go to GeckoTerminal
- Select or search for a blockchain network.
- Copy the slug from the URL:
DEXs
Some of the pools endpoints require you to provide DEX ID along with Network ID to query the pools on a particular DEX (Decentralized Exchange). Using /onchain/networks/{network}/dexes/{dex}/pools as example:https://pro-api.coingecko.com/api/v3/onchain/networks/eth/dexes/uniswap_v3/pools?x_cg_pro_api_key=YOUR_API_KEY
network
:eth
(network ID)dex
:uniswap_v3
(DEX ID)
-
Use /onchain/networks/{network}/dexes endpoint, example of response:
-
Go to GeckoTerminal
- Select or search for a blockchain network.
- Choose the DEX from the DEXs List on the top (e.g. Uniswap V3).
- Copy the slug from the URL:
Methods to query Onchain Data
a. Pool Contract Address
Most of the time, you will need a pool contract address along with Network ID to query the onchain data, especially when using the Pools Endpoints. Using /onchain/networks/{network}/pools/{address} as example:https://pro-api.coingecko.com/api/v3/onchain/networks/eth/pools/0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc?x_cg_pro_api_key=YOUR_API_KEY
network
:eth
(network ID)address
:0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc
(pool contract address)
WETH/USDC
)
-
Look for the contract address section of pool page on GeckoTerminal:
- Get the pool contract address from the project website, white-paper, documentation, or block explorer site:
b. Token Contract Address
Apart from the pool contract address, you also have the option to query onchain data by using the token contract address, using /onchain/networks/{network}/tokens/{token_address}/pools as example:https://pro-api.coingecko.com/api/v3/onchain/networks/eth/tokens/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48/pools?x_cg_pro_api_key=YOUR_API_KEY
network
:eth
(network ID)address
:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
(token contract address)
-
Look for the contract address section of pool page on GeckoTerminal:
- Get the token contract address from the project website, white-paper, documentation, or block explorer site. For example: