Crates.io | alphavantage |
lib.rs | alphavantage |
version | 0.7.0 |
source | src |
created_at | 2018-06-17 12:03:22.355158 |
updated_at | 2021-02-20 09:11:56.504266 |
description | Alpha Vantage API client |
homepage | |
repository | https://github.com/asmarques/alphavantage |
max_upload_size | |
id | 70467 |
size | 373,984 |
A Rust client for the Alpha Vantage API.
Currently supports the following operations:
The default client is asynchronous but a blocking client is also available through the optional blocking
feature.
Using the default asynchronous client:
use alphavantage::Client;
#[tokio::main]
async fn main() {
let client = Client::new("MY_SECRET_TOKEN");
let time_series = client.get_time_series_daily("GOOG").await.unwrap();
let entry = time_series.entries.last().unwrap();
println!("{:?}", entry);
let exchange_rate = client.get_exchange_rate("USD", "EUR").await.unwrap();
println!("{:?}", exchange_rate);
}
Using the optional blocking client:
use alphavantage::blocking::Client;
fn main() {
let client = Client::new("MY_SECRET_TOKEN");
let time_series = client.get_time_series_daily("GOOG").unwrap();
let entry = time_series.entries.last().unwrap();
println!("{:?}", entry);
let exchange_rate = client.get_exchange_rate("USD", "EUR").unwrap();
println!("{:?}", exchange_rate);
}