Skip to main content

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//! ```text
13//! use alpaca_data::Client;
14//!
15//! let client = Client::builder().credentials_from_env()?.build()?;
16//! let _stocks = client.stocks();
17//! let _crypto = client.crypto();
18//! # Ok::<(), alpaca_data::Error>(())
19//! ```
20//!
21//! See the workspace docs site at <https://wmzhai.github.io/alpaca-rust/>.
22//!
23#![forbid(unsafe_code)]
24
25extern crate self as alpaca_data;
26
27mod client;
28mod error;
29mod pagination;
30mod symbols;
31
32pub mod cache;
33pub mod corporate_actions;
34pub mod crypto;
35pub mod news;
36pub mod options;
37pub mod stocks;
38
39pub use client::{Client, ClientBuilder, DATA_API_KEY_ENV, DATA_SECRET_KEY_ENV};
40pub use error::Error;
41pub use symbols::{display_stock_symbol, options_underlying_symbol};