cgko

Crates.iocgko
lib.rscgko
version0.1.1
created_at2026-01-17 12:45:01.264269+00
updated_at2026-01-22 21:38:59.974403+00
descriptionUnofficial Rust client for the CoinGecko API (cgko)
homepage
repositoryhttps://github.com/yldfi/yldfi-rs/tree/main/crates/cgko
max_upload_size
id2050389
size127,764
michaeldim (michaeldim)

documentation

README

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)

License

MIT

Commit count: 46

cargo fmt