alpaca-data
alpaca-data is an async Rust client for the Alpaca Market Data HTTP API.
Current Coverage
- stocks
- options
- news
- corporate actions
Client Entry
use Client;
let client = builder
.credentials_from_env?
.build?;
# let _ = client;
# Ok::
Resource Accessors
client.stocks()client.options()client.news()client.corporate_actions()
Raw Cache Convenience
use CachedClient;
use Client;
let raw = builder
.credentials_from_env?
.build?;
let cache = new;
# let _ = cache;
# Ok::
alpaca_data::cache::CachedClient is an opt-in convenience facade for:
- cache-first stock snapshots
- cache-first raw option snapshots
- explicit stock bar subscriptions
- explicit refresh / clear operations
It does not own scheduling, business clocks, option-chain enrichment, or IV / Greeks calculations.
Main API Surface
Stocks
bars/bars_allauctions/auctions_allquotes/quotes_alltrades/trades_alllatest_barslatest_quoteslatest_tradessnapshotscondition_codesexchange_codes
Options
bars/bars_alltrades/trades_alllatest_quoteslatest_tradessnapshots/snapshots_allchain/chain_allcondition_codesexchange_codes
News
listlist_all
Corporate Actions
listlist_all
Built-in Convenience Helpers
stocks::ordered_snapshots(...)options::ordered_snapshots(...)stocks::Snapshot::{timestamp, price, bid_price, ask_price, session_open, session_high, session_low, session_close, previous_close, session_volume}options::Snapshot::{timestamp, bid_price, ask_price, last_price, mark_price}options::underlying_symbol(...)symbols::display_stock_symbol(...)
Not Implemented
- crypto
- forex
- fixed income
- logos
- screener
- websocket / stream APIs
Environment Variables
ALPACA_DATA_API_KEYALPACA_DATA_SECRET_KEY
See docs/reference/alpaca-data.md and https://docs.rs/alpaca-data for the full reference.