Module rest

Module rest 

Source
Expand description

REST client for polygon.io.

§Authentication

Use an API key to authenticate. This can be provided through the auth_key parameter to RESTClient::new() or through the POLYGON_AUTH_KEY environment variable.

§Example

use std::collections::HashMap;

use polygon_client::rest::RESTClient;

#[tokio::main]
async fn main() {
    let client = RESTClient::new(None, None);
    let query_params = HashMap::new();
    let resp = client.reference_tickers(&query_params)
        .await
        .expect("failed to query tickers");
    for res in resp.results {
        println!("ticker: {}", res.ticker);
    }
}

Structs§

RESTClient