cmc
Unofficial Rust Library for the CoinMarketCap API
Usage
Get your API key here
CoinMarketCap ID Map
NOTE: CoinMarketCap recommend utilizing CMC ID instead of cryptocurrency symbols to securely identify cryptocurrencies with other endpoints and in your own application logic.
use ;
let cmc = new;
match cmc.id_map
Price cryptocurrency
use Cmc;
let cmc = new;
match cmc.price
Price with custom settings
use ;
let cmc = new
.pass
.convert
.build;
match cmc.price
Price conversion
use Cmc;
let cmc = new;
// 2.5 BTC in EUR (using symbols)
match cmc.price_conversion
// 1.6 ETH in XMR (using id's)
match cmc.price_conversion_id
Exchange ID Map
use ;
let cmc = new;
match cmc.exchange_id_map
Crate Features
This crate supports default features:
cryptocurrencyexchangefiatglobal_metricskeytools
Disable all functions except the necessary ones:
[]
= { = "0.4.0", = false, = ["cryptocurrency"] }
Async
Asynchronous versions of functions are available through enabling the async feature:
[]
= { = "0.4.0", = ["async"] }
And then the code:
async
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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.