This documentation covers the WebSocket/PubSub solution designed specifically for Real-Time Data Solution clients.
Real-Time Data Solution deployments use a different authentication flow than our public plans. This enhanced approach provides better security and reliability for business-critical operations.
Real-Time Data Solution uses Azure Active Directory authentication. This robust method protects against unauthorized access and prevents service outages that could affect your critical operations.
Before getting started, ensure you have the following:
Our Real-Time Data Solution offers two data delivery methods to fit your infrastructure needs:
If you choose pub/sub delivery, please note these requirements:
Direct real-time communication with immediate data delivery
Better scalability and reliability for high-volume data processing across multiple consumers
Real-Time Data Solution authentication uses a secure two-step process that ensures your connection is properly authorized.
Follow these steps in order to establish your authenticated connection:
Use the Azure credentials provided by our team to request an OAuth token from Microsoft:
curl -X POST "https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id={client_id}&scope={scope}&client_secret={client_secret}&grant_type=client_credentials"
A successful request returns an access token:
{
"token_type": "Bearer",
"expires_in": 3599,
"ext_expires_in": 3599,
"access_token": "eyJ0eXAiOi...JWT_TOKEN_HERE"
}
Take the access_token
from step 1 and use it to authenticate with our server:
curl -X POST "https://{host_name}/.auth/login/aad" \
-H "Content-Type: application/json" \
-d '{"access_token": "JWT_TOKEN_HERE..."}'
Our server responds with your final authentication token:
{
"authenticationToken": "ANOTHER_JWT_TOKEN_HERE",
"user": {
"userId": "sid:a50f42b1481ca31efcf853fabb13e95b"
}
}
The authenticationToken
expires after one month. Follow these best practices:
Once you have your authentication token, connect to our WebSocket service:
authenticationToken
to your WebSocket headers as X-ZUMO-AUTH
// Example WebSocket connection with authentication
const socket = new WebSocket('wss://{host_name}/ws');
// Set the authentication header before connecting
socket.setRequestHeader('X-ZUMO-AUTH', authenticationToken);
After connecting to the WebSocket server, register your support email for service communications.
// Send email registration after connection is established
socket.onopen = function() {
// Register email for support purposes
socket.send(JSON.stringify({
"email": "your-engineering-team@example.com"
}));
};
Note: This email is for support communications only, not verification. Choose an address your engineering team actively monitors for service updates and issue notifications.
Implement a ping-pong mechanism to maintain stable connections and detect network issues early.
"ping"
message every 15 seconds"pong"
to confirm active connection"pong"
responses in your message handlerBenefits: Regular pings help detect connection drops quickly, especially in environments with unreliable networks or proxy servers that terminate inactive connections.
Real-Time Data Package's WebSocket responses use optimized field names to reduce bandwidth and improve performance.
This section covers the three main data types you'll receive: quotes, series data, and tick data.
Real-time market quotes provide current pricing and volume information.
The table below shows how standard field names are abbreviated:
Standard Field | New Format | Description |
---|---|---|
code | c | Symbol identifier |
status | ss | Session Status |
lp_time | lt | Last price timestamp |
volume | v | Trading volume |
last_price | lp | Last trade price |
ask | a | Ask price |
bid | b | Bid price |
ask_size | as | Size of ask orders |
bid_size | bs | Size of bid orders |
Example Quote Response:
{
"c": "NASDAQ:AAPL",
"ss": "OPEN",
"lt": 1733432340.0,
"v": 533779.0,
"lp": 243.08,
"a": 243.09,
"b": 243.08,
"as": 520.0,
"bs": 430.0
}
Series data provides OHLCV (Open, High, Low, Close, Volume) bar information for different time intervals.
The main response structure uses these abbreviated field names:
Standard Field | New Format | Description |
---|---|---|
code | c | Symbol identifier |
bar_end | be | Bar end timestamp |
last_update | lu | Last update timestamp |
bar_type | bt | Bar interval type |
series | s | Array of OHCLV data |
Each bar within the series array contains these OHLCV fields:
Standard Field | New Format | Description |
---|---|---|
time | t | Bar timestamp |
open | o | Opening price |
high | h | Highest price |
low | l | Lowest price |
close | c | Closing price |
volume | v | Trading volume |
Example Series Response:
{
"c": "NASDAQ:AAPL",
"be": 1733432399.0,
"lu": 1733432399820,
"bt": "1m",
"s": [
{
"t": 1733432340.0,
"o": 242.89,
"h": 243.09,
"l": 242.82,
"c": 243.08,
"v": 533779.0
}
]
}
Tick data represents individual trades with microsecond precision timestamps.
Each tick contains the following trade information:
Standard Field | New Format | Description |
---|---|---|
code | c | Symbol identifier |
timestamp | t | Trade timestamp (microsecond precision) |
price | p | Trade price |
volume | v | Trade volume (shares/contracts) |
Tick timestamps provide microsecond precision for accurate trade timing.
Conversion: Multiply by 1,000,000 for microsecond Unix time.
Trade Data: Each tick represents one individual trade (multiple shares/contracts possible).
Example Tick Data Response:
{
"c": "NASDAQ:AAPL",
"t": 1749462520.177003,
"p": 242.89,
"v": 200.0
}