Crates.io | crypto-prices-lib |
lib.rs | crypto-prices-lib |
version | 0.5.0 |
source | src |
created_at | 2022-06-25 05:20:49.942035 |
updated_at | 2024-04-30 16:54:08.515411 |
description | A SDK for getting prices of cryptocurrencies against another. |
homepage | |
repository | https://github.com/zackbalbin/crypto-prices-lib |
max_upload_size | |
id | 612822 |
size | 40,579 |
Crate pubshlied here Docs are available here
A example for getting the price of Ergo against Bitcoin
use anyhow::Result;
use crypto_prices_lib::{get_marketcap, get_price};
#[tokio::main]
async fn main() -> Result<()> {
let price = get_price("ergo", "usd").await.unwrap();
println!("{:?}", price);
let marketcap = get_marketcap("ergo", "usd").await.unwrap();
println!("{:?}", marketcap);
Ok(())
}
The result
1.29
96616969.50238612