/api/market/streamfor live bars and quotes;/api/account/streamfor orders, positions, and balances.
EventSource
in a browser, a for await loop on a server, or curl -N on the command line is a complete
client.
The snapshot law
Both streams replay a full snapshot on every connect and reconnect, then send incremental events. This one rule makes client state trivial:- on connect, replace your local state with the snapshot;
- after that, apply events as they arrive;
- if the connection drops, reconnect and replace again.