Bulk

Struct Bulk 

Source
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

Source

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?;
Source

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());
Source

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?;
Source

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
Source

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?;
Source

pub async fn get_bulk_etf_holdings_sample( &self, limit: usize, ) -> Result<Vec<BulkEtfHolding>>

Get sample of bulk ETF holdings

§Arguments
  • limit - Maximum number of holding records to return
Source

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?;
Source

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
Source

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?;
Source

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
Source

pub async fn get_bulk_earnings_estimates( &self, period: &str, ) -> Result<Vec<BulkEarningsEstimate>>

Get bulk earnings estimates

§Arguments
  • period - “annual” or “quarter”
§Example
let client = FmpClient::builder().api_key("your_api_key").build()?;
let bulk = client.bulk();
let estimates = bulk.get_bulk_earnings_estimates_sample("quarter", 20).await?;
Source

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
Source

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));
}
Source

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));
}

Auto Trait Implementations§

§

impl Freeze for Bulk

§

impl !RefUnwindSafe for Bulk

§

impl Send for Bulk

§

impl Sync for Bulk

§

impl Unpin for Bulk

§

impl !UnwindSafe for Bulk

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,