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, Subscription, WebSocketEntitlements};
5//!
6//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
7//! let key = std::env::var("FMP_API_KEY")?;
8//! let subscription = Subscription::new(None, WebSocketEntitlements::default());
9//! let client = Client::new(&key, subscription)?;
10//! let quotes = client.quote("AAPL").await?;
11//! println!("{:?}", quotes);
12//! # Ok(())
13//! # }
14//! ```
15//!
16//! FMP does not document an API-key endpoint that returns the billing plan. Supply
17//! the plan shown in the FMP dashboard through [`Subscription`]; [`Client::probe_access`]
18//! verifies access to a specific request without claiming to identify an exact tier.
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};