Crates.io | fng_api_wrapper |
lib.rs | fng_api_wrapper |
version | 1.0.1 |
source | src |
created_at | 2023-04-10 19:55:07.65486 |
updated_at | 2023-04-16 17:28:36.830596 |
description | Crypto Fear and Greed API wrapper |
homepage | |
repository | https://github.com/gcomte/fng-api-wrapper |
max_upload_size | |
id | 835404 |
size | 9,581 |
fng-api-wrapper
is a Rust API client for Crypto Fear & Greed Index.
The wrapper is incomplete and does not cover the entire API.
So far it only covers the endpoint https://api.alternative.me/fng/
use chrono::Datelike;
use fng_api_wrapper::client;
fn main() {
let fng = client::fetch_daily_fng(10).unwrap();
fng.data.iter().for_each(|daily_record| {
let ts = &daily_record.timestamp;
let (year, month, day) = (ts.year(), ts.month(), ts.day());
println!(
"{year}-{month:0>2}-{day:0>2}: {:>2} -> {:?}",
daily_record.value, daily_record.value_classification
);
});
}