Skip to main content

Examples

This document describes the runnable example surface for alpaca-data.

Example Style

Examples in this repository follow these rules:

  • async-only
  • minimal happy-path code
  • official method names
  • no extra abstraction layer
  • environment-driven authentication

Example Set

ExampleFocusAuth
client_builder.rsclient construction and runtime tuningoptional
stocks_latest_bar.rsauthenticated stock latest datarequired
stocks_bars_all.rsauthenticated stock pagination helperrequired
options_chain.rsauthenticated options chain snapshotsrequired
crypto_latest_quotes.rspublic crypto latest quotesoptional
news_list.rsauthenticated news listingrequired
corporate_actions_list.rsauthenticated corporate actions listingrequired

Run Examples

Examples that hit authenticated endpoints expect:

  • APCA_API_KEY_ID
  • APCA_API_SECRET_KEY

Optional override:

  • APCA_API_DATA_URL

Run an example with:

cargo run --example client_builder
cargo run --example stocks_latest_bar
cargo run --example stocks_bars_all
cargo run --example options_chain
cargo run --example crypto_latest_quotes
cargo run --example news_list
cargo run --example corporate_actions_list