Skip to content
pubscout

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
$ flutter pub add coingecko_api
Source repository

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.

  • http

    If you prefer making custom raw HTTP requests instead of using a dedicated wrapper package.

Works with

Packages commonly used together with coingecko_api: ones it builds on, ones built on it, and its own family.