pub struct EquityClient<'a> { /* private fields */ }Expand description
High-level equity data facade built on top of TradingView screener and quote sessions.
This facade exposes typed products for common stock workflows such as:
- quotes and market movers
- fundamentals snapshots
- analyst summaries, targets, forecasts, and earnings metadata
- native estimate history and point-in-time fundamentals
§Examples
use tvdata_rs::{Result, TradingViewClient};
#[tokio::main]
async fn main() -> Result<()> {
let client = TradingViewClient::builder().build()?;
let equity = client.equity();
let quote = equity.quote("NASDAQ:AAPL").await?;
let analyst = equity.analyst_summary("NASDAQ:AAPL").await?;
println!("{:?} {:?}", quote.close, analyst.price_targets.average);
Ok(())
}Implementations§
Source§impl<'a> EquityClient<'a>
impl<'a> EquityClient<'a>
pub const fn new(client: &'a TradingViewClient) -> Self
pub fn client(&self) -> &'a TradingViewClient
Sourcepub async fn quote(&self, symbol: impl Into<Ticker>) -> Result<QuoteSnapshot>
pub async fn quote(&self, symbol: impl Into<Ticker>) -> Result<QuoteSnapshot>
Fetches a typed equity quote snapshot for a single symbol.
Sourcepub async fn quotes<I, T>(&self, symbols: I) -> Result<Vec<QuoteSnapshot>>
pub async fn quotes<I, T>(&self, symbols: I) -> Result<Vec<QuoteSnapshot>>
Fetches typed quote snapshots for multiple symbols while preserving the requested order.
pub async fn quotes_batch<I, T>( &self, symbols: I, ) -> Result<BatchResult<QuoteSnapshot>>
Sourcepub async fn fundamentals(
&self,
symbol: impl Into<Ticker>,
) -> Result<FundamentalsSnapshot>
pub async fn fundamentals( &self, symbol: impl Into<Ticker>, ) -> Result<FundamentalsSnapshot>
Fetches a fundamentals snapshot for a single equity symbol.
§Examples
use tvdata_rs::{Result, TradingViewClient};
#[tokio::main]
async fn main() -> Result<()> {
let client = TradingViewClient::builder().build()?;
let fundamentals = client.equity().fundamentals("NASDAQ:AAPL").await?;
println!("{:?}", fundamentals.market_cap);
Ok(())
}pub async fn fundamentals_history( &self, symbol: impl Into<Ticker>, ) -> Result<PointInTimeFundamentals>
Sourcepub async fn fundamentals_point_in_time(
&self,
symbol: impl Into<Ticker>,
) -> Result<PointInTimeFundamentals>
pub async fn fundamentals_point_in_time( &self, symbol: impl Into<Ticker>, ) -> Result<PointInTimeFundamentals>
Fetches native point-in-time fundamentals history from TradingView quote sessions.
pub async fn fundamentals_histories<I, T>( &self, symbols: I, ) -> Result<Vec<PointInTimeFundamentals>>
pub async fn fundamentals_point_in_time_batch<I, T>( &self, symbols: I, ) -> Result<Vec<PointInTimeFundamentals>>
pub async fn fundamentals_batch<I, T>( &self, symbols: I, ) -> Result<Vec<FundamentalsSnapshot>>
Sourcepub async fn analyst_summary(
&self,
symbol: impl Into<Ticker>,
) -> Result<AnalystSummary>
pub async fn analyst_summary( &self, symbol: impl Into<Ticker>, ) -> Result<AnalystSummary>
Fetches a rich analyst snapshot combining recommendations, targets, forecasts, earnings, and FX conversion metadata.
§Examples
use tvdata_rs::{Result, TradingViewClient};
#[tokio::main]
async fn main() -> Result<()> {
let client = TradingViewClient::builder().build()?;
let analyst = client.equity().analyst_summary("NASDAQ:AAPL").await?;
println!("{:?}", analyst.recommendations.rating);
Ok(())
}Sourcepub async fn estimate_history(
&self,
symbol: impl Into<Ticker>,
) -> Result<EstimateHistory>
pub async fn estimate_history( &self, symbol: impl Into<Ticker>, ) -> Result<EstimateHistory>
Fetches native analyst estimate history from TradingView quote sessions.
The returned model is point-in-time aware and distinguishes annual and quarterly observations.
§Examples
use tvdata_rs::{Result, TradingViewClient};
#[tokio::main]
async fn main() -> Result<()> {
let client = TradingViewClient::builder().build()?;
let history = client.equity().estimate_history("NASDAQ:AAPL").await?;
println!(
"quarterly observations: {}",
history.quarterly.len()
);
Ok(())
}pub async fn earnings_history( &self, symbol: impl Into<Ticker>, ) -> Result<EstimateHistory>
pub async fn estimate_histories<I, T>( &self, symbols: I, ) -> Result<Vec<EstimateHistory>>
pub async fn earnings_histories<I, T>( &self, symbols: I, ) -> Result<Vec<EstimateHistory>>
pub async fn analyst_recommendations( &self, symbol: impl Into<Ticker>, ) -> Result<AnalystRecommendations>
pub async fn price_targets( &self, symbol: impl Into<Ticker>, ) -> Result<AnalystPriceTargets>
pub async fn analyst_forecasts( &self, symbol: impl Into<Ticker>, ) -> Result<AnalystForecasts>
pub async fn earnings_calendar( &self, symbol: impl Into<Ticker>, ) -> Result<EarningsCalendar>
pub async fn earnings_events( &self, symbol: impl Into<Ticker>, ) -> Result<EarningsCalendar>
pub async fn analyst_fx_rates( &self, symbol: impl Into<Ticker>, ) -> Result<AnalystFxRates>
pub async fn analyst_summaries<I, T>( &self, symbols: I, ) -> Result<Vec<AnalystSummary>>
pub async fn technical_summary( &self, symbol: impl Into<Ticker>, ) -> Result<TechnicalSummary>
pub async fn technical_summaries<I, T>( &self, symbols: I, ) -> Result<Vec<TechnicalSummary>>
pub async fn overview( &self, symbol: impl Into<Ticker>, ) -> Result<EquityOverview>
pub async fn overviews<I, T>(&self, symbols: I) -> Result<Vec<EquityOverview>>
Sourcepub async fn top_gainers(
&self,
market: impl Into<Market>,
limit: usize,
) -> Result<Vec<QuoteSnapshot>>
pub async fn top_gainers( &self, market: impl Into<Market>, limit: usize, ) -> Result<Vec<QuoteSnapshot>>
Fetches the strongest equity movers in a market by percentage change.
pub async fn top_losers( &self, market: impl Into<Market>, limit: usize, ) -> Result<Vec<QuoteSnapshot>>
pub async fn most_active( &self, market: impl Into<Market>, limit: usize, ) -> Result<Vec<QuoteSnapshot>>
Trait Implementations§
Source§impl<'a> Clone for EquityClient<'a>
impl<'a> Clone for EquityClient<'a>
Source§fn clone(&self) -> EquityClient<'a>
fn clone(&self) -> EquityClient<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more