polygon 0.1.1

Rust client library for polygon.io
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Basic usage example for the polygon.io client
use polygon::Polygon;
use polygon::query::Execute;
use polygon::rest::aggs;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Polygon::new()?
    // .with_key("your_api_key_here")
    ;

    // Get previous day's close for AAPL
    let result = aggs::previous_close(&client, "AAPL").get().await?;
    println!("{:?}", result);

    Ok(())
}