pub struct Bulk { /* private fields */ }Expand description
Bulk Data API endpoints
Note: These endpoints provide access to large datasets. In production, consider implementing streaming, chunking, or selective downloading to manage memory usage and network bandwidth effectively.
Implementations§
Source§impl Bulk
impl Bulk
Sourcepub async fn get_bulk_stock_prices(&self) -> Result<Vec<BulkStockPrice>>
pub async fn get_bulk_stock_prices(&self) -> Result<Vec<BulkStockPrice>>
Get bulk stock prices (all symbols)
Warning: This endpoint returns data for ALL stocks and can be very large (100MB+). Consider using get_bulk_prices_sample() for testing or implement pagination.
§Example
let client = FmpClient::builder().api_key("your_api_key").build()?;
let bulk = client.bulk();
// WARNING: This downloads ALL stock prices - can be 100MB+
// let all_prices = bulk.get_bulk_stock_prices().await?;
// Use sample version for testing instead:
let sample_prices = bulk.get_bulk_prices_sample(100).await?;Sourcepub async fn get_bulk_prices_sample(
&self,
limit: usize,
) -> Result<Vec<BulkStockPrice>>
pub async fn get_bulk_prices_sample( &self, limit: usize, ) -> Result<Vec<BulkStockPrice>>
Get a sample of bulk stock prices (first N results)
This provides a lightweight way to test the bulk prices endpoint without downloading the entire dataset.
§Arguments
limit- Maximum number of price records to return
§Example
let client = FmpClient::builder().api_key("your_api_key").build()?;
let bulk = client.bulk();
let sample = bulk.get_bulk_prices_sample(50).await?;
println!("Sample contains {} price records", sample.len());Sourcepub async fn get_bulk_financial_statements(
&self,
period: &str,
year: Option<i32>,
) -> Result<Vec<BulkFinancialStatement>>
pub async fn get_bulk_financial_statements( &self, period: &str, year: Option<i32>, ) -> Result<Vec<BulkFinancialStatement>>
Get bulk financial statements for all companies
Warning: This endpoint returns financial data for ALL companies and is extremely large.
§Arguments
period- “annual” or “quarter”year- Year for the financial data (optional)
§Example
let client = FmpClient::builder().api_key("your_api_key").build()?;
let bulk = client.bulk();
// Get sample of annual financial statements
let statements = bulk.get_bulk_financials_sample("annual", Some(2023), 10).await?;Sourcepub async fn get_bulk_financials_sample(
&self,
period: &str,
year: Option<i32>,
limit: usize,
) -> Result<Vec<BulkFinancialStatement>>
pub async fn get_bulk_financials_sample( &self, period: &str, year: Option<i32>, limit: usize, ) -> Result<Vec<BulkFinancialStatement>>
Get sample of bulk financial statements
§Arguments
period- “annual” or “quarter”year- Year for the financial data (optional)limit- Maximum number of records to return
Sourcepub async fn get_bulk_etf_holdings(&self) -> Result<Vec<BulkEtfHolding>>
pub async fn get_bulk_etf_holdings(&self) -> Result<Vec<BulkEtfHolding>>
Get bulk ETF holdings data
Warning: Contains holdings for ALL ETFs - can be very large.
§Example
let client = FmpClient::builder().api_key("your_api_key").build()?;
let bulk = client.bulk();
let sample_holdings = bulk.get_bulk_etf_holdings_sample(50).await?;Sourcepub async fn get_bulk_etf_holdings_sample(
&self,
limit: usize,
) -> Result<Vec<BulkEtfHolding>>
pub async fn get_bulk_etf_holdings_sample( &self, limit: usize, ) -> Result<Vec<BulkEtfHolding>>
Sourcepub async fn get_bulk_insider_trades(&self) -> Result<Vec<BulkInsiderTrade>>
pub async fn get_bulk_insider_trades(&self) -> Result<Vec<BulkInsiderTrade>>
Get bulk insider trading data
Warning: Contains ALL insider trades - extremely large dataset.
§Example
let client = FmpClient::builder().api_key("your_api_key").build()?;
let bulk = client.bulk();
let recent_trades = bulk.get_bulk_insider_trades_sample(25).await?;Sourcepub async fn get_bulk_insider_trades_sample(
&self,
limit: usize,
) -> Result<Vec<BulkInsiderTrade>>
pub async fn get_bulk_insider_trades_sample( &self, limit: usize, ) -> Result<Vec<BulkInsiderTrade>>
Get sample of bulk insider trading data
§Arguments
limit- Maximum number of trade records to return
Sourcepub async fn get_bulk_institutional_holdings(
&self,
date: Option<&str>,
) -> Result<Vec<BulkInstitutionalHolding>>
pub async fn get_bulk_institutional_holdings( &self, date: Option<&str>, ) -> Result<Vec<BulkInstitutionalHolding>>
Get bulk institutional holdings (13F filings)
Warning: Contains ALL institutional holdings - massive dataset.
§Arguments
date- Filing date (YYYY-MM-DD format, optional)
§Example
let client = FmpClient::builder().api_key("your_api_key").build()?;
let bulk = client.bulk();
let recent_holdings = bulk.get_bulk_institutional_holdings_sample(None, 30).await?;Sourcepub async fn get_bulk_institutional_holdings_sample(
&self,
date: Option<&str>,
limit: usize,
) -> Result<Vec<BulkInstitutionalHolding>>
pub async fn get_bulk_institutional_holdings_sample( &self, date: Option<&str>, limit: usize, ) -> Result<Vec<BulkInstitutionalHolding>>
Get sample of institutional holdings
§Arguments
date- Filing date (optional)limit- Maximum number of records to return
Sourcepub async fn get_bulk_earnings_estimates(
&self,
period: &str,
) -> Result<Vec<BulkEarningsEstimate>>
pub async fn get_bulk_earnings_estimates( &self, period: &str, ) -> Result<Vec<BulkEarningsEstimate>>
Sourcepub async fn get_bulk_earnings_estimates_sample(
&self,
period: &str,
limit: usize,
) -> Result<Vec<BulkEarningsEstimate>>
pub async fn get_bulk_earnings_estimates_sample( &self, period: &str, limit: usize, ) -> Result<Vec<BulkEarningsEstimate>>
Get sample of earnings estimates
§Arguments
period- “annual” or “quarter”limit- Maximum number of records to return
Sourcepub async fn get_bulk_data_info(&self) -> Result<Vec<BulkDataInfo>>
pub async fn get_bulk_data_info(&self) -> Result<Vec<BulkDataInfo>>
Get bulk dataset information/metadata
Returns metadata about available bulk datasets including size, last update time, and download URLs.
§Example
let client = FmpClient::builder().api_key("your_api_key").build()?;
let bulk = client.bulk();
let info = bulk.get_bulk_data_info().await?;
for dataset in info {
println!("Dataset: {:?}, Size: {:?} MB",
dataset.dataset,
dataset.file_size.map(|s| s / 1024 / 1024));
}Sourcepub async fn get_historical_prices_metadata(
&self,
exchange: Option<&str>,
) -> Result<Vec<BulkHistoricalPricesMeta>>
pub async fn get_historical_prices_metadata( &self, exchange: Option<&str>, ) -> Result<Vec<BulkHistoricalPricesMeta>>
Get historical prices metadata for bulk download planning
Returns information about available historical price datasets to help plan bulk downloads efficiently.
§Arguments
exchange- Exchange identifier (optional, e.g., “NYSE”, “NASDAQ”)
§Example
let client = FmpClient::builder().api_key("your_api_key").build()?;
let bulk = client.bulk();
let meta = bulk.get_historical_prices_metadata(Some("NYSE")).await?;
for info in meta {
println!("NYSE Historical Data: {} symbols, ~{} MB",
info.symbols_count.unwrap_or(0),
info.estimated_size_mb.unwrap_or(0.0));
}