pub struct Ticker { /* private fields */ }Expand description
Ticker for fetching symbol-specific data.
Provides access to quotes, charts, financials, news, and other data for a specific symbol. Uses smart lazy loading - quote data is fetched once and cached.
§Example
use finance_query::Ticker;
let ticker = Ticker::new("AAPL").await?;
// Get quote data
let quote = ticker.quote(false).await?;
println!("Price: {:?}", quote.regular_market_price);
// Get chart data
use finance_query::{Interval, TimeRange};
let chart = ticker.chart(Interval::OneDay, TimeRange::OneMonth).await?;
println!("Candles: {}", chart.candles.len());Implementations§
Source§impl Ticker
impl Ticker
Sourcepub fn builder(symbol: impl Into<String>) -> TickerBuilder
pub fn builder(symbol: impl Into<String>) -> TickerBuilder
Creates a new builder for Ticker
Use this for custom configuration (language, region, timeout, proxy).
§Arguments
symbol- Stock symbol (e.g., “AAPL”, “MSFT”)
§Examples
use finance_query::Ticker;
// Simple case with defaults (same as new())
let ticker = Ticker::builder("AAPL").build().await?;
// With custom configuration
let ticker = Ticker::builder("AAPL")
.lang("ja-JP")
.region_code("JP")
.build()
.await?;Source§impl Ticker
impl Ticker
Sourcepub async fn summary_detail(&self) -> Result<Option<SummaryDetail>>
pub async fn summary_detail(&self) -> Result<Option<SummaryDetail>>
Get summary detail
Sourcepub async fn financial_data(&self) -> Result<Option<FinancialData>>
pub async fn financial_data(&self) -> Result<Option<FinancialData>>
Get financial data
Sourcepub async fn asset_profile(&self) -> Result<Option<AssetProfile>>
pub async fn asset_profile(&self) -> Result<Option<AssetProfile>>
Get asset profile
Sourcepub async fn calendar_events(&self) -> Result<Option<CalendarEvents>>
pub async fn calendar_events(&self) -> Result<Option<CalendarEvents>>
Get calendar events
Sourcepub async fn earnings_trend(&self) -> Result<Option<EarningsTrend>>
pub async fn earnings_trend(&self) -> Result<Option<EarningsTrend>>
Get earnings trend
Sourcepub async fn earnings_history(&self) -> Result<Option<EarningsHistory>>
pub async fn earnings_history(&self) -> Result<Option<EarningsHistory>>
Get earnings history
Sourcepub async fn recommendation_trend(&self) -> Result<Option<RecommendationTrend>>
pub async fn recommendation_trend(&self) -> Result<Option<RecommendationTrend>>
Get recommendation trend
Sourcepub async fn insider_holders(&self) -> Result<Option<InsiderHolders>>
pub async fn insider_holders(&self) -> Result<Option<InsiderHolders>>
Get insider holders
Sourcepub async fn insider_transactions(&self) -> Result<Option<InsiderTransactions>>
pub async fn insider_transactions(&self) -> Result<Option<InsiderTransactions>>
Get insider transactions
Sourcepub async fn institution_ownership(
&self,
) -> Result<Option<InstitutionOwnership>>
pub async fn institution_ownership( &self, ) -> Result<Option<InstitutionOwnership>>
Get institution ownership
Sourcepub async fn fund_ownership(&self) -> Result<Option<FundOwnership>>
pub async fn fund_ownership(&self) -> Result<Option<FundOwnership>>
Get fund ownership
Sourcepub async fn major_holders(&self) -> Result<Option<MajorHoldersBreakdown>>
pub async fn major_holders(&self) -> Result<Option<MajorHoldersBreakdown>>
Get major holders breakdown
Get net share purchase activity
Sourcepub async fn quote_type(&self) -> Result<Option<QuoteTypeData>>
pub async fn quote_type(&self) -> Result<Option<QuoteTypeData>>
Get quote type
Sourcepub async fn summary_profile(&self) -> Result<Option<SummaryProfile>>
pub async fn summary_profile(&self) -> Result<Option<SummaryProfile>>
Get summary profile
Sourcepub async fn sec_filings(&self) -> Result<Option<SecFilings>>
pub async fn sec_filings(&self) -> Result<Option<SecFilings>>
Get SEC filings
Sourcepub async fn grading_history(&self) -> Result<Option<UpgradeDowngradeHistory>>
pub async fn grading_history(&self) -> Result<Option<UpgradeDowngradeHistory>>
Get upgrade/downgrade history
Source§impl Ticker
impl Ticker
Sourcepub async fn quote(&self, include_logo: bool) -> Result<Quote>
pub async fn quote(&self, include_logo: bool) -> Result<Quote>
Get full quote data with optional logo URL
§Arguments
include_logo- Whether to fetch and include the company logo URL
When include_logo is true, fetches both quote summary and logo URL in parallel
using tokio::join! for minimal latency impact (~0-100ms overhead).
Sourcepub async fn chart(&self, interval: Interval, range: TimeRange) -> Result<Chart>
pub async fn chart(&self, interval: Interval, range: TimeRange) -> Result<Chart>
Get historical chart data
Sourcepub async fn dividends(&self, range: TimeRange) -> Result<Vec<Dividend>>
pub async fn dividends(&self, range: TimeRange) -> Result<Vec<Dividend>>
Get dividend history
Returns historical dividend payments sorted by date. Events are lazily loaded (fetched once, then filtered by range).
§Arguments
range- Time range to filter dividends
§Example
use finance_query::{Ticker, TimeRange};
let ticker = Ticker::new("AAPL").await?;
// Get all dividends
let all = ticker.dividends(TimeRange::Max).await?;
// Get last year's dividends
let recent = ticker.dividends(TimeRange::OneYear).await?;Sourcepub async fn splits(&self, range: TimeRange) -> Result<Vec<Split>>
pub async fn splits(&self, range: TimeRange) -> Result<Vec<Split>>
Get stock split history
Returns historical stock splits sorted by date. Events are lazily loaded (fetched once, then filtered by range).
§Arguments
range- Time range to filter splits
§Example
use finance_query::{Ticker, TimeRange};
let ticker = Ticker::new("NVDA").await?;
// Get all splits
let all = ticker.splits(TimeRange::Max).await?;
// Get last 5 years
let recent = ticker.splits(TimeRange::FiveYears).await?;Sourcepub async fn capital_gains(&self, range: TimeRange) -> Result<Vec<CapitalGain>>
pub async fn capital_gains(&self, range: TimeRange) -> Result<Vec<CapitalGain>>
Get capital gains distribution history
Returns historical capital gain distributions sorted by date. This is primarily relevant for mutual funds and ETFs. Events are lazily loaded (fetched once, then filtered by range).
§Arguments
range- Time range to filter capital gains
§Example
use finance_query::{Ticker, TimeRange};
let ticker = Ticker::new("VFIAX").await?;
// Get all capital gains
let all = ticker.capital_gains(TimeRange::Max).await?;
// Get last 2 years
let recent = ticker.capital_gains(TimeRange::TwoYears).await?;Sourcepub async fn indicators(
&self,
interval: Interval,
range: TimeRange,
) -> Result<IndicatorsSummary>
pub async fn indicators( &self, interval: Interval, range: TimeRange, ) -> Result<IndicatorsSummary>
Calculate all technical indicators from chart data
§Arguments
interval- The time interval for each candlerange- The time range to fetch data for
§Returns
Returns IndicatorsSummary containing all calculated indicators.
§Example
use finance_query::{Ticker, Interval, TimeRange};
let ticker = Ticker::new("AAPL").await?;
let indicators = ticker.indicators(Interval::OneDay, TimeRange::OneYear).await?;
println!("RSI(14): {:?}", indicators.rsi_14);
println!("MACD: {:?}", indicators.macd);Sourcepub async fn recommendations(&self, limit: u32) -> Result<Recommendation>
pub async fn recommendations(&self, limit: u32) -> Result<Recommendation>
Get analyst recommendations
Sourcepub async fn financials(
&self,
statement_type: StatementType,
frequency: Frequency,
) -> Result<FinancialStatement>
pub async fn financials( &self, statement_type: StatementType, frequency: Frequency, ) -> Result<FinancialStatement>
Get financial statements
§Arguments
statement_type- Type of statement (Income, Balance, CashFlow)frequency- Annual or Quarterly
§Example
use finance_query::{Ticker, Frequency, StatementType};
let ticker = Ticker::new("AAPL").await?;
let income = ticker.financials(StatementType::Income, Frequency::Annual).await?;
println!("Revenue: {:?}", income.statement.get("TotalRevenue"));Auto Trait Implementations§
impl Freeze for Ticker
impl !RefUnwindSafe for Ticker
impl Send for Ticker
impl Sync for Ticker
impl Unpin for Ticker
impl !UnwindSafe for Ticker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more