Skip to main content

finnhub_client_rs/
lib.rs

1//! Async Rust client for the [Finnhub.io](https://finnhub.io) financial data API.
2//!
3//! Create a [`FinnhubClient`] with your API key, then call endpoints through the
4//! accessor methods that mirror Finnhub's own documentation grouping:
5//!
6//! ```no_run
7//! use finnhub_client_rs::FinnhubClient;
8//!
9//! # async fn example() -> finnhub_client_rs::Result<()> {
10//! let client = FinnhubClient::new("your-api-key");
11//! let quote = client.stock().quote("AAPL").await?;
12//! println!("{:?}", quote.current_price);
13//! # Ok(())
14//! # }
15//! ```
16//!
17//! All HTTP goes through a single internal request path that injects
18//! authentication (ADR-0002) and enforces a client-side rate limit
19//! (ADR-0004). The crate never retries on its own; use [`Error::is_retryable`]
20//! and [`Error::retry_after`] to build your own backoff policy (ADR-0003).
21
22mod auth;
23mod client;
24mod de;
25mod error;
26mod rate_limit;
27
28pub mod endpoints;
29pub mod models;
30
31pub use auth::AuthMethod;
32pub use client::{ClientConfig, FinnhubClient};
33pub use error::{Error, Result};