| Crates.io | cgko |
| lib.rs | cgko |
| version | 0.1.1 |
| created_at | 2026-01-17 12:45:01.264269+00 |
| updated_at | 2026-01-22 21:38:59.974403+00 |
| description | Unofficial Rust client for the CoinGecko API (cgko) |
| homepage | |
| repository | https://github.com/yldfi/yldfi-rs/tree/main/crates/cgko |
| max_upload_size | |
| id | 2050389 |
| size | 127,764 |
Unofficial Rust client for the CoinGecko API
[dependencies]
cgko = "0.1"
tokio = { version = "1", features = ["full"] }
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 tier with API key
let client = cgko::Client::pro("your-api-key")?;
let markets = client.coins().markets("usd").await?;
COINGECKO_API_KEY - Your CoinGecko Pro API key (optional, for higher rate limits)MIT