pub struct Analyst { /* private fields */ }Expand description
Analyst API endpoints
Implementations§
Source§impl Analyst
impl Analyst
Sourcepub async fn get_estimates(
&self,
symbol: &str,
period: Option<Period>,
limit: Option<u32>,
) -> Result<Vec<AnalystEstimates>>
pub async fn get_estimates( &self, symbol: &str, period: Option<Period>, limit: Option<u32>, ) -> Result<Vec<AnalystEstimates>>
Get analyst estimates for a symbol
§Arguments
symbol- Stock symbol (e.g., “AAPL”)period- Period (annual or quarter, optional)limit- Number of results (optional)
§Example
let client = FmpClient::new()?;
let estimates = client.analyst().get_estimates("AAPL", Some(Period::Annual), Some(10)).await?;
for estimate in estimates {
println!("{}: Estimated EPS {:.2}", estimate.date, estimate.estimated_eps_avg);
}Sourcepub async fn get_price_targets(&self, symbol: &str) -> Result<Vec<PriceTarget>>
pub async fn get_price_targets(&self, symbol: &str) -> Result<Vec<PriceTarget>>
Get price targets for a symbol
§Arguments
symbol- Stock symbol (e.g., “AAPL”)
§Example
let client = FmpClient::new()?;
let targets = client.analyst().get_price_targets("AAPL").await?;
for target in targets {
println!("{} from {}: ${:.2}", target.published_date, target.analyst_company, target.price_target);
}Sourcepub async fn get_price_target_consensus(
&self,
symbol: &str,
) -> Result<Vec<PriceTargetConsensus>>
pub async fn get_price_target_consensus( &self, symbol: &str, ) -> Result<Vec<PriceTargetConsensus>>
Get analyst price target consensus for a symbol
§Arguments
symbol- Stock symbol (e.g., “AAPL”)
§Example
let client = FmpClient::new()?;
let consensus = client.analyst().get_price_target_consensus("AAPL").await?;
println!("Target High: ${:.2}, Target Low: ${:.2}",
consensus.first().unwrap().target_high,
consensus.first().unwrap().target_low);Sourcepub async fn get_grades(&self, symbol: &str) -> Result<Vec<AnalystGrade>>
pub async fn get_grades(&self, symbol: &str) -> Result<Vec<AnalystGrade>>
Get analyst recommendations/upgrades for a symbol
§Arguments
symbol- Stock symbol (e.g., “AAPL”)
§Example
let client = FmpClient::new()?;
let grades = client.analyst().get_grades("AAPL").await?;
for grade in grades {
println!("{} from {}: {} -> {}",
grade.published_date,
grade.grading_company,
grade.previous_grade.unwrap_or_default(),
grade.new_grade);
}Sourcepub async fn get_recommendation_consensus(
&self,
symbol: &str,
) -> Result<Vec<ConsensusSummary>>
pub async fn get_recommendation_consensus( &self, symbol: &str, ) -> Result<Vec<ConsensusSummary>>
Get analyst recommendation consensus for a symbol
§Arguments
symbol- Stock symbol (e.g., “AAPL”)
§Example
let client = FmpClient::new()?;
let consensus = client.analyst().get_recommendation_consensus("AAPL").await?;
for rec in consensus {
println!("Strong Buy: {}, Buy: {}, Hold: {}, Sell: {}, Strong Sell: {}",
rec.strong_buy, rec.buy, rec.hold, rec.sell, rec.strong_sell);
println!("Consensus: {}", rec.consensus);
}Auto Trait Implementations§
impl Freeze for Analyst
impl !RefUnwindSafe for Analyst
impl Send for Analyst
impl Sync for Analyst
impl Unpin for Analyst
impl !UnwindSafe for Analyst
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
Mutably borrows from an owned value. Read more