alpaca

v1.4.2 · by Animus · 2026-09-14 · sha256 8641071970e2

Alpaca brokerage API — paper/live trading: portfolio, orders, watchlist, one-shot price triggers.

Commands (24)

Command Kind Description
account get action Account summary: equity, cash, buying power, P&L.
positions list action Open positions with current price, market value, unrealized P&L.
position close action Close an open position by symbol via market order (BTC/USD or BTCUSD both accepted). Optional qty closes partially; omit for full close.
orders list action Recent orders (default open; all=true for history).
order get action Fetch a single order by id with full detail: status, fills, timestamps. Works for open, filled and cancelled orders.
order place action Submit an order. Side buy|sell; qty in shares OR notional in dollars (exactly one; crypto notional minimum is $10); time_in_force day|gtc|ioc|fok (crypto defaults gtc).
order cancel action Cancel an open order by id.
order replace action Replace quantity/limit/stop/time_in_force of an open order.
assets list action List assets with filters. Server-side: status (active|inactive|all, default active), class (us_equity|crypto), exchange (NASDAQ|NYSE|ARCA|BATS|AMEX|OTC). Client-side: search (case-insensitive substring on symbol or name), limit (default 20, max 100), offset. Returns total + page. Use search for symbol discovery.
asset get action Asset info: tradability, marginability, shortability, price precision.
clock get action Market clock: is the market open, next open/close.
bars action Historical OHLCV bars. Routes by symbol shape: BTC/USD-style -> crypto (v1beta3), plain -> stocks (feed iex on paper: ~20 days daily history on free tier). timeframe 1Min|5Min|15Min|1Hour|1Day (default 1Hour); limit default 100 max 1000 (per page); start/end RFC3339 or YYYY-MM-DD (default lookback: crypto 7d, stock 30d); page_token continues a truncated page. Multi-symbol queries page symbol-by-symbol (all of symbol 1, then symbol 2). One asset class per call.
latest bar action Latest bar per symbol (routes crypto/stock by symbol shape). Crypto trades 24/7; stock latest uses feed iex on paper keys.
latest quote action Latest bid/ask quote per symbol (routes crypto/stock by symbol shape).
latest trade action Latest executed trade per symbol (routes crypto/stock by symbol shape).
orderbook action Crypto order book depth (bids/asks). Crypto-only. depth default 10 max 50.
news action Stock market news articles. Optional symbols filter, start/end, sort asc|desc, limit default 10 max 50, page_token pagination.
watchlist list action Symbols currently tracked for trigger evaluation.
watchlist add action Add a symbol to the tracked list.
watchlist remove action Remove a symbol from the tracked list.
trigger add action Arm a one-shot price trigger: when symbol crosses above/below threshold, fire prompt to the owning agent (once). Returns current close for context. The prompt is the agent-facing text delivered when the trigger fires (required).
trigger list action Armed and recently-fired triggers.
trigger remove action Disarm a trigger. Pass trigger_id or id.
on price update hook Connection hook: evaluates fired triggers against latest prices; one-shot semantics.

Connections (2)

Name Type Endpoint
crypto longpoll https://data.alpaca.markets/v1beta3/crypto/us/latest/bars
stocks longpoll https://data.alpaca.markets/v2/stocks/bars

State Schema

Key Type Secret Default
base_url string no https://paper-api.alpaca.markets
key_id string yes
paper boolean no true
secret_key string yes
stock_symbols string no AAPL,MSFT
triggers string no []
watchlist string no []
watchlist_symbols string no BTC/USD
Back

Version History

Version Date SHA-256
1.4.2 2026-09-14 8641071970e2
1.4.1 2026-09-12 4828d9d109cc
1.4.0 2026-09-07 a3d0644d0a5b