finance-query 3.0.0

A Rust library for querying financial data
Documentation
// @generated by `cargo soothfast docs gen-tests`
// source: docs/library/tickers.md line 375
use finance_query::{Tickers, TimeRange};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Fetch splits for symbols known to have splits
    let tickers = Tickers::new(vec!["NVDA", "TSLA", "AAPL"]).await?;
    let response = tickers.splits(TimeRange::FiveYears).await?;

    // Process splits
    for (symbol, splits) in &response.splits {
        if !splits.is_empty() {
            println!("{}: {} splits", symbol, splits.len());
            for split in splits {
                println!("  Timestamp: {}, Ratio: {}", split.timestamp, split.ratio);
            }
        }
    }
    Ok(())
}