cmc 0.1.1

Rust Library for the CoinMarketCap API
Documentation

cmc

Unofficial Rust Library for the CoinMarketCap API

Crates.io docs.rs MIT licensed Apache-2.0 licensed

Usage

Get your API key here

Price cryptocurrency

 use cmc::Cmc;

 let cmc = Cmc::new("<API KEY>");

 match cmc.price("BTC") {
    Ok(price) => println!("{}", price),
    Err(err) => println!("Error: {}", err),
 }

Price with custom settings

 use cmc::{CmcBuilder, Pass};

 let cmc = CmcBuilder::new("<API KEY>")
 	 .pass(Pass::Id)
 	 .convert("EUR")
 	 .build();

 match cmc.price("1027") { // 1027 is Ethereum id.
 	Ok(price) => println!("{}", price), // In Euro instead default USD
 	Err(err) => println!("Error: {}", err),
 }

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.