Skip to main content

finance_query_core/
lib.rs

1//! # finance-query-core
2//!
3//! A Rust client library for Yahoo Finance API.
4//!
5//! This crate provides a framework-agnostic client for fetching financial data
6//! from Yahoo Finance, including quotes, historical data, financials, and more.
7//!
8//! ## Features
9//!
10//! - Framework-agnostic design - use with any Rust application
11//! - Automatic authentication handling with cookie/crumb management
12//! - Strongly-typed data models for all Yahoo Finance responses
13//! - Comprehensive error handling
14//!
15//! ## Example
16//!
17//! ```rust,ignore
18//! use finance_query_core::{YahooFinanceClient, YahooAuthManager, FetchClient, TimeRange, Interval};
19//! use std::sync::Arc;
20//!
21//! // Create client components
22//! let fetch_client = Arc::new(FetchClient::new());
23//! let auth_manager = Arc::new(YahooAuthManager::new(fetch_client.clone()));
24//! let client = YahooFinanceClient::new(auth_manager, fetch_client);
25//!
26//! // Fetch a quote
27//! let quote = client.get_quote("AAPL").await?;
28//! ```
29
30pub mod client;
31pub mod models;
32pub mod streaming;
33pub mod utils;
34pub mod websocket;
35
36// Re-export client types
37pub use client::{FetchClient, YahooAuthManager, YahooError, YahooFinanceClient};
38
39// Re-export websocket types
40pub use websocket::{MarketHours, MoversUpdate, MovingAverageUpdate, ProfileUpdate, QuotesUpdate};
41
42// Re-export streaming types
43pub use streaming::{IndexStream, MoversStream, QuoteStream, SingleQuoteStream};
44
45// Re-export quote models
46pub use models::{DetailedQuote, LogoFetcher, Quote, SimpleQuote};
47
48// Re-export historical models
49pub use models::{HistoricalData, HistoricalResponse, IndicatorType, Interval, TimeRange};
50
51// Re-export news models
52pub use models::News;
53
54// Re-export search models
55pub use models::{SearchResponse, SearchResult};
56
57// Re-export financial models
58pub use models::{FinancialStatement, Frequency, StatementType};
59
60// Re-export movers models
61pub use models::{MarketMover, MoverCount};
62
63// Re-export indices models
64pub use models::{get_index_regions, Index, MarketIndex, Region};
65
66// Re-export holders models
67pub use models::{
68    HolderType, HoldersData, InsiderPurchase, InsiderPurchasesResponse, InsiderRosterMember,
69    InsiderRosterResponse, InsiderTransaction, InsiderTransactionsResponse, InstitutionalHolder,
70    InstitutionalHoldersResponse, MajorHoldersBreakdown, MajorHoldersResponse, MutualFundHolder,
71    MutualFundHoldersResponse,
72};
73
74// Re-export analysts models
75pub use models::{
76    AnalysisType, EarningsEstimate, EarningsEstimateResponse, EarningsHistoryItem,
77    EarningsHistoryResponse, EpsRevisions, EpsRevisionsResponse, EpsTrend, EpsTrendResponse,
78    GrowthEstimate, GrowthEstimatesResponse, PriceTarget, PriceTargetsResponse, RecommendationData,
79    RecommendationsResponse, RevenueEstimate, RevenueEstimateResponse, UpgradeDowngrade,
80    UpgradesDowngradesResponse,
81};
82
83// Re-export sectors models
84pub use models::{MarketSector, MarketSectorDetails, Sector};
85
86// Re-export earnings transcripts models
87pub use models::{
88    EarningsCallListing, EarningsCallsList, EarningsTranscript, Quarter, TranscriptParagraph,
89    TranscriptSpeaker,
90};
91
92// Re-export actions models
93pub use models::{ActionsResponse, CapitalGain, Dividend, StockSplit};
94
95// Re-export options models
96pub use models::{OptionChain, OptionContract, OptionExpirations};
97
98// Re-export calendar models
99pub use models::Calendar;
100
101// Re-export SEC filings models
102pub use models::{SecExhibit, SecFiling, SecFilingsResponse};
103
104// Re-export sustainability/ESG models
105pub use models::SustainabilityScores;
106
107// Re-export industry models
108pub use models::{Industry, IndustryCompany};
109
110// Re-export market models
111pub use models::{MarketStatus, MarketSummaryItem, MarketSummaryResponse};