πŸ”¨Common Use Cases

Below are some of the common use cases that might be useful to you.

GET logo images of coins

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.

Best endpoint to get the latest price

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.

Building a telegram bot to alert users on the latest coins listed on CoinGecko, which endpoint should I use?

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.

GET all trading pairs (tickers) of a coin

Use coins/{id}/tickers, e.g. https://api.coingecko.com/api/v3/coins/uniswap/tickers

GET trading pairs of specific coins from a specific exchange

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.

GET list of coins under specific category

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.

Identify a list of DEX decentralised exchanges

  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_v3

    uniswap is DEX
    "centralized":false

GET Bitcoin dominance data

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,

GET the market cap or dominance of a specific ecosystem

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.

GET all the coins of a specific blockchain network (by contract address)

  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

GET the 7-day sparkline price data of a coin

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/{id}/contract/{contract_address}

How do I check if a coin status is still active on CoinGecko and if the price update is stale?

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.

How do I get the real-time and historical exchange of BTC in USD?

To check the current exchange rate, you may use the /exchange_rates endpoint (test).

To check the historical exchange rate, you may use /coins/{id}/history (or /coins/{id}market_chart) endpoint to get the historical price of BTC in USD on a specific date.

Last updated