fmp_rust_sdk/lib.rs
1//! An asynchronous SDK for the [Financial Modeling Prep Stable API](https://site.financialmodelingprep.com/developer/docs).
2//!
3//! ```no_run
4//! use fmp_rust_sdk::{Client, WebSocketEntitlements};
5//!
6//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
7//! let client = Client::from_env(WebSocketEntitlements::none())?;
8//! let quotes = client.quote("AAPL").await?;
9//! println!("{:?}", quotes);
10//! # Ok(())
11//! # }
12//! ```
13//!
14//! FMP does not document an API-key endpoint that returns the billing plan. Supply
15//! the plan shown in the FMP dashboard through [`Subscription`]; [`Client::probe_access`]
16//! verifies access to a specific request without claiming to identify an exact tier.
17//! [`Client::from_env`] and [`Client::from_dotenv`] read optional `FMP_PLAN`,
18//! defaulting to the free plan ([`Plan::Basic`]) when it is unset or blank.
19//! WebSocket grants are independent of the configured plan and must be explicitly
20//! supplied after FMP approves the relevant clusters.
21
22mod access;
23mod client;
24mod config;
25mod credentials;
26pub mod endpoints;
27mod error;
28pub mod models;
29pub mod plan;
30#[cfg(feature = "websocket")]
31pub mod websocket;
32
33pub use access::{AccessOutcome, AccessReport};
34pub use client::{Client, ClientConfig, RetryPolicy};
35pub use error::{ApiErrorKind, Error, JsonDecodeError, RequestContext, Result};
36pub use plan::{Plan, Subscription, WebSocketEntitlements};