#defi #coin-gecko #price

cgko

Unofficial Rust client for the CoinGecko API (cgko)

5 releases

new 0.1.4 Feb 13, 2026
0.1.3 Jan 27, 2026
0.1.2 Jan 26, 2026
0.1.1 Jan 22, 2026
0.1.0 Jan 17, 2026

#1 in #coin-gecko


Used in ethcli

MIT license

225KB
4.5K SLoC

yld_fi

gecko

Unofficial Rust client for the CoinGecko API

crates.io MIT License

Features

  • Simple - Current prices for coins
  • Coins - Detailed coin data, historical prices, markets
  • Categories - Coin categories and market data
  • Exchanges - Exchange info, tickers, volume
  • Derivatives - Derivatives exchanges and data
  • NFTs - NFT collections, floor prices, market data
  • On-chain - On-chain DEX data (Pro)
  • Global - Global crypto statistics
  • Treasury - Company crypto holdings

Installation

[dependencies]
cgko = "0.1"
tokio = { version = "1", features = ["full"] }

Quick Start

use cgko::Client;

#[tokio::main]
async fn main() -> Result<(), cgko::Error> {
    // Free tier
    let client = Client::new()?;

    // Get Bitcoin price
    let prices = client.simple().price(&["bitcoin"], &["usd"]).await?;
    println!("{:?}", prices);

    // Get trending coins
    let trending = client.global().trending().await?;
    for item in trending.coins.iter().take(5) {
        println!("{}: #{}", item.item.name, item.item.market_cap_rank.unwrap_or(0));
    }

    Ok(())
}

Pro API

// Pro tier with API key
let client = cgko::Client::pro("your-api-key")?;
let markets = client.coins().markets("usd").await?;

Environment Variables

  • COINGECKO_API_KEY - Your CoinGecko Pro API key (optional, for higher rate limits)

Terms of Service

This is an unofficial client. By using this library, you agree to comply with CoinGecko's Terms of Service.

Disclaimer

This crate is not affiliated with or endorsed by CoinGecko.

License

MIT

Dependencies

~6–20MB
~213K SLoC