Primary data source for cryptocurrency prices, market data, and historical charts in Info Crypto.
Info Crypto uses the CoinGecko public API as its primary data source. It powers the Home page market overview, the Converter page live prices, and the Charts page historical data — all without requiring an API key.
The CoinGecko free tier enforces a rate limit of 30 calls per minute. The app uses localStorage caching with a 5-minute TTL to stay well within this limit under normal usage, but heavy manual refreshing can still trigger 429 responses.
No API key is required for the public demo endpoints used in this project. If you deploy to production and need higher throughput, consider upgrading to a CoinGecko paid plan and adding an x-cg-demo-api-key header to each request.
Returns a ranked list of coins ordered by market capitalisation. Used by the Home page to display the top 20 cryptocurrencies.Source file:src/services/cryptoApi.js — getTopCryptos()
GET https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=20&page=1
The cache helper keepInfo() in src/services/cache.js reads getInfoCrypto from localStorage and skips the network request if the cached value is less than 5 minutes old.
Returns the current USD price for a fixed set of coins. Used by the Converter page to power currency conversion calculations.Source file:src/services/priceApi.js — priceApi()
GET https://api.coingecko.com/api/v3/simple/price?ids=usd,bitcoin,ethereum,solana,cardano,tether,binancecoin&vs_currencies=usd
Comma-separated list of CoinGecko coin IDs to fetch prices for. The integration requests: usd, bitcoin, ethereum, solana, cardano, tether, binancecoin.
Returns time-series price data for a single coin over a specified number of days. Used by the Charts page to render price history graphs.Source file:src/services/historyApi.js — getHistoryCrypto()
GET https://api.coingecko.com/api/v3/coins/{cryptoId}/market_chart?vs_currency=usd&days={days}
All CoinGecko calls are wrapped in cache helpers defined in src/services/cache.js. Each helper reads from localStorage first and only makes a network request when the cached value is missing or older than 5 minutes.