Skip to main content

Crate fmp_rust_sdk

Crate fmp_rust_sdk 

Source
Expand description

An asynchronous SDK for the Financial Modeling Prep Stable API.

use fmp_rust_sdk::{Client, WebSocketEntitlements};

let client = Client::from_env(WebSocketEntitlements::none())?;
let quotes = client.quote("AAPL").await?;
println!("{:?}", quotes);

FMP does not document an API-key endpoint that returns the billing plan. Supply the plan shown in the FMP dashboard through Subscription; Client::probe_access verifies access to a specific request without claiming to identify an exact tier. Client::from_env and Client::from_dotenv read optional FMP_PLAN, defaulting to the free plan (Plan::Basic) when it is unset or blank. WebSocket grants are independent of the configured plan and must be explicitly supplied after FMP approves the relevant clusters.

Re-exports§

pub use plan::Plan;
pub use plan::Subscription;
pub use plan::WebSocketEntitlements;

Modules§

endpoints
Typed convenience methods and explicit Stable API query options.
models
Typed responses from the FMP Stable API.
plan
Subscription configuration and advisory limits for Financial Modeling Prep.
websocket
Current market-stream and legacy cluster WebSocket connections.

Structs§

AccessReport
Subscription configuration alongside one server-observed capability.
Client
Reusable, asynchronous FMP connector. Clones share the connection pool. API keys travel in a sensitive header, and redirects are rejected.
ClientConfig
HTTP transport configuration. Override the base URL for a gateway or a local protocol test; unencrypted HTTP is accepted only on loopback hosts.
JsonDecodeError
A JSON/schema error whose diagnostic message has had credentials removed. The original serde error cannot be retained because it may quote a secret response value in its Display, Debug, or source chain.
RequestContext
The request URL and query parameters. Authentication is sent in a header, never included in this value.
RetryPolicy
Bounded retries for transient transport errors, HTTP 408/429, and HTTP 5xx. Authentication, access restrictions, and invalid schemas are never retried.

Enums§

AccessOutcome
Observed access to one endpoint and parameter combination. An empty response still counts as allowed, and says nothing about other symbols or date ranges.
ApiErrorKind
Classification of a provider error; the original status and body are retained.
Error
Specific, contextual failures. API keys are redacted from all retained bodies.

Type Aliases§

Result
A result from an FMP HTTP request or configuration operation.