Expand description
§adaq-data-stock-us
A Rust reimplementation of Python’s yfinance for fetching US equity market
data from Yahoo Finance.
- Canonical return types are strongly-typed structs (compile-time guarantees);
tabular consumers can convert via
History::to_polars()(featurepolars) orserde(JSON, always on). Seedocs/adr/0002-typed-struct-canonical.md. - HTTP uses
primpwith Chrome TLS impersonation to avoid Yahoo rate-limiting. Seedocs/adr/0001-async-primp.md. - Async-first, with a
blockingfacade for non-async callers.
use adaq_data_stock_us::{Client, HistoryOptions, Interval};
let client = Client::new()?;
let hist = client.history("AAPL", &HistoryOptions::default()).await?;
println!("bars: {}", hist.bars.len());Re-exports§
pub use auth::Auth;pub use calendars::CalendarColumn;pub use calendars::CalendarOperand;pub use calendars::CalendarQuery;pub use calendars::CalendarResult;pub use calendars::EarningsEvent;pub use calendars::EconomicEvent;pub use calendars::IpoEvent;pub use calendars::SplitEvent;pub use client::Client;pub use client::DownloadResult;pub use client::Ticker;pub use client::TickerId;pub use client::download;pub use config::Config;pub use earnings::EarningsDate;pub use error::Result;pub use error::YfError;pub use fundamentals::Financials;pub use fundamentals::Freq;pub use fundamentals::Statement;pub use history::Actions;pub use history::Bar;pub use history::CapitalGain;pub use history::Dividend;pub use history::History;pub use history::HistoryMeta;pub use history::HistoryOptions;pub use history::Interval;pub use history::Split;pub use http::YfSession;pub use isin::isin_for_ticker;pub use isin::resolve_isin;pub use live::LiveWebSocket;pub use live::PricingData;pub use lookup::LookupResult;pub use lookup::LookupRow;pub use mic::MIC_TO_YAHOO_SUFFIX;pub use mic::is_isin;pub use mic::mic_to_suffix;pub use mic::resolve_symbol;pub use news::NewsArticle;pub use options::ExpirationOptions;pub use options::OptionChain;pub use options::OptionContract;pub use quote::AnalystPriceTargets;pub use quote::Calendar;pub use quote::FastInfo;pub use quote::FundHolding;pub use quote::FundsData;pub use quote::HolderRow;pub use quote::Holders;pub use quote::Info;pub use quote::NamedTable;pub use quote::RecommendationTrend;pub use quote::SecFiling;pub use quote::Sustainability;pub use quote::UpgradesDowngrades;pub use screener::ETFQuery;pub use screener::EquityQuery;pub use screener::FundQuery;pub use screener::Operand;pub use screener::Operator;pub use screener::Query;pub use screener::QueryKind;pub use screener::ScreenOptions;pub use screener::ScreenerQuery;pub use screener::ScreenerQuote;pub use screener::ScreenerResult;pub use screener::ScreenerValue;pub use search::SearchNews;pub use search::SearchQuote;pub use search::SearchResult;
Modules§
- auth
- Authentication (mirrors yfinance’s
Auth): inject the YahooT/Ylogin cookies and inspect the resulting subscription entitlement. - blocking
- Blocking (synchronous) facade over the async
crate::Client. - cache
- On-disk sqlite cache for persisted data (crumb, ticker→timezone, isin→ticker).
- calendars
- Calendars (mirrors yfinance’s
Calendars): earnings / IPO / economic / splits, served by thev1/finance/visualizationendpoint. - client
- The main
Cliententry point and theTickerhandle, plus the blocking facade. Mirrors yfinance’sTicker+ module-leveldownload(). - config
- Runtime configuration for sessions and clients.
- domain
- Domain objects:
Sector,Industry,Market(mirrors yfinance’sdomain/package). - earnings
- Per-ticker earnings dates (mirrors
Ticker.get_earnings_dates). - error
- Error types for the yfinance Rust port.
- fundamentals
- Financial statements: income / balance-sheet / cash-flow.
- history
- Price history: typed
History/Barparsed from thev8/finance/chartendpoint, with dividend/split adjustment and corporate actions. - http
- HTTP session: the
YfSessionis the shared, thread-safe core that owns the impersonating HTTP client, cookie/consent bootstrap, crumb, retry/backoff, and the sqlite cache. Mirrors yfinance’sYfDatasingleton. - isin
- ISIN ↔ ticker resolution.
- json
- Centralised JSON value accessors for Yahoo Finance responses.
- live
- Live streaming (mirrors yfinance’s
live): a WebSocket price stream fromstreamer.finance.yahoo.com, decoding thePricingDataprotobuf frames. - lookup
- Lookup (mirrors yfinance’s
Lookup). - mic
- Market Identifier Code (MIC) → Yahoo Finance suffix mapping and ISIN detection.
- news
- Per-ticker news feed (mirrors
Ticker.get_news). - options
- Options chain (mirrors yfinance’s
Ticker.option_chain). - quote
quoteSummaryfamily:info,fast_info, holders, analysis, sustainability, funds, and calendar endpoints.- screener
- Screener (mirrors yfinance’s
screenerpackage): theEquityQuery/FundQuery/ETFQueryquery-builder DSL plusscreen()against Yahoo’s screener endpoints. - search
- Search (mirrors yfinance’s
Search).