Alpaca brokerage API — paper/live trading: portfolio, orders, watchlist, one-shot price triggers.
| 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. |