fng_api_wrapper

Crates.iofng_api_wrapper
lib.rsfng_api_wrapper
version1.0.1
sourcesrc
created_at2023-04-10 19:55:07.65486
updated_at2023-04-16 17:28:36.830596
descriptionCrypto Fear and Greed API wrapper
homepage
repositoryhttps://github.com/gcomte/fng-api-wrapper
max_upload_size
id835404
size9,581
Gabriel Comte (gcomte)

documentation

README

Crypto Fear and Greed API wrapper

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/

Sample code

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
        );
    });
}
Commit count: 34

cargo fmt