Skip to content

A Rust crate for efficiently downloading historical stock data from Yahoo Finance, featuring asynchronous operations with reqwest and tokio for optimal performance.

Notifications You must be signed in to change notification settings

AG3NTZ3R0/stock-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stock Data

Description

A Rust crate for efficiently downloading historical stock data from Yahoo Finance, featuring asynchronous operations with reqwest and tokio for optimal performance.

Example

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let msg = "Failed to generate date";
    let date1 = NaiveDate::from_ymd_opt(2023, 01, 01).expect(msg);
    let date2 = NaiveDate::from_ymd_opt(2024, 01, 01).expect(msg);

    let url = build_yahoo_finance_url_from_dates("AMZN", date1, date2, "1d", true);
    let bytes = download_stock_data(&url).await?;

    let path = "output/stock_data.csv"; 
    write_stock_data(&bytes, &path).await?;

    Ok(())
}

About

A Rust crate for efficiently downloading historical stock data from Yahoo Finance, featuring asynchronous operations with reqwest and tokio for optimal performance.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages