Skip to Content

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

  1. Establish a connection — Connect to the Longbridge WebSocket endpoint using the SDK or the binary protocol.
  2. Subscribe — Call Subscribe with the securities and data types you want (quotes, depth, trades, brokers).
  3. Receive pushes — The server sends real-time updates to your connection whenever there is a market change.
  4. Unsubscribe — Call Unsubscribe to stop receiving updates for specific symbols or data types.

Subscription Types

TypeDescription
QuoteReal-time bid/ask and last-done price
DepthLevel 2 order book
BrokersBroker queue data
TradeReal-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:

DataPull API
QuotesQuotes
DepthDepth
Broker queueBroker Queue
TradesTrades
IntradayIntraday
CandlesticksCandlesticks

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.