Skip to content

Instantly share code, notes, and snippets.

@Klaudioz
Created October 7, 2024 14:40
Show Gist options
  • Save Klaudioz/4d2b44becf14006d7b6dcc69a540ce32 to your computer and use it in GitHub Desktop.
Save Klaudioz/4d2b44becf14006d7b6dcc69a540ce32 to your computer and use it in GitHub Desktop.
CoinGecko API
Check API server status
get
https://pro-api.coingecko.com/api/v3/ping
This endpoint allows you to check the API server status.
πŸ“˜
Notes
You can also go to status.coingecko.com to check the API server status and further maintenance notices
async def test_pro_api_key(session):
url = f"{BASE_URL}/ping"
headers = {
'accept': 'application/json',
'x-cg-pro-api-key': API_KEY
}
try:
async with session.get(url, headers=headers) as response:
response.raise_for_status()
data = await response.json()
return data.get('gecko_says') == "(V3) To the Moon!"
except Exception:
return False
Token Price by Token Addresses
get
https://pro-api.coingecko.com/api/v3/onchain/simple/networks/{network}/token_price/{addresses}
This endpoint allows you to get token price based on the provided token contract address on a network
The returned price currency is in USD
Addresses not found in GeckoTerminal will be ignored
When using this endpoint, GeckoTerminal's routing decides the best pool for token price. The price source may change based on liquidity and pool activity. For full control over the price, you may use /networks/{network}/pools/{address} endpoint by providing a specific pool address.
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/simple/networks/network/token_price/addresses"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": {
"id": "1ba898f0-eda2-4291-9491-9a5b323f66ef",
"type": "simple_token_price",
"attributes": {
"token_prices": {
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": "3639.78228844745"
}
}
}
}
Supported Networks List (ID Map)
get
https://pro-api.coingecko.com/api/v3/onchain/networks
This endpoint allows you to query all the supported networks on GeckoTerminal
πŸ‘
Tips
You may use this endpoint to query the list of networks with network id for other endpoints that contain params like network
You may include values such as page to specify which page of responses you would like to show
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "eth",
"type": "network",
"attributes": {
"name": "Ethereum",
"coingecko_asset_platform_id": "ethereum"
}
},
{
"id": "bsc",
"type": "network",
"attributes": {
"name": "BNB Chain",
"coingecko_asset_platform_id": "binance-smart-chain"
}
},
{
"id": "polygon_pos",
"type": "network",
"attributes": {
"name": "Polygon POS",
"coingecko_asset_platform_id": "polygon-pos"
}
}
]
}
Supported Dexes List by Network (ID Map)
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/dexes
This endpoint allows you to query all the supported decentralized exchanges (dexes) based on the provided network on GeckoTerminal
πŸ‘
Tips
You may use this endpoint to query the list of dexes with dex id for other endpoints that contain params like dex
You may include values such as page to specify which page of responses you would like to show
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/network/dexes"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "uniswap_v2",
"type": "dex",
"attributes": {
"name": "Uniswap V2"
}
},
{
"id": "sushiswap",
"type": "dex",
"attributes": {
"name": "SushiSwap"
}
},
{
"id": "uniswap_v3",
"type": "dex",
"attributes": {
"name": "Uniswap V3"
}
}
]
}
Trending Pools List
get
https://pro-api.coingecko.com/api/v3/onchain/networks/trending_pools
This endpoint allows you to query all the trending pools across all networks on GeckoTerminal
πŸ‘
Tips
You may include values such as page to specify which page of responses you would like to show
πŸ“˜
Notes
If the token's market cap is not verified by the team, the API response will return null for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV)
Attributes specified in the include params will be included under the "included" key at the top level
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/trending_pools"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "eth_0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"type": "pool",
"attributes": {
"base_token_price_usd": "3653.12491645176",
"base_token_price_native_currency": "1.0",
"quote_token_price_usd": "0.998343707926245",
"quote_token_price_native_currency": "0.000273040545093221",
"base_token_price_quote_token": "3662.46",
"quote_token_price_base_token": "0.00027304",
"address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"name": "WETH / USDC 0.05%",
"pool_created_at": "2021-12-29T12:35:14Z",
"fdv_usd": "11007041041",
"market_cap_usd": null,
"price_change_percentage": {
"m5": "0",
"h1": "0.51",
"h6": "0.86",
"h24": "7.71"
},
"transactions": {
"m5": {
"buys": 7,
"sells": 2,
"buyers": 7,
"sellers": 2
},
"m15": {
"buys": 19,
"sells": 27,
"buyers": 19,
"sellers": 27
},
"m30": {
"buys": 49,
"sells": 61,
"buyers": 45,
"sellers": 57
},
"h1": {
"buys": 97,
"sells": 144,
"buyers": 83,
"sellers": 124
},
"h24": {
"buys": 2966,
"sells": 3847,
"buyers": 1625,
"sellers": 2399
}
},
"volume_usd": {
"m5": "868581.7348314",
"h1": "16798158.0138526",
"h6": "164054610.850188",
"h24": "536545444.904535"
},
"reserve_in_usd": "163988541.3812"
},
"relationships": {
"base_token": {
"data": {
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token"
}
},
"quote_token": {
"data": {
"id": "eth_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type": "token"
}
},
"dex": {
"data": {
"id": "uniswap_v3",
"type": "dex"
}
}
}
}
],
"included": [
{
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token",
"attributes": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"image_url": "https://assets.coingecko.com/coins/images/2518/small/weth.png?1696503332",
"coingecko_coin_id": "weth"
}
}
]
}
Trending Pools by Network
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/trending_pools
This endpoint allows you to query the trending pools based on the provided network
πŸ‘
Tips
You may include values such as page to specify which page of responses you would like to show
πŸ“˜
Notes
If the token's market cap is not verified by the team, the API response will return null for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV)
Attributes specified in the include params will be included under the "included" key at the top level
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/network/trending_pools"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "eth_0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"type": "pool",
"attributes": {
"base_token_price_usd": "3653.12491645176",
"base_token_price_native_currency": "1.0",
"quote_token_price_usd": "0.998343707926245",
"quote_token_price_native_currency": "0.000273040545093221",
"base_token_price_quote_token": "3662.46",
"quote_token_price_base_token": "0.00027304",
"address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"name": "WETH / USDC 0.05%",
"pool_created_at": "2021-12-29T12:35:14Z",
"fdv_usd": "11007041041",
"market_cap_usd": null,
"price_change_percentage": {
"m5": "0",
"h1": "0.51",
"h6": "0.86",
"h24": "7.71"
},
"transactions": {
"m5": {
"buys": 7,
"sells": 2,
"buyers": 7,
"sellers": 2
},
"m15": {
"buys": 19,
"sells": 27,
"buyers": 19,
"sellers": 27
},
"m30": {
"buys": 49,
"sells": 61,
"buyers": 45,
"sellers": 57
},
"h1": {
"buys": 97,
"sells": 144,
"buyers": 83,
"sellers": 124
},
"h24": {
"buys": 2966,
"sells": 3847,
"buyers": 1625,
"sellers": 2399
}
},
"volume_usd": {
"m5": "868581.7348314",
"h1": "16798158.0138526",
"h6": "164054610.850188",
"h24": "536545444.904535"
},
"reserve_in_usd": "163988541.3812"
},
"relationships": {
"base_token": {
"data": {
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token"
}
},
"quote_token": {
"data": {
"id": "eth_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type": "token"
}
},
"dex": {
"data": {
"id": "uniswap_v3",
"type": "dex"
}
}
}
}
],
"included": [
{
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token",
"attributes": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"image_url": "https://assets.coingecko.com/coins/images/2518/small/weth.png?1696503332",
"coingecko_coin_id": "weth"
}
}
]
}
Specific Pool Data by Pool Address
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/pools/{address}
This endpoint allows you to query the specific pool based on the provided network and pool address
πŸ“˜
Notes
Address not found in GeckoTerminal will be ignored
If the token's market cap is not verified by the team, the API response will return null for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV)
Attributes specified in the include params will be included under the "included" key at the top level
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/network/pools/address"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "eth_0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"type": "pool",
"attributes": {
"base_token_price_usd": "3653.12491645176",
"base_token_price_native_currency": "1.0",
"quote_token_price_usd": "0.998343707926245",
"quote_token_price_native_currency": "0.000273040545093221",
"base_token_price_quote_token": "3662.46",
"quote_token_price_base_token": "0.00027304",
"address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"name": "WETH / USDC 0.05%",
"pool_created_at": "2021-12-29T12:35:14Z",
"fdv_usd": "11007041041",
"market_cap_usd": null,
"price_change_percentage": {
"m5": "0",
"h1": "0.51",
"h6": "0.86",
"h24": "7.71"
},
"transactions": {
"m5": {
"buys": 7,
"sells": 2,
"buyers": 7,
"sellers": 2
},
"m15": {
"buys": 19,
"sells": 27,
"buyers": 19,
"sellers": 27
},
"m30": {
"buys": 49,
"sells": 61,
"buyers": 45,
"sellers": 57
},
"h1": {
"buys": 97,
"sells": 144,
"buyers": 83,
"sellers": 124
},
"h24": {
"buys": 2966,
"sells": 3847,
"buyers": 1625,
"sellers": 2399
}
},
"volume_usd": {
"m5": "868581.7348314",
"h1": "16798158.0138526",
"h6": "164054610.850188",
"h24": "536545444.904535"
},
"reserve_in_usd": "163988541.3812"
},
"relationships": {
"base_token": {
"data": {
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token"
}
},
"quote_token": {
"data": {
"id": "eth_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type": "token"
}
},
"dex": {
"data": {
"id": "uniswap_v3",
"type": "dex"
}
}
}
}
],
"included": [
{
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token",
"attributes": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"image_url": "https://assets.coingecko.com/coins/images/2518/small/weth.png?1696503332",
"coingecko_coin_id": "weth"
}
}
]
}
Multiple Pools Data by Pool Addresses
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/pools/multi/{addresses}
This endpoint allows you to query multiple pools based on the provided network and pool address
πŸ“˜
Notes
Addresses not found in GeckoTerminal will be ignored
If the token's market cap is not verified by the team, the API response will return null for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV)
Attributes specified in the include params will be included under the "included" key at the top level
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/network/pools/multi/addresses"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "eth_0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"type": "pool",
"attributes": {
"base_token_price_usd": "3653.12491645176",
"base_token_price_native_currency": "1.0",
"quote_token_price_usd": "0.998343707926245",
"quote_token_price_native_currency": "0.000273040545093221",
"base_token_price_quote_token": "3662.46",
"quote_token_price_base_token": "0.00027304",
"address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"name": "WETH / USDC 0.05%",
"pool_created_at": "2021-12-29T12:35:14Z",
"fdv_usd": "11007041041",
"market_cap_usd": null,
"price_change_percentage": {
"m5": "0",
"h1": "0.51",
"h6": "0.86",
"h24": "7.71"
},
"transactions": {
"m5": {
"buys": 7,
"sells": 2,
"buyers": 7,
"sellers": 2
},
"m15": {
"buys": 19,
"sells": 27,
"buyers": 19,
"sellers": 27
},
"m30": {
"buys": 49,
"sells": 61,
"buyers": 45,
"sellers": 57
},
"h1": {
"buys": 97,
"sells": 144,
"buyers": 83,
"sellers": 124
},
"h24": {
"buys": 2966,
"sells": 3847,
"buyers": 1625,
"sellers": 2399
}
},
"volume_usd": {
"m5": "868581.7348314",
"h1": "16798158.0138526",
"h6": "164054610.850188",
"h24": "536545444.904535"
},
"reserve_in_usd": "163988541.3812"
},
"relationships": {
"base_token": {
"data": {
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token"
}
},
"quote_token": {
"data": {
"id": "eth_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type": "token"
}
},
"dex": {
"data": {
"id": "uniswap_v3",
"type": "dex"
}
}
}
}
],
"included": [
{
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token",
"attributes": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"image_url": "https://assets.coingecko.com/coins/images/2518/small/weth.png?1696503332",
"coingecko_coin_id": "weth"
}
}
]
}
Top Pools by Network
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/pools
This endpoint allows you to query all the top pools based on the provided network
πŸ‘
Tips
You may include values such as page to specify which page of responses you would like to show
πŸ“˜
Notes
If the token's market cap is not verified by the team, the API response will return null for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV)
Attributes specified in the include params will be included under the "included" key at the top level
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/network/pools"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "eth_0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"type": "pool",
"attributes": {
"base_token_price_usd": "3653.12491645176",
"base_token_price_native_currency": "1.0",
"quote_token_price_usd": "0.998343707926245",
"quote_token_price_native_currency": "0.000273040545093221",
"base_token_price_quote_token": "3662.46",
"quote_token_price_base_token": "0.00027304",
"address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"name": "WETH / USDC 0.05%",
"pool_created_at": "2021-12-29T12:35:14Z",
"fdv_usd": "11007041041",
"market_cap_usd": null,
"price_change_percentage": {
"m5": "0",
"h1": "0.51",
"h6": "0.86",
"h24": "7.71"
},
"transactions": {
"m5": {
"buys": 7,
"sells": 2,
"buyers": 7,
"sellers": 2
},
"m15": {
"buys": 19,
"sells": 27,
"buyers": 19,
"sellers": 27
},
"m30": {
"buys": 49,
"sells": 61,
"buyers": 45,
"sellers": 57
},
"h1": {
"buys": 97,
"sells": 144,
"buyers": 83,
"sellers": 124
},
"h24": {
"buys": 2966,
"sells": 3847,
"buyers": 1625,
"sellers": 2399
}
},
"volume_usd": {
"m5": "868581.7348314",
"h1": "16798158.0138526",
"h6": "164054610.850188",
"h24": "536545444.904535"
},
"reserve_in_usd": "163988541.3812"
},
"relationships": {
"base_token": {
"data": {
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token"
}
},
"quote_token": {
"data": {
"id": "eth_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type": "token"
}
},
"dex": {
"data": {
"id": "uniswap_v3",
"type": "dex"
}
}
}
}
],
"included": [
{
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token",
"attributes": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"image_url": "https://assets.coingecko.com/coins/images/2518/small/weth.png?1696503332",
"coingecko_coin_id": "weth"
}
}
]
}
Top Pools by Dex
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/dexes/{dex}/pools
This endpoint allows you to query all the top pools based on the provided network and decentralized exchange (dex)
πŸ‘
Tips
You may include values such as page to specify which page of responses you would like to show
πŸ“˜
Notes
If the token's market cap is not verified by the team, the API response will return null for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV)
Attributes specified in the include params will be included under the "included" key at the top level
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/network/dexes/dex/pools"
headers = {"accept": "application/json, 'x-cg-pro-api-key': API_KEY"}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "eth_0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"type": "pool",
"attributes": {
"base_token_price_usd": "3653.12491645176",
"base_token_price_native_currency": "1.0",
"quote_token_price_usd": "0.998343707926245",
"quote_token_price_native_currency": "0.000273040545093221",
"base_token_price_quote_token": "3662.46",
"quote_token_price_base_token": "0.00027304",
"address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"name": "WETH / USDC 0.05%",
"pool_created_at": "2021-12-29T12:35:14Z",
"fdv_usd": "11007041041",
"market_cap_usd": null,
"price_change_percentage": {
"m5": "0",
"h1": "0.51",
"h6": "0.86",
"h24": "7.71"
},
"transactions": {
"m5": {
"buys": 7,
"sells": 2,
"buyers": 7,
"sellers": 2
},
"m15": {
"buys": 19,
"sells": 27,
"buyers": 19,
"sellers": 27
},
"m30": {
"buys": 49,
"sells": 61,
"buyers": 45,
"sellers": 57
},
"h1": {
"buys": 97,
"sells": 144,
"buyers": 83,
"sellers": 124
},
"h24": {
"buys": 2966,
"sells": 3847,
"buyers": 1625,
"sellers": 2399
}
},
"volume_usd": {
"m5": "868581.7348314",
"h1": "16798158.0138526",
"h6": "164054610.850188",
"h24": "536545444.904535"
},
"reserve_in_usd": "163988541.3812"
},
"relationships": {
"base_token": {
"data": {
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token"
}
},
"quote_token": {
"data": {
"id": "eth_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type": "token"
}
},
"dex": {
"data": {
"id": "uniswap_v3",
"type": "dex"
}
}
}
}
],
"included": [
{
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token",
"attributes": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"image_url": "https://assets.coingecko.com/coins/images/2518/small/weth.png?1696503332",
"coingecko_coin_id": "weth"
}
}
]
}
New Pools by Network
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/new_pools
This endpoint allows you to query all the latest pools based on provided network
πŸ‘
Tips
You may include values such as page to specify which page of responses you would like to show
πŸ“˜
Notes
If the token's market cap is not verified by the team, the API response will return null for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV)
Attributes specified in the include params will be included under the "included" key at the top level
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/network/new_pools"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "eth_0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"type": "pool",
"attributes": {
"base_token_price_usd": "3653.12491645176",
"base_token_price_native_currency": "1.0",
"quote_token_price_usd": "0.998343707926245",
"quote_token_price_native_currency": "0.000273040545093221",
"base_token_price_quote_token": "3662.46",
"quote_token_price_base_token": "0.00027304",
"address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"name": "WETH / USDC 0.05%",
"pool_created_at": "2021-12-29T12:35:14Z",
"fdv_usd": "11007041041",
"market_cap_usd": null,
"price_change_percentage": {
"m5": "0",
"h1": "0.51",
"h6": "0.86",
"h24": "7.71"
},
"transactions": {
"m5": {
"buys": 7,
"sells": 2,
"buyers": 7,
"sellers": 2
},
"m15": {
"buys": 19,
"sells": 27,
"buyers": 19,
"sellers": 27
},
"m30": {
"buys": 49,
"sells": 61,
"buyers": 45,
"sellers": 57
},
"h1": {
"buys": 97,
"sells": 144,
"buyers": 83,
"sellers": 124
},
"h24": {
"buys": 2966,
"sells": 3847,
"buyers": 1625,
"sellers": 2399
}
},
"volume_usd": {
"m5": "868581.7348314",
"h1": "16798158.0138526",
"h6": "164054610.850188",
"h24": "536545444.904535"
},
"reserve_in_usd": "163988541.3812"
},
"relationships": {
"base_token": {
"data": {
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token"
}
},
"quote_token": {
"data": {
"id": "eth_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type": "token"
}
},
"dex": {
"data": {
"id": "uniswap_v3",
"type": "dex"
}
}
}
}
],
"included": [
{
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token",
"attributes": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"image_url": "https://assets.coingecko.com/coins/images/2518/small/weth.png?1696503332",
"coingecko_coin_id": "weth"
}
}
]
}
New Pools List
get
https://pro-api.coingecko.com/api/v3/onchain/networks/new_pools
This endpoint allows you to query all the latest pools across all networks on GeckoTerminal
πŸ‘
Tips
You may include values such as page to specify which page of responses you would like to show
πŸ“˜
Notes
If the token's market cap is not verified by the team, the API response will return null for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV)
Attributes specified in the include params will be included under the "included" key at the top level
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/new_pools"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "eth_0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"type": "pool",
"attributes": {
"base_token_price_usd": "3653.12491645176",
"base_token_price_native_currency": "1.0",
"quote_token_price_usd": "0.998343707926245",
"quote_token_price_native_currency": "0.000273040545093221",
"base_token_price_quote_token": "3662.46",
"quote_token_price_base_token": "0.00027304",
"address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"name": "WETH / USDC 0.05%",
"pool_created_at": "2021-12-29T12:35:14Z",
"fdv_usd": "11007041041",
"market_cap_usd": null,
"price_change_percentage": {
"m5": "0",
"h1": "0.51",
"h6": "0.86",
"h24": "7.71"
},
"transactions": {
"m5": {
"buys": 7,
"sells": 2,
"buyers": 7,
"sellers": 2
},
"m15": {
"buys": 19,
"sells": 27,
"buyers": 19,
"sellers": 27
},
"m30": {
"buys": 49,
"sells": 61,
"buyers": 45,
"sellers": 57
},
"h1": {
"buys": 97,
"sells": 144,
"buyers": 83,
"sellers": 124
},
"h24": {
"buys": 2966,
"sells": 3847,
"buyers": 1625,
"sellers": 2399
}
},
"volume_usd": {
"m5": "868581.7348314",
"h1": "16798158.0138526",
"h6": "164054610.850188",
"h24": "536545444.904535"
},
"reserve_in_usd": "163988541.3812"
},
"relationships": {
"base_token": {
"data": {
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token"
}
},
"quote_token": {
"data": {
"id": "eth_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type": "token"
}
},
"dex": {
"data": {
"id": "uniswap_v3",
"type": "dex"
}
}
}
}
],
"included": [
{
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token",
"attributes": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"image_url": "https://assets.coingecko.com/coins/images/2518/small/weth.png?1696503332",
"coingecko_coin_id": "weth"
}
}
]
}
Search Pools
get
https://pro-api.coingecko.com/api/v3/onchain/search/pools
This endpoint allows you to search for pools on a network
πŸ‘
Tips
You may use this endpoint to search for query such as pool address, token address or token symbol. The endpoint will return matching pools as response
You may include values such as page to specify which page of responses you would like to show
πŸ“˜
Notes
If the token's market cap is not verified by the team, the API response will return null for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV)
Attributes specified in the include params will be included under the "included" key at the top level
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/search/pools"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "eth_0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"type": "pool",
"attributes": {
"base_token_price_usd": "3653.12491645176",
"base_token_price_native_currency": "1.0",
"quote_token_price_usd": "0.998343707926245",
"quote_token_price_native_currency": "0.000273040545093221",
"base_token_price_quote_token": "3662.46",
"quote_token_price_base_token": "0.00027304",
"address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"name": "WETH / USDC 0.05%",
"pool_created_at": "2021-12-29T12:35:14Z",
"fdv_usd": "11007041041",
"market_cap_usd": null,
"price_change_percentage": {
"m5": "0",
"h1": "0.51",
"h6": "0.86",
"h24": "7.71"
},
"transactions": {
"m5": {
"buys": 7,
"sells": 2,
"buyers": 7,
"sellers": 2
},
"m15": {
"buys": 19,
"sells": 27,
"buyers": 19,
"sellers": 27
},
"m30": {
"buys": 49,
"sells": 61,
"buyers": 45,
"sellers": 57
},
"h1": {
"buys": 97,
"sells": 144,
"buyers": 83,
"sellers": 124
},
"h24": {
"buys": 2966,
"sells": 3847,
"buyers": 1625,
"sellers": 2399
}
},
"volume_usd": {
"m5": "868581.7348314",
"h1": "16798158.0138526",
"h6": "164054610.850188",
"h24": "536545444.904535"
},
"reserve_in_usd": "163988541.3812"
},
"relationships": {
"base_token": {
"data": {
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token"
}
},
"quote_token": {
"data": {
"id": "eth_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type": "token"
}
},
"dex": {
"data": {
"id": "uniswap_v3",
"type": "dex"
}
}
}
}
],
"included": [
{
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token",
"attributes": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"image_url": "https://assets.coingecko.com/coins/images/2518/small/weth.png?1696503332",
"coingecko_coin_id": "weth"
}
}
]
}
Top Pools by Token Address
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/tokens/{token_address}/pools
This endpoint allows you to query top pools based on the provided token contract address on a network
πŸ‘
Tips
You may include values such as page to specify which page of responses you would like to show
πŸ“˜
Notes
The ranking of the top 20 pools is established by evaluating their liquidity and trading activity to identify the most liquid ones. This ranking is determined through a combination of two key factors: liquidity ('reserve_in_usd') and 24-Hour Trading Volume ('volume_usd')
If the token's market cap is not verified by the team, the API response will return null for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV)
Attributes specified in the include params will be included under the "included" key at the top level
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/network/tokens/token_address/pools"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "eth_0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"type": "pool",
"attributes": {
"base_token_price_usd": "3653.12491645176",
"base_token_price_native_currency": "1.0",
"quote_token_price_usd": "0.998343707926245",
"quote_token_price_native_currency": "0.000273040545093221",
"base_token_price_quote_token": "3662.46",
"quote_token_price_base_token": "0.00027304",
"address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"name": "WETH / USDC 0.05%",
"pool_created_at": "2021-12-29T12:35:14Z",
"fdv_usd": "11007041041",
"market_cap_usd": null,
"price_change_percentage": {
"m5": "0",
"h1": "0.51",
"h6": "0.86",
"h24": "7.71"
},
"transactions": {
"m5": {
"buys": 7,
"sells": 2,
"buyers": 7,
"sellers": 2
},
"m15": {
"buys": 19,
"sells": 27,
"buyers": 19,
"sellers": 27
},
"m30": {
"buys": 49,
"sells": 61,
"buyers": 45,
"sellers": 57
},
"h1": {
"buys": 97,
"sells": 144,
"buyers": 83,
"sellers": 124
},
"h24": {
"buys": 2966,
"sells": 3847,
"buyers": 1625,
"sellers": 2399
}
},
"volume_usd": {
"m5": "868581.7348314",
"h1": "16798158.0138526",
"h6": "164054610.850188",
"h24": "536545444.904535"
},
"reserve_in_usd": "163988541.3812"
},
"relationships": {
"base_token": {
"data": {
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token"
}
},
"quote_token": {
"data": {
"id": "eth_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type": "token"
}
},
"dex": {
"data": {
"id": "uniswap_v3",
"type": "dex"
}
}
}
}
],
"included": [
{
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token",
"attributes": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"image_url": "https://assets.coingecko.com/coins/images/2518/small/weth.png?1696503332",
"coingecko_coin_id": "weth"
}
}
]
}
Token Data by Token Address
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/tokens/{address}
This endpoint allows you to query specific token data based on the provided token contract address on a network
πŸ‘
Tips
You may add values such as top_pools in the include param to include top pools along with the pools information
If you would like to query token information such as socials, websites, description and etc. You can go to this endpoint /networks/{network}/tokens/{address}/info instead
πŸ“˜
Notes
If the token's market cap is not verified by the team, the API response will return null for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV)
Attributes specified in the include params will be included under the "included" key at the top level
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/network/tokens/address"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": {
"id": "eth_0xdac17f958d2ee523a2206206994597c13d831ec7",
"type": "token",
"attributes": {
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"name": "Tether USD",
"symbol": "USDT",
"image_url": "https://assets.coingecko.com/coins/images/325/small/Tether.png?1696501661",
"coingecko_coin_id": "tether",
"decimals": 6,
"total_supply": "49999156520373530.0",
"price_usd": "0.99720157",
"fdv_usd": "49859223957",
"total_reserve_in_usd": "417994486.4342195821530162288",
"volume_usd": {
"h24": "814387053.106936"
},
"market_cap_usd": "106918274170.211"
},
"relationships": {
"top_pools": {
"data": [
{
"id": "eth_0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
"type": "pool"
},
{
"id": "eth_0x3416cf6c708da44db2624d63ea0aaef7113527c6",
"type": "pool"
},
{
"id": "eth_0x11b815efb8f581194ae79006d24e0d814b7697f6",
"type": "pool"
}
]
}
}
},
"included": [
{
"id": "eth_0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
"type": "pool",
"attributes": {
"base_token_price_usd": "0.999745541005697",
"base_token_price_native_currency": "0.000273214695167948",
"quote_token_price_usd": "0.997201571758263",
"quote_token_price_native_currency": "0.000274189521081092",
"base_token_price_quote_token": "0.99644470",
"quote_token_price_base_token": "1.00356798",
"address": "0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
"name": "DAI / USDC / USDT",
"pool_created_at": "2022-07-13T11:48:12Z",
"token_price_usd": "0.999745541005697",
"fdv_usd": "3270150238",
"market_cap_usd": "4870754520.25286",
"price_change_percentage": {
"m5": "0",
"h1": "-0.15",
"h6": "-0.5",
"h24": "-0.19"
},
"transactions": {
"m5": {
"buys": 0,
"sells": 0,
"buyers": null,
"sellers": null
},
"m15": {
"buys": 1,
"sells": 0,
"buyers": null,
"sellers": null
},
"m30": {
"buys": 2,
"sells": 0,
"buyers": null,
"sellers": null
},
"h1": {
"buys": 4,
"sells": 1,
"buyers": null,
"sellers": null
},
"h24": {
"buys": 67,
"sells": 84,
"buyers": null,
"sellers": null
}
},
"volume_usd": {
"m5": "0.0",
"h1": "1502319.288637997",
"h6": "45415206.49514137",
"h24": "69802183.6886975"
},
"reserve_in_usd": "184383775.4111"
},
"relationships": {
"base_token": {
"data": {
"id": "eth_0x6b175474e89094c44da98b954eedeac495271d0f",
"type": "token"
}
},
"quote_token": {
"data": {
"id": "eth_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type": "token"
}
},
"dex": {
"data": {
"id": "curve",
"type": "dex"
}
}
}
}
]
}
Tokens Data by Token Addresses
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/tokens/multi/{addresses}
This endpoint allows you to query multiple tokens data based on the provided token contract addresses on a network
πŸ‘
Tips
You may add values such as top_pools in the include param to include top pools along with the pools information
If you would like to query token information such as socials, websites, description and etc. You can go to this endpoint /networks/{network}/tokens/{address}/info instead
πŸ“˜
Notes
Addresses not found in GeckoTerminal.com will be ignored
This endpoint allows querying up to 30 contract addresses per request
The endpoint will only return the first top pool for each token
If the token's market cap is not verified by the team, the API response will return null for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV)
Attributes specified in the include params will be included under the "included" key at the top level
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/network/tokens/multi/addresses"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": {
"id": "eth_0xdac17f958d2ee523a2206206994597c13d831ec7",
"type": "token",
"attributes": {
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"name": "Tether USD",
"symbol": "USDT",
"image_url": "https://assets.coingecko.com/coins/images/325/small/Tether.png?1696501661",
"coingecko_coin_id": "tether",
"decimals": 6,
"total_supply": "49999156520373530.0",
"price_usd": "0.99720157",
"fdv_usd": "49859223957",
"total_reserve_in_usd": "417994486.4342195821530162288",
"volume_usd": {
"h24": "814387053.106936"
},
"market_cap_usd": "106918274170.211"
},
"relationships": {
"top_pools": {
"data": [
{
"id": "eth_0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
"type": "pool"
},
{
"id": "eth_0x3416cf6c708da44db2624d63ea0aaef7113527c6",
"type": "pool"
},
{
"id": "eth_0x11b815efb8f581194ae79006d24e0d814b7697f6",
"type": "pool"
}
]
}
}
},
"included": [
{
"id": "eth_0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
"type": "pool",
"attributes": {
"base_token_price_usd": "0.999745541005697",
"base_token_price_native_currency": "0.000273214695167948",
"quote_token_price_usd": "0.997201571758263",
"quote_token_price_native_currency": "0.000274189521081092",
"base_token_price_quote_token": "0.99644470",
"quote_token_price_base_token": "1.00356798",
"address": "0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
"name": "DAI / USDC / USDT",
"pool_created_at": "2022-07-13T11:48:12Z",
"token_price_usd": "0.999745541005697",
"fdv_usd": "3270150238",
"market_cap_usd": "4870754520.25286",
"price_change_percentage": {
"m5": "0",
"h1": "-0.15",
"h6": "-0.5",
"h24": "-0.19"
},
"transactions": {
"m5": {
"buys": 0,
"sells": 0,
"buyers": null,
"sellers": null
},
"m15": {
"buys": 1,
"sells": 0,
"buyers": null,
"sellers": null
},
"m30": {
"buys": 2,
"sells": 0,
"buyers": null,
"sellers": null
},
"h1": {
"buys": 4,
"sells": 1,
"buyers": null,
"sellers": null
},
"h24": {
"buys": 67,
"sells": 84,
"buyers": null,
"sellers": null
}
},
"volume_usd": {
"m5": "0.0",
"h1": "1502319.288637997",
"h6": "45415206.49514137",
"h24": "69802183.6886975"
},
"reserve_in_usd": "184383775.4111"
},
"relationships": {
"base_token": {
"data": {
"id": "eth_0x6b175474e89094c44da98b954eedeac495271d0f",
"type": "token"
}
},
"quote_token": {
"data": {
"id": "eth_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type": "token"
}
},
"dex": {
"data": {
"id": "curve",
"type": "dex"
}
}
}
}
]
}
Token Info by Token Address
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/tokens/{address}/info
This endpoint allows you to query specific token info such as name,symbol, coingecko id etc. based on provided token contract address on a network
πŸ‘
Tips
If you would like to query token data such as decimals, total supply, price and etc. You can go to this endpoint /networks/{network}/tokens/{address} instead
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/network/tokens/address/info"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": {
"id": "eth_0xdac17f958d2ee523a2206206994597c13d831ec7",
"type": "token",
"attributes": {
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"name": "Tether USD",
"symbol": "USDT",
"image_url": "https://assets.coingecko.com/coins/images/325/small/Tether.png?1696501661",
"coingecko_coin_id": "tether",
"websites": [
"https://tether.to/"
],
"description": "Tether (USDT) is a cryptocurrency with a value meant to mirror the value of the U.S. dollar...",
"gt_score": 92.66055045871559,
"discord_url": null,
"telegram_handle": null,
"twitter_handle": "Tether_to"
}
}
}
Pool Tokens Info by Pool Address
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/pools/{pool_address}/info
This endpoint allows you to query pool info including base and quote token info based on provided pool contract address on a network
πŸ‘
Tips
If you would like to query pool data such as price, transactions, volume and etc. You can go to this endpoint /networks/{network}/pools/{address} instead
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/network/pools/pool_address/info"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type": "token",
"attributes": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"image_url": "https://assets.coingecko.com/coins/images/2518/small/weth.png?1696503332",
"coingecko_coin_id": "weth",
"websites": [
"https://weth.io/"
],
"description": "WETH is the tokenized/packaged form of ETH that you use to pay for items when you interact with Ethereum dApps...",
"gt_score": 92.66055045871559,
"discord_url": null,
"telegram_handle": null,
"twitter_handle": null
}
},
{
"id": "eth_0xdac17f958d2ee523a2206206994597c13d831ec7",
"type": "token",
"attributes": {
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"name": "Tether USD",
"symbol": "USDT",
"image_url": "https://assets.coingecko.com/coins/images/325/small/Tether.png?1696501661",
"coingecko_coin_id": "tether",
"websites": [
"https://tether.to/"
],
"description": "Tether (USDT) is a cryptocurrency with a value meant to mirror the value of the U.S. dollar. ...",
"gt_score": 92.66055045871559,
"discord_url": null,
"telegram_handle": null,
"twitter_handle": "Tether_to"
}
}
]
}
Most Recently Updated Tokens List
get
https://pro-api.coingecko.com/api/v3/onchain/tokens/info_recently_updated
This endpoint allows you to query 100 most recently updated tokens info across all networks on GeckoTerminal
πŸ‘
Tips
You may add values such as network in the include param to include network along with the updated tokens list
πŸ“˜
Notes
Attributes specified in the include params will be included under the "included" key at the top level
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/tokens/info_recently_updated"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "solana_TNSRxcUxoT9xBG3de7PiJyTDYu7kskLqcpddxnEJAS6",
"type": "token",
"attributes": {
"address": "TNSRxcUxoT9xBG3de7PiJyTDYu7kskLqcpddxnEJAS6",
"name": "Tensor",
"symbol": "TNSR",
"image_url": "https://assets.coingecko.com/coins/images/35972/small/Tensor.jpeg?1710297172",
"coingecko_coin_id": "tensor",
"websites": [],
"description": "TNSR is the native token for the Tensor NFT marketplace on Solana.",
"gt_score": 41.284403669724774,
"metadata_updated_at": "2024-04-08T15:59:04Z",
"discord_url": null,
"telegram_handle": null,
"twitter_handle": "TensorFdn"
},
"relationships": {
"network": {
"data": {
"id": "solana",
"type": "network"
}
}
}
}
]
}
Pool OHLCV chart by Pool Address
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/pools/{pool_address}/ohlcv/{timeframe}
This endpoint allows you to get the OHLCV chart (Open, High, Low, Close, Volume) of a pool based on the provided pool address on a network
πŸ‘
Tips
You may use this endpoint to query the historical price and volume of a token
You may select the timeframe with its respective aggregate to get the intended OHLCV data (Example: minute?aggregate=15 for 15 minutes OHLCV)
πŸ“˜
Notes
This endpoint uses epoch/unix timestamp seconds for its timestamp format. Example: 1708850449
Data is only available for up to 6 months prior. If no earlier data is available, an empty response will be returned
Pools with more than 2 tokens are not yet supported for this endpoint
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/network/pools/pool_address/ohlcv/day"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": {
"id": "bc786a99-7205-4c80-aaa1-b9634d97c926",
"type": "ohlcv_request_response",
"attributes": {
"ohlcv_list": [
[
1712534400,
3454.61590249189,
3660.85954963415,
3417.91885296256,
3660.85954963415,
306823.2770311613
],
[
1712448000,
3362.60273217873,
3455.28884490954,
3352.95305060685,
3454.61590249189,
242144.86478418365
],
[
1712361600,
3323.05578706056,
3391.19811016133,
3317.73497182435,
3362.60273217873,
273323.66168293066
]
]
}
},
"meta": {
"base": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"coingecko_coin_id": "weth"
},
"quote": {
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"name": "Tether USD",
"symbol": "USDT",
"coingecko_coin_id": "tether"
}
}
}
Past 24 Hour Trades by Pool Address
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/pools/{pool_address}/trades
This endpoint allows you to query the last 300 trades in the past 24 hours based on the provided pool address
πŸ“˜
Notes
Cache/Update frequency: every 60 seconds
import requests
url = "https://pro-api.coingecko.com/api/v3/onchain/networks/network/pools/pool_address/trades"
headers = {"accept": "application/json", 'x-cg-pro-api-key': API_KEY}
response = requests.get(url, headers=headers)
print(response.text)
{
"data": [
{
"id": "eth_19612255_0x0b8ac5a16c291832c1b4d5f0d8ef2d9d58e207cd8132c32392295617daa4d422_158_1712595165",
"type": "trade",
"attributes": {
"block_number": 19612255,
"tx_hash": "0x0b8ac5a16c291832c1b4d5f0d8ef2d9d58e207cd8132c32392295617daa4d422",
"tx_from_address": "0x42c037c594eefeca741e9dd66af91e7ffd930872",
"from_token_amount": "1.51717616246451",
"to_token_amount": "5535.099061",
"price_from_in_currency_token": "1.0",
"price_to_in_currency_token": "0.000274100995437363",
"price_from_in_usd": "3656.8970003075",
"price_to_in_usd": "1.00235910799619",
"block_timestamp": "2024-04-08T16:52:35Z",
"kind": "buy",
"volume_in_usd": "5548.15695745452",
"from_token_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"to_token_address": "0xdac17f958d2ee523a2206206994597c13d831ec7"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment