henryboisdequin / finnhub-rs

Rust client for the Finnhub API

Home Page:https://crates.io/crates/finnhub-rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

finnhub-rs

License: MIT

Rust client for the Finnhub API. Finnhub is a new Stock API which provides endless data for stocks, currencies, and crypto.

Minimal Example:

// Use finnhub-rs client.
use finnhub_rs::client::Client;
use dotenv::dotenv;
use std::env;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let key = "TEST_API_KEY";
    let api_key = env::var(key).expect("Key, value pair not present in .env file");
    // Create a new finnhub client.
    let client = Client::new(api_key);
    // Get a list of supported stocks given the exchange.
    let res = client.stock_symbol("US".to_string()).await.unwrap();
    // Print out the results.
    println!("{:#?}", res);
}

Contributing

Thanks for considering to contribute to Finnhub-rs! Please read the contributing guidelines in the CONTRIBUTING.md to get started.

About

Rust client for the Finnhub API

https://crates.io/crates/finnhub-rs

License:MIT License


Languages

Language:Rust 100.0%Language:Shell 0.0%