fmp-rust-sdk 0.1.1

Async Rust SDK for Financial Modeling Prep with typed data, subscription awareness, and WebSocket feeds
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::path::Path;

use fmp_rust_sdk::{Client, WebSocketEntitlements};

/// Reads a local .env file without changing process environment variables.
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::from_dotenv(Path::new(".env"), WebSocketEntitlements::none())?;
    let quotes = client.quote("AAPL").await?;
    for quote in quotes {
        println!("{}: {}", quote.symbol, quote.price);
    }
    Ok(())
}