Overview
Streaming provides real-time market data via WebSocket subscriptions. Instead of polling, you subscribe to specific securities and data types, and the server pushes updates to your connection as they happen.
How It Works
- Establish a connection — Connect to the Longbridge WebSocket endpoint using the SDK or the binary protocol.
- Subscribe — Call Subscribe with the securities and data types you want (quotes, depth, trades, brokers).
- Receive pushes — The server sends real-time updates to your connection whenever there is a market change.
- Unsubscribe — Call Unsubscribe to stop receiving updates for specific symbols or data types.
Subscription Types
| Type | Description |
|---|---|
Quote | Real-time bid/ask and last-done price |
Depth | Level 2 order book |
Brokers | Broker queue data |
Trade | Real-time trade ticks |
Pull vs. Subscribe
Subscriptions push incremental updates in real time. For one-off or on-demand queries, use the pull APIs instead:
| Data | Pull API |
|---|---|
| Quotes | Quotes |
| Depth | Depth |
| Broker queue | Broker Queue |
| Trades | Trades |
| Intraday | Intraday |
| Candlesticks | Candlesticks |
Notes
- Subscriptions are scoped to the current connection; they are cleared when the connection drops.
- Use Get Subscriptions to inspect your active subscriptions at any time.
- Quote permissions determine which data types are available. See Quote Permission Levels.

