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, YahooFinanceClient, YahooError};
38
39// Re-export websocket types
40pub use websocket::{QuotesUpdate, ProfileUpdate, MoversUpdate, MarketHours, MovingAverageUpdate};
41
42// Re-export streaming types
43pub use streaming::{QuoteStream, SingleQuoteStream, IndexStream, MoversStream};
44
45// Re-export quote models
46pub use models::{Quote, SimpleQuote, DetailedQuote};
47
48// Re-export historical models
49pub use models::{HistoricalData, HistoricalResponse, TimeRange, Interval, IndicatorType};
50
51// Re-export news models
52pub use models::News;
53
54// Re-export search models
55pub use models::{SearchResult, SearchResponse};
56
57// Re-export financial models
58pub use models::{FinancialStatement, StatementType, Frequency};
59
60// Re-export movers models
61pub use models::{MoverCount, MarketMover};
62
63// Re-export indices models
64pub use models::{Region, Index, MarketIndex, get_index_regions};
65
66// Re-export holders models
67pub use models::{
68    HolderType, MajorHoldersBreakdown, InstitutionalHolder, MutualFundHolder,
69    InsiderTransaction, InsiderPurchase, InsiderRosterMember,
70    MajorHoldersResponse, InstitutionalHoldersResponse, MutualFundHoldersResponse,
71    InsiderTransactionsResponse, InsiderPurchasesResponse, InsiderRosterResponse,
72    HoldersData,
73};
74
75// Re-export analysts models
76pub use models::{
77    AnalysisType, RecommendationData, UpgradeDowngrade, PriceTarget,
78    EarningsEstimate, RevenueEstimate, EarningsHistoryItem,
79    RecommendationsResponse, UpgradesDowngradesResponse, PriceTargetsResponse,
80    EarningsEstimateResponse, RevenueEstimateResponse, EarningsHistoryResponse,
81    EpsTrend, EpsRevisions, GrowthEstimate,
82    EpsTrendResponse, EpsRevisionsResponse, GrowthEstimatesResponse,
83};
84
85// Re-export sectors models
86pub use models::{Sector, MarketSector, MarketSectorDetails};
87
88// Re-export earnings transcripts models
89pub use models::{
90    Quarter, EarningsCallListing, EarningsCallsList, TranscriptSpeaker,
91    TranscriptParagraph, EarningsTranscript,
92};
93
94// Re-export actions models
95pub use models::{ActionsResponse, Dividend, StockSplit, CapitalGain};
96
97// Re-export options models
98pub use models::{OptionChain, OptionContract, OptionExpirations};
99
100// Re-export calendar models
101pub use models::Calendar;
102
103// Re-export SEC filings models
104pub use models::{SecFiling, SecFilingsResponse, SecExhibit};
105
106// Re-export sustainability/ESG models
107pub use models::SustainabilityScores;
108
109// Re-export industry models
110pub use models::{Industry, IndustryCompany};
111
112// Re-export market models
113pub use models::{MarketStatus, MarketSummaryItem, MarketSummaryResponse};