pub struct StockDirectory { /* private fields */ }Expand description
Stock directory API endpoints
Implementations§
Source§impl StockDirectory
impl StockDirectory
Sourcepub async fn screen_stocks(
&self,
criteria: &ScreenerCriteria,
) -> Result<Vec<StockScreenerResult>>
pub async fn screen_stocks( &self, criteria: &ScreenerCriteria, ) -> Result<Vec<StockScreenerResult>>
Screen stocks based on various criteria
§Arguments
criteria- Screening criteria to filter stocks
§Example
let client = FmpClient::new()?;
let mut criteria = ScreenerCriteria::default();
criteria.market_cap_more_than = Some(10_000_000_000); // $10B+
criteria.beta_lower_than = Some(1.5);
criteria.is_etf = Some(false);
criteria.is_actively_trading = Some(true);
criteria.limit = Some(100);
let results = client.stock_directory().screen_stocks(&criteria).await?;
for stock in results.iter().take(10) {
println!("{}: {} - ${:.2}B market cap",
stock.symbol,
stock.company_name,
stock.market_cap.unwrap_or(0.0) / 1_000_000_000.0);
}Sourcepub async fn get_tradable_symbols(&self) -> Result<Vec<TradableSymbol>>
pub async fn get_tradable_symbols(&self) -> Result<Vec<TradableSymbol>>
Get list of all available traded symbols
§Example
let client = FmpClient::new()?;
let symbols = client.stock_directory().get_tradable_symbols().await?;
println!("Total tradable symbols: {}", symbols.len());
for symbol in symbols.iter().take(10) {
println!("{}: {}", symbol.symbol, symbol.name);
}Sourcepub async fn get_symbols_by_exchange(
&self,
exchange: &str,
) -> Result<Vec<TradableSymbol>>
pub async fn get_symbols_by_exchange( &self, exchange: &str, ) -> Result<Vec<TradableSymbol>>
Sourcepub async fn get_etf_list(&self) -> Result<Vec<TradableSymbol>>
pub async fn get_etf_list(&self) -> Result<Vec<TradableSymbol>>
Get list of all ETFs
§Example
let client = FmpClient::new()?;
let etfs = client.stock_directory().get_etf_list().await?;
println!("Total ETFs: {}", etfs.len());
for etf in etfs.iter().take(10) {
println!("{}: {}", etf.symbol, etf.name);
}Sourcepub async fn is_symbol_available(
&self,
symbol: &str,
) -> Result<Vec<TradableSymbol>>
pub async fn is_symbol_available( &self, symbol: &str, ) -> Result<Vec<TradableSymbol>>
Auto Trait Implementations§
impl Freeze for StockDirectory
impl !RefUnwindSafe for StockDirectory
impl Send for StockDirectory
impl Sync for StockDirectory
impl Unpin for StockDirectory
impl !UnwindSafe for StockDirectory
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