finance-query 3.0.0

A Rust library for querying financial data
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// @generated by `cargo soothfast docs gen-tests`
// source: docs/library/ticker.md line 466
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    use finance_query::{Ticker, TimeRange};

    let ticker = Ticker::new("AAPL").await?;
    let dividends = ticker.dividends(TimeRange::TwoYears).await?;

    for div in &dividends {
        // div.timestamp is a Unix timestamp (i64, seconds since epoch)
        println!("timestamp={}, amount=${:.4}", div.timestamp, div.amount);
    }
    Ok(())
}