coingecko_api
2.0.2, released a year ago by an unverified publisher
Dart package providing simple access to the CoinGecko API (Version 3).
WASM-ready
What it does
Provides an asynchronous API wrapper divided into sections matching the CoinGecko API documentation. Allows fetching cryptocurrencies prices, coin data, historical market charts, exchanges, derivatives, NFTs, and global data.
AI-written summary of version 2.0.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to fetch cryptocurrency market data, prices, or NFT stats from CoinGecko in your Dart or Flutter application.
Skip it when
- You need a general-purpose HTTP client or a backend client other than CoinGecko.
Strengths
- Organized into sections mirroring the official CoinGecko API documentation
- Uses CoinGeckoResult objects to easily handle success and error states
Weaknesses
- Tied exclusively to a single third-party API (CoinGecko)
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
CoinGeckoApi api = CoinGeckoApi();
final marketChart = await api.coins.getCoinMarketChart(
id: 'bitcoin',
vsCurrency: 'usd',
days: 7,
);
if (!marketChart.isError) {
marketChart.data.forEach((item) {
print('Price: ${item.price}, Market Cap: ${item.marketCap}');
});
}Alternatives
Packages that do the same job and could replace coingecko_api.
Works with
Packages commonly used together with coingecko_api: ones it builds on, ones built on it, and its own family.
- intlcoingecko_api depends on itA Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.
- diocoingecko_api depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- dio_smart_retrycoingecko_api depends on itFlexible request retry library for the Dio HTTP client package.