alpaca_data/lib.rs
1//! Async Rust client for the Alpaca Market Data HTTP API.
2//!
3//! The crate follows a mirror layer plus thin convenience layer design:
4//! resource methods track the official Alpaca HTTP API closely, while stable
5//! helpers such as pagination aggregators remain opt-in.
6//!
7//! Environment variables:
8//!
9//! - `ALPACA_DATA_API_KEY`
10//! - `ALPACA_DATA_SECRET_KEY`
11//!
12//! ```no_run
13//! use alpaca_data::Client;
14//!
15//! let client = Client::builder().credentials_from_env()?.build()?;
16//! let _stocks = client.stocks();
17//! # Ok::<(), alpaca_data::Error>(())
18//! ```
19//!
20//! See the workspace docs site at <https://wmzhai.github.io/alpaca-rust/>.
21//!
22#![forbid(unsafe_code)]
23
24extern crate self as alpaca_data;
25
26mod client;
27mod error;
28mod pagination;
29mod symbols;
30
31pub mod cache;
32pub mod corporate_actions;
33pub mod news;
34pub mod options;
35pub mod stocks;
36
37pub use client::{Client, ClientBuilder, DATA_API_KEY_ENV, DATA_SECRET_KEY_ENV};
38pub use error::Error;
39pub use symbols::{display_stock_symbol, options_underlying_symbol};
40
41#[cfg(test)]
42mod tests;