Alpaca messages
9 documented messages of the Alpaca WebSocket streams, grouped by what they do. Each has its fields, what arrives and the source it was read from.
Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.
These are messages and subscriptions carried by a connection that stays open, not HTTP endpoints: none has a method or a path. For that reason they are in no OpenAPI file on this site and the request builder does not list them. A message that is not listed is not recorded here, which is not evidence that it does not exist.
Account events
2 messages
- listenAsks the account stream to send a named stream, trade_updates being the one the page documents. Each listen message replaces the whole set: send every stream you still want, or an empty list to stop.
- trade_updatesOne message per order event on the account: the event name, the whole order object as the REST API returns it, and for fills the price, quantity and resulting position.
Connection
1 message
Market data
5 messages
- bA minute bar for a subscribed symbol, sent just after each minute: open, high, low, close, volume, trade count and VWAP. The same shape arrives as d for daily bars and u for updated bars.
- qThe best bid and ask for a subscribed symbol, with sizes and, for stocks, the exchange on each side.
- subscribeAdds symbols to the connection's subscriptions, by channel. The message adds to the current set, so send only what is new; the reply lists everything now subscribed.
- tOne trade (print) for a subscribed symbol: price, size, exchange, conditions and a nanosecond timestamp. Crypto trades add the taker side.
- unsubscribeRemoves symbols from the connection's subscriptions, by channel. The reply is the whole list that remains.