Skip to main content

Crate alpaca_trade

Crate alpaca_trade 

Source
Expand description

Async Rust client for the Alpaca Trading HTTP API.

The default builder targets Alpaca paper trading. Use Client::builder().live() to select the live base URL, or base_url_str(...) for a custom endpoint.

Environment variables:

  • ALPACA_TRADE_API_KEY
  • ALPACA_TRADE_SECRET_KEY
  • ALPACA_TRADE_BASE_URL
use alpaca_trade::Client;

let client = Client::builder()
    .credentials_from_env()?
    .base_url_from_env()?
    .build()?;
let _account = client.account();

For mock-backed lifecycle validation, see alpaca-mock and the workspace docs site at https://wmzhai.github.io/alpaca-rust/.

Modules§

account
account_configurations
activities
assets
calendar
clock
options_contracts
orders
portfolio_history
positions
watchlists

Structs§

Client
ClientBuilder

Enums§

Error

Constants§

DEFAULT_LIVE_BASE_URL
DEFAULT_PAPER_BASE_URL
TRADE_API_KEY_ENV
TRADE_BASE_URL_ENV
TRADE_SECRET_KEY_ENV