Comment on page
🔨
Common Use Cases
Below are some of the common use cases that might be useful to you.
Use coins/{id} endpoint, e.g. https://api.coingecko.com/api/v3/coins/bitcoin . You can also use this endpoint to receive other metadata like: links, categories, contract address, community, description in different languages and more.
Use coins/simple endpoint. e.g. https://api.coingecko.com/api/v3/coins/bitcoin . This endpoint can also return market data like market cap, 24hour trading volume and 24hour price change %.
Note: the data update frequency (or cache) for Pro API is around 30-40 seconds. Public API may take 2 minutes or more to update the last price.
Use coins/list/new endpoint, it is the fastest endpoint to that return the latest coins (ids and activated time) added on CoinGecko. This is an exclusive endpoint for Pro API users, subscribe to any paid plan to access it. Note: the data update frequency (or cache) this endpoint is around 30 seconds.
To get trading pairs of Uniswap from Binance only, you may use coins/{id}/tickers or /exchanges/{id}/tickers and insert the right param to filter. e.g.
Use /coins/markets and category parameter to filter. e.g. the links below help you to get all the coins that are tagged as 'stablecoins' and 'arbitrum ecosystem' on CoinGecko.com.
- 1.Use https://api.coingecko.com/api/v3/exchanges/list to get the full list of exchanges (id) on CoinGecko.com
- 2.Use /exchanges/{id} to find out if an exchange is centralized (CEX) or not (DEX). Repeat the same for other exchanges. e.g. https://api.coingecko.com/api/v3/exchanges/uniswap_v3uniswap is DEX"centralized":false
Use https://api.coingecko.com/api/v3/global . It will show the total (global) market cap, as well as dominance % of BTC, ETH and more.
"market_cap_percentage": {
"btc": 39.3896058954608,
Use https://api.coingecko.com/api/v3/coins/categories , it will also return their 24hour percentage change, which can be useful to know which category or ecosystem is receiving traction. You may also compare this endpoint against global market cap data.
- 1.First, you would have to identify the ID for the chain you are looking for using the asset platform endpoint. Note: only coins that have contract address added by the CoinGecko team will be shown. (Learn more here)
- 2.Once you have identified the chain ID, replace the correct ID in this link below https://tokens.coingecko.com/<ID>/all.json . e.g.
https://tokens.coingecko.com/arbitrum-one/all.json
Alternatively, you may also use /coins/list endpoint with the parameter include_platform=true. This allows you to view all the coins listed on CoinGecko, and their respective blockchain networks.
https://api.coingecko.com/api/v3/coins/list?include_platform=true
You may flag 'sparkline' parameter with the /coins/{id} and /coins/markets endpoints, for example:
https://api.coingecko.com/api/v3/coins/bitcoin?sparkline=true
https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=100&page=1&sparkline=true
You may insert the API id with this URL format: www.coingecko.com/en/coins/{web_slug} For example: https://www.coingecko.com/en/coins/bnb
web_slug data can be obtained in the following endpoints:
/coins/{id}
/coins/{contract}/contract/{contract_address}
To check if a coin is active or not, you may refer to the /coins/list endpoint, only active coins will be shown here.
To check if a price is stale, you may use one of the following methods:
- use /coins/{id} endpoint , and look for 'last_updated' timestamp data.
- use /simple/price endpoint, and insert the parameter include_last_updated_at=true to check the latest update time.
Last modified 8d ago