This guide will walk you through the steps to create a Discord bot that fetches cryptocurrency prices using the CoinGecko API. The bot will respond to commands from users and provide real-time price data for cryptocurrencies.
- A Discord Account
- Basic knowledge of programming and the Python programming language
- Python and pip (package installer for Python) installed on your system
- https://discord.com/developers/docs/getting-started
- https://www.coingecko.com/en/api/documentation
- https://apiguide.coingecko.com/getting-started/introduction
- Crypto Price Bot (using /simple/price)
- Trending Coins Bot (using /search/trending)
- Exchanges + Derivatives Exchanges List Bot (using /exchanges + /derivative/exchanges)
- DeFi Bot (using /global/decentralized_finance_defi) + defillama API + GeckoTerminal API
- NFT Bot (using /nft/list)
Example:
Public API
https://api.coingecko.com/api/v3/ping
https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=bitcoin&x_cg_demo_api_key=YOUR_API_KEY
Pro API
https://pro-api.coingecko.com/api/v3/ping?x_cg_pro_api_key=YOUR_API_KEY
https://pro-api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=bitcoin&x_cg_pro_api_key=YOUR_API_KEY
Pro API always Starts with: pro-api.coingecko.com/api/v3/ & Ends with: x_cg_pro_api_key=YOUR_API_KEY