10-mins Tutorial Guide
Source: https://docs.coingecko.com/docs/10-mins-tutorial-guide
New to CoinGecko API? Fret not. Whether you're a programmer or someone with zero coding experience, we've got you covered!
If you are not a developer and prefer to learn only specific tutorials on Google Sheet/Excel, feel free to check 👶 Tutorials (Beginner-friendly)
| Tutorial Steps | Description |
|---|---|
| 1. Get data by ID or Address | Learn how to use different endpoints by obtaining Coin ID and token's contract address at first. |
| 2. Get Historical Data | Learn how to get historical data of a coin by using different historical endpoints. |
| 3. Get Exchanges & NFT Data | Learn how to query exchanges and NFT data by accessing different endpoints. |
| 4. Get On-chain Data | Learn how to use /onchain GT endpoints to query onchain data. |
2. Get Historical Data
Source: https://docs.coingecko.com/docs/2-get-historical-data
Tips
- Most of the historical data are returned and queried using UNIX Timestamp.
- If you are not familiar with UNIX Timestamp, you may use tool like epochconverter.com to convert between UNIX Timestamp and human readable date.
- You may use either coin ID or contract address to get the historical data.
There are five different endpoints to get historical data of a coin:
| Endpoint | Description |
|---|---|
| /coins/\{id}/history | Get the historical data (price, market cap, 24hrs volume, etc.) at a given date for a coin based on a particular coin ID. |
| /coins/\{id}/market_chart | Get the historical chart data of a coin including time in UNIX, price, market cap and 24hrs volume based on particular coin ID. |
| /coins/\{id}/market_chart/range | Get the historical chart data of a coin within certain time range in UNIX along with price, market cap and 24hrs volume based on particular coin ID. |
| /coins/\{id}/contract/\{contract_address}/market_chart | Get the historical chart data of a coin including time in UNIX, price, market cap and 24hrs volume based on token contract address. |
| /coins/\{id}/contract/\{contract_address}/market_chart/range | Get the historical chart data of a coin within certain time range in UNIX along with price, market cap and 24hrs volume based on token contract address. |
Notes
The data granularity (interval) for /market_chart and /market_chart/range endpoints is automatic and based on the date range:
- 1 day from current time = 5-minutely data
- 1 day from anytime (except from current time) = hourly data
- 2-90 days from current time or anytime = hourly data
- above 90 days from current time or anytime = daily data (00:00 UTC)
3. Get Exchanges & NFT Data
Source: https://docs.coingecko.com/docs/3-get-exchanges-nft-data
You can get Exchange and NFT data just like how you get the coins data:
- Get the ID (exchange or NFT) from
/listendpoint. - Use the ID to query latest or historical market data
| Type | Coins | NFTs | Exchanges | Derivatives |
|---|---|---|---|---|
| Get Full List with IDs | /coins/list | /nfts/list | /exchanges/list | /derivatives/exchanges/list |
| Get latest market data | /coins/\{id} | /nfts/\{id} | /exchanges/\{id} | /derivatives/exchanges/\{id} |
| Get Historical Data | /coins/\{id}/market_chart | /nfts/\{id}/market_chart | /exchanges/\{id}/volume_chart | /exchanges/\{id}/volume_chart |
4. Get On-chain Data
Source: https://docs.coingecko.com/docs/4-get-on-chain-data
Here are some of the important parameters to take note while using Onchain DEX API Endpoints:
- Blockchain Networks
- DEXs
- Pool Contract Address
- Token Contract Address