Field-Level Subscriptions Choose specific quote/trade fields or use wildcard * for all fields. Minimize bandwidth by requesting only the data you need.
Real-Time Updates NDJSON message framing for optimal performance with millisecond-level latency.
Initial Snapshot Get the current market state when you subscribe.
Multi-Symbol Support Subscribe to multiple symbols in a single request for efficient batch subscriptions.
Equities & Options Stream real-time data for stocks and option contracts using OSI symbols.
Market Indices Track major indices including SPX, NDX, DJI, VIX, and more in real-time.
Equities Standard stock ticker symbols (e.g., AAPL, MSFT, GOOGL, TSLA). Indices Major market indices are supported: SPX (S&P 500), NDX (Nasdaq 100), DJI (Dow Jones), VIX (Volatility Index), RUT (Russell 2000), COMP (Nasdaq Composite), NYA (NYSE Composite), OEX (S&P 100), MID (S&P MidCap 400), SML (S&P SmallCap 600). Index symbols do not have bid/ask quote data. When subscribing to indices, use trade fields (lastPrice, openPrice, highPrice, lowPrice, etc.).
Options Option contracts use OSI (Options Symbology Initiative) symbols (e.g., AAPL240119C00150000 for AAPL Jan 19 2024 $150 Call). When subscribing to options, set symbolType: "option" in your subscription request.
Quote Data Real-time bid/ask prices from the consolidated order book (NBBO - National Best Bid and Offer).
Trade Data Last sale information, volume, and OHLC (Open-High-Low-Close) prices.
Level 2 / Order Book Data Market depth showing quotes from multiple exchanges. Provides insight into supply and demand at different price levels across all market makers and exchanges.
Time & Sales Data Real-time trade execution feed showing every trade as it happens, including price, size, timestamp, and exchange. Essential for tape reading and order flow analysis.
Greeks Data Option Greeks (delta, gamma, theta, vega, rho) and implied volatility for option contracts. Delivers a last-known snapshot on subscribe, then streams real-time updates. Only available when symbolType: "option" and greeksFields is specified.
Level 2 data does not provide an initial snapshot — you will receive updates as they arrive from the market feed. Greeks data does provide an initial snapshot of the last known values upon subscribing.
For performance optimization, the server may coalesce multiple messages into a single WebSocket frame, separated by newline characters (\n). This is known as Newline-Delimited JSON (NDJSON) . Clients MUST handle this by splitting incoming WebSocket frames on newline characters and parsing each line as a separate JSON message. Example A single WebSocket frame may contain: { "action" : "snapshot" , "type" : "quote" , "symbol" : "MSFT" , ... }
{ "action" : "snapshot" , "type" : "quote" , "symbol" : "AAPL" , ... }
Clients should split on \n and parse each line independently.
WebSocket Client Library that supports WSS protocol for secure WebSocket connections.
Authentication Valid authentication token (if required by your environment).
JSON Parser NDJSON message format handling capability for parsing streaming data.
Network Connectivity Stable network connection to the WebSocket endpoint.
Portfolio Monitoring Live price updates, bid/ask spreads, and intraday performance tracking for your holdings.
Trading Applications Real-time market prices for order entry systems and trade execution platforms.
Market Dashboards Display market trends and index movements (SPX, NDX, VIX) on your analytics dashboard.
Price Alert Systems Trigger notifications on price thresholds, volume spikes, or custom market conditions.
Market Analysis Tools Real-time data feeds for technical analysis and market research applications.
Subscribing to Market Data
Basic Subscription Structure
All subscription requests follow this format:
{
"type" : "subscribe" ,
"id" : "optional-correlation-id" ,
"payload" : [
{
"symbol" : "AAPL" ,
"symbolType" : "equity" , // "equity" or "option"
"quoteFields" : [ "bidPrice" , "askPrice" ],
"tradeFields" : [ "lastPrice" , "volume" ],
"level2" : false ,
"timeAndSales" : false ,
"greeksFields" : [ "delta" , "gamma" ] // options only - requires symbolType: "option"
}
]
}
Subscription Examples
Subscribe to Trade Fields Only Get just price and size data for AAPL: {
"type" : "subscribe" ,
"id" : "sub-1" ,
"payload" : [
{
"symbol" : "AAPL" ,
"tradeFields" : [ "price" , "size" ]
}
]
}
Subscribe to Quotes with Default Fields When you don’t specify quoteFields, you get default quote fields: {
"type" : "subscribe" ,
"id" : "sub-2" ,
"payload" : [
{
"symbol" : "AAPL"
}
]
}
Subscribe to All Fields Using Wildcard Use "*" to subscribe to all available fields: {
"type" : "subscribe" ,
"id" : "sub-4" ,
"payload" : [
{
"symbol" : "GOOGL" ,
"quoteFields" : [ "*" ],
"tradeFields" : [ "*" ]
}
]
}
Subscribe to Specific Quote Fields for Multiple Symbols {
"type" : "subscribe" ,
"id" : "sub-3" ,
"payload" : [
{
"symbol" : "AAPL" ,
"quoteFields" : [ "bidPrice" , "bidSize" , "askPrice" , "askSize" , "midPrice" , "spread" ]
},
{
"symbol" : "MSFT" ,
"quoteFields" : [ "bidPrice" , "bidSize" , "askPrice" , "askSize" , "midPrice" , "spread" ]
}
]
}
Subscribe to Multiple Symbols with Different Fields Different symbols can have different field subscriptions: {
"type" : "subscribe" ,
"id" : "sub-6" ,
"payload" : [
{
"symbol" : "AAPL" ,
"tradeFields" : [ "lastPrice" , "size" , "netChange" , "tick" ]
},
{
"symbol" : "MSFT" ,
"quoteFields" : [ "bidPrice" , "askPrice" , "spread" ]
},
{
"symbol" : "GOOGL" ,
"quoteFields" : [ "*" ],
"tradeFields" : [ "*" ]
}
]
}
Subscribe to Level 2 Order Book Data {
"type" : "subscribe" ,
"id" : "sub-l2-1" ,
"payload" : [
{
"symbol" : "AAPL" ,
"level2" : true
}
]
}
Subscribe to Time & Sales Data {
"type" : "subscribe" ,
"id" : "sub-tns-1" ,
"payload" : [
{
"symbol" : "AAPL" ,
"timeAndSales" : true
}
]
}
Subscribe to Both Level 2 and Time & Sales Perfect for tape reading and order flow analysis: {
"type" : "subscribe" ,
"id" : "sub-l2-tns-1" ,
"payload" : [
{
"symbol" : "AAPL" ,
"level2" : true ,
"timeAndSales" : true
}
]
}
Full Market Data Suite Subscribe to quotes, trades, Level 2, and Time & Sales: {
"type" : "subscribe" ,
"id" : "sub-full-1" ,
"payload" : [
{
"symbol" : "AAPL" ,
"quoteFields" : [ "bidPrice" , "askPrice" , "midPrice" , "spread" ],
"tradeFields" : [ "lastPrice" , "size" , "totalVolume" , "netChange" ],
"level2" : true ,
"timeAndSales" : true
}
]
}
Subscribe to S&P 500 Index Indices do not have bid/ask quote data. Use tradeFields only.
{
"type" : "subscribe" ,
"id" : "sub-7" ,
"payload" : [
{
"symbol" : "SPX" ,
"tradeFields" : [ "lastPrice" , "openPrice" , "highPrice" , "lowPrice" , "netChange" , "totalVolume" ]
}
]
}
Subscribe to Multiple Indices {
"type" : "subscribe" ,
"id" : "sub-8" ,
"payload" : [
{
"symbol" : "SPX" ,
"tradeFields" : [ "lastPrice" , "netChange" ]
},
{
"symbol" : "NDX" ,
"tradeFields" : [ "lastPrice" , "netChange" ]
},
{
"symbol" : "VIX" ,
"tradeFields" : [ "lastPrice" , "netChange" ]
}
]
}
Mixed Equities and Indices {
"type" : "subscribe" ,
"id" : "sub-9" ,
"payload" : [
{
"symbol" : "AAPL" ,
"quoteFields" : [ "bidPrice" , "askPrice" , "midPrice" ],
"tradeFields" : [ "lastPrice" , "netChange" ]
},
{
"symbol" : "SPX" ,
"tradeFields" : [ "lastPrice" , "openPrice" , "highPrice" , "lowPrice" ]
}
]
}
Subscribe to a Single Option Contract Options use OSI (Options Symbology Initiative) symbols. You must set symbolType: "option".
{
"type" : "subscribe" ,
"id" : "sub-10" ,
"payload" : [
{
"symbol" : "AAPL240119C00150000" ,
"symbolType" : "option" ,
"quoteFields" : [ "bidPrice" , "askPrice" , "midPrice" , "spread" , "openInterest" ],
"tradeFields" : [ "lastPrice" , "volume" ]
}
]
}
Subscribe to Multiple Option Contracts {
"type" : "subscribe" ,
"id" : "sub-11" ,
"payload" : [
{
"symbol" : "AAPL240119C00150000" ,
"symbolType" : "option" ,
"quoteFields" : [ "bidPrice" , "askPrice" ],
"tradeFields" : [ "lastPrice" ]
},
{
"symbol" : "AAPL240119C00155000" ,
"symbolType" : "option" ,
"quoteFields" : [ "bidPrice" , "askPrice" ],
"tradeFields" : [ "lastPrice" ]
},
{
"symbol" : "AAPL240119P00145000" ,
"symbolType" : "option" ,
"quoteFields" : [ "bidPrice" , "askPrice" ],
"tradeFields" : [ "lastPrice" ]
}
]
}
Subscribe to All Greeks (Wildcard) Use "*" to receive all Greeks fields for an option contract: {
"type" : "subscribe" ,
"id" : "sub-greeks-1" ,
"payload" : [
{
"symbol" : "XSP281215C00920000" ,
"symbolType" : "option" ,
"greeksFields" : [ "*" ]
}
]
}
Subscribe to Specific Greeks Fields Request only the Greeks you need to minimize bandwidth: {
"type" : "subscribe" ,
"id" : "sub-greeks-2" ,
"payload" : [
{
"symbol" : "AAPL240119C00150000" ,
"symbolType" : "option" ,
"greeksFields" : [ "delta" , "impliedVolatility" ]
}
]
}
Subscribe to Greeks Alongside Quotes Combine Greeks with quote data in a single subscription: {
"type" : "subscribe" ,
"id" : "sub-greeks-3" ,
"payload" : [
{
"symbol" : "AAPL240119C00150000" ,
"symbolType" : "option" ,
"quoteFields" : [ "bidPrice" , "askPrice" , "midPrice" ],
"greeksFields" : [ "delta" , "gamma" , "theta" , "vega" , "impliedVolatility" ]
}
]
}
greeksFields is only applicable when symbolType is "option". Including it for equity symbols has no effect.
Available Fields Reference
All available fields you can subscribe to, organized by data type.
Subscribe to these fields using the quoteFields array. Use ["*"] for all fields. Field Description *Wildcard - Subscribe to all available quote fieldsbidPriceCurrent best bid price - the highest price a buyer is willing to pay bidChangeChange in bid price from the previous quote update bidSizeNumber of shares available at the bid price (typically in round lots of 100) bidSizeChangeChange in bid size from the previous quote update bidTimestampUnix timestamp in milliseconds when the bid was last updated bidExchangeExchange code where the best bid originated (e.g., ‘Q’ for NASDAQ, ‘N’ for NYSE) askPriceCurrent best ask (offer) price - the lowest price a seller is willing to accept askChangeChange in ask price from the previous quote update askSizeNumber of shares available at the ask price (typically in round lots of 100) askSizeChangeChange in ask size from the previous quote update askTimestampUnix timestamp in milliseconds when the ask was last updated askExchangeExchange code where the best ask originated (e.g., ‘Q’ for NASDAQ, ‘N’ for NYSE) quoteTimestampUnix timestamp in milliseconds of the consolidated/top-of-book quote time midPriceMidpoint price calculated as (bidPrice + askPrice) / 2 spreadBid-ask spread calculated as askPrice - bidPrice openInterestTotal outstanding open contracts for the option (options only; include in quoteFields when symbolType is "option")
Example: "quoteFields" : [ "bidPrice" , "askPrice" , "bidSize" , "askSize" , "midPrice" , "spread" ]
Subscribe to these fields using the tradeFields array. Use ["*"] for all fields. Field Description *Wildcard - Subscribe to all available trade fieldspriceLast trade execution price (same as lastPrice in most cases) sizeNumber of shares in the last trade execution totalVolumeCumulative trading volume for the current session (total shares traded) tickVolumeVolume of shares traded in the most recent tick/update openPriceOpening price for the current trading session highPriceHighest price reached during the current trading session lowPriceLowest price reached during the current trading session lastPriceMost recent trade price (last sale price) netChangeNet price change from previous close (lastPrice - previousClosePrice) tickTick direction indicator: ‘up’ (uptick), ‘down’ (downtick), or ‘unchanged’ tradeSeqTrade sequence number - monotonically increasing identifier for each trade tradeTimestampUnix timestamp in milliseconds when the trade was executed closePriceOfficial closing price (may be from current or previous session depending on market hours) previousClosePricePrevious trading session’s official closing price, used to calculate netChange
Example: "tradeFields" : [ "lastPrice" , "size" , "totalVolume" , "netChange" , "tick" ]
For Indices : Use trade fields only. Indices do not have bid/ask quote data.
Subscribe to these fields using the timeAndSalesFields array when timeAndSales: true. Use ["*"] for all fields (default if not specified). Field Description *Wildcard - Subscribe to all available Time & Sales fieldssymbolThe ticker symbol for the trade priceTrade execution price sizeNumber of shares in the trade tickTick direction indicator: ‘up’ (uptick), ‘down’ (downtick), or ‘unchanged’ tradeSeqTrade sequence number - monotonically increasing identifier for each trade tradeExchangeExchange code where the trade was executed (e.g., ‘Q’ for NASDAQ, ‘N’ for NYSE, ‘D’ for FINRA ADF) tradeTimestampUnix timestamp in milliseconds when the trade was executed
Example: {
"symbol" : "AAPL" ,
"timeAndSales" : true ,
"timeAndSalesFields" : [ "price" , "size" , "tick" , "tradeTimestamp" , "tradeExchange" ]
}
Time & Sales shows every individual trade execution in real-time. Essential for tape reading and order flow analysis.
Level 2 data is enabled with level2: true. The response contains market depth across multiple exchanges in a compact format. Field Description symbolThe ticker symbol for the order book orderBookArray of compact order book entries in format "bidSize:bidPrice:askSize" quotesArray of exchange quotes in format "EXCHANGE:askPrice:askSize:bidPrice:bidSize" timestampISO 8601 timestamp of the update
Order Book Format:
Each entry in orderBook follows: "bidSize:bidPrice:askSize"
bidSize: Number of shares at bid (0 if no bid)
bidPrice: Bid price
askSize: Number of shares at ask (0 if no ask)
Quotes Format:
Each entry in quotes follows: "EXCHANGE:askPrice:askSize:bidPrice:bidSize"
EXCHANGE: Exchange code (NSDQ, NYSE, BATS, EDGX, etc.)
askPrice: Ask price at this exchange
askSize: Number of shares at ask
bidPrice: Bid price at this exchange
bidSize: Number of shares at bid
Example Response: Format Guide:
orderBook : askSize:price:bidSize (e.g., "0:250.00:100" = 0 shares ask, $250.00 price, 100 shares bid)
quotes : exchange:askPrice:askSize:bidPrice:bidSize (e.g., "EDGX:272.55:100:272.00:500" = EDGX exchange, 272.55 a s k w i t h 100 s h a r e s , 272.55 ask with 100 shares, 272.55 a s k w i t h 100 s ha res , 272.00 bid with 500 shares)
{
"action" : "update" ,
"type" : "level2nOB" ,
"symbol" : "AAPL" ,
"data" : {
"orderBook" : [
"0:250.00:100" , // Format: askSize:price:bidSize
"0:271.00:100" ,
"0:272.00:1000" ,
"45:272.49:0" ,
"100:272.55:0"
],
"quotes" : [
"EDGX:272.55:100:272.00:500" , // Format: exchange:askPrice:askSize:bidPrice:bidSize
"BATS:272.58:300:271.00:100" ,
"NSDQ:272.49:45:272.40:10"
],
"symbol" : "AAPL" ,
"timestamp" : "2025-12-29T05:18:33.600000-05:00"
},
"timestamp" : 1767003513653
}
No Initial Snapshot : Level 2 data does not provide an initial snapshot. You will receive updates as they arrive from the market feed.
Subscribe to these fields using the greeksFields array. Only available for option contracts (symbolType: "option"). Use ["*"] for all fields. Field Description *Wildcard - Subscribe to all available Greeks fieldsdeltaRate of change of option price per $1 move in the underlying. Ranges 0–1 for calls, -1–0 for puts gammaRate of change of delta per $1 move in the underlying. Measures curvature of option value thetaDaily time decay of the option price. Typically negative vegaRate of change of option price per 1% change in implied volatility rhoRate of change of option price per 1% change in the risk-free interest rate impliedVolatilityMarket-implied volatility as a decimal (e.g., 0.2752 = 27.52%) symbolThe OSI symbol of the option contract timestampISO 8601 timestamp of when the Greeks were last calculated
Example (all Greeks): Example (selective fields): "greeksFields" : [ "delta" , "gamma" , "impliedVolatility" ]
greeksFields is only applicable when symbolType is "option". It has no effect for equity or index symbols.
Unsubscribing from Market Data
The WebSocket supports three unsubscribe modes for flexible subscription management.
Mode 1: Full Unsubscribe
Mode 2: Type-Specific
Mode 3: Field-Level
Remove all subscriptions for one or more symbols: {
"type" : "unsubscribe" ,
"id" : "unsub-1" ,
"payload" : [ "AAPL" , "MSFT" , "GOOGL" ]
}
This removes all quote, trade, Level 2, Time & Sales, and Greeks subscriptions for the specified symbols. Unsubscribe from specific data types while keeping others active: Unsubscribe from Quotes Only {
"type" : "unsubscribe" ,
"id" : "unsub-2" ,
"payload" : [
{
"symbol" : "AAPL" ,
"quote" : true ,
"trade" : false
}
]
}
Unsubscribe from Trades Only {
"type" : "unsubscribe" ,
"id" : "unsub-3" ,
"payload" : [
{
"symbol" : "TSLA" ,
"trade" : true
}
]
}
Unsubscribe from Level 2 Only {
"type" : "unsubscribe" ,
"id" : "unsub-l2-1" ,
"payload" : [
{
"symbol" : "AAPL" ,
"level2" : true
}
]
}
Unsubscribe from Time & Sales Only {
"type" : "unsubscribe" ,
"id" : "unsub-tns-1" ,
"payload" : [
{
"symbol" : "AAPL" ,
"timeAndSales" : true
}
]
}
Unsubscribe from Level 2 and Time & Sales {
"type" : "unsubscribe" ,
"id" : "unsub-l2-tns-1" ,
"payload" : [
{
"symbol" : "AAPL" ,
"level2" : true ,
"timeAndSales" : true
}
]
}
Unsubscribe from All Greeks {
"type" : "unsubscribe" ,
"id" : "unsub-greeks-1" ,
"payload" : [
{
"symbol" : "XSP281215C00920000" ,
"greeks" : true
}
]
}
Available type flags:
quote: boolean - Unsubscribe from all quote data
trade: boolean - Unsubscribe from all trade data
level2: boolean - Unsubscribe from Level 2 data
timeAndSales: boolean - Unsubscribe from Time & Sales data
greeks: boolean - Unsubscribe from all Greeks data (options only)
Remove specific fields while keeping the subscription active: Unsubscribe from Specific Quote Fields {
"type" : "unsubscribe" ,
"id" : "unsub-4" ,
"payload" : [
{
"symbol" : "GOOGL" ,
"quoteFields" : [ "bidChange" , "askChange" , "bidSizeChange" , "askSizeChange" ]
}
]
}
Unsubscribe from Specific Trade Fields {
"type" : "unsubscribe" ,
"id" : "unsub-5" ,
"payload" : [
{
"symbol" : "AAPL" ,
"tradeFields" : [ "tickVolume" , "tick" , "tradeSeq" ]
}
]
}
Unsubscribe from Mixed Fields {
"type" : "unsubscribe" ,
"id" : "unsub-6" ,
"payload" : [
{
"symbol" : "MSFT" ,
"quoteFields" : [ "bidTimestamp" , "askTimestamp" ],
"tradeFields" : [ "tradeTimestamp" , "closePrice" ]
}
]
}
Unsubscribe from Specific Greeks Fields {
"type" : "unsubscribe" ,
"id" : "unsub-greeks-2" ,
"payload" : [
{
"symbol" : "AAPL240119C00150000" ,
"greeksFields" : [ "rho" , "vega" ]
}
]
}
If all fields are removed, the subscription is automatically terminated.
Unsubscribe Response
When you unsubscribe, the server confirms the action:
{
"action" : "unsubscribe" ,
"type" : "quote" ,
"symbol" : "AAPL" ,
"id" : "unsub-1" ,
"timestamp" : 1701450000123
}
Snapshot Responses
When you subscribe, you immediately receive a snapshot of current market data. The snapshot contains all requested fields.
{
"action" : "snapshot" ,
"type" : "quote" ,
"symbol" : "AAPL" ,
"symbolType" : "equity" ,
"data" : {
"bidPrice" : 150.25 ,
"bidSize" : 500 ,
"bidChange" : 0.05 ,
"bidSizeChange" : 100 ,
"bidTimestamp" : 1701450000120 ,
"bidExchange" : "Q" ,
"askPrice" : 150.26 ,
"askSize" : 300 ,
"askChange" : 0.03 ,
"askSizeChange" : -50 ,
"askTimestamp" : 1701450000121 ,
"askExchange" : "N" ,
"quoteTimestamp" : 1701450000121 ,
"midPrice" : 150.255 ,
"spread" : 0.01
},
"id" : "sub-1" ,
"timestamp" : 1701450000123
}
{
"action" : "snapshot" ,
"type" : "trade" ,
"symbol" : "AAPL" ,
"symbolType" : "equity" ,
"data" : {
"price" : 150.25 ,
"lastPrice" : 150.25 ,
"size" : 100 ,
"totalVolume" : 45678900 ,
"tickVolume" : 100 ,
"openPrice" : 149.50 ,
"highPrice" : 151.00 ,
"lowPrice" : 149.25 ,
"closePrice" : 149.80 ,
"previousClosePrice" : 149.80 ,
"netChange" : 0.45 ,
"tick" : "up" ,
"tradeSeq" : 123456 ,
"tradeTimestamp" : 1701450000123
},
"id" : "sub-1" ,
"timestamp" : 1701450000125
}
Level 2 does not send an initial snapshot. You receive updates as they arrive.
Format Guide:
orderBook : askSize:price:bidSize
quotes : exchange:askPrice:askSize:bidPrice:bidSize
{
"action" : "update" ,
"type" : "level2nOB" ,
"symbol" : "AAPL" ,
"data" : {
"orderBook" : [
// Format: askSize:price:bidSize
"0:150.24:200" ,
"0:150.24:300" ,
"500:150.26:0" ,
"300:150.26:0" ,
"400:150.27:0"
],
"quotes" : [
// Format: exchange:askPrice:askSize:bidPrice:bidSize
"NSDQ:150.26:500:150.25:400" ,
"NYSE:150.27:200:150.24:200" ,
"PACF:150.26:300:150.24:300"
],
"symbol" : "AAPL" ,
"timestamp" : "2025-12-29T05:18:33.123000-05:00"
},
"timestamp" : 1701450000123
}
Time & Sales Update Example
{
"action" : "update" ,
"type" : "timeAndSales" ,
"symbol" : "AAPL" ,
"data" : {
"symbol" : "AAPL" ,
"price" : 150.26 ,
"size" : 250 ,
"tick" : "up" ,
"tradeSeq" : 123457 ,
"tradeExchange" : "Q" ,
"tradeTimestamp" : 1701450000456
},
"timestamp" : 1701450000458
}
Each Time & Sales message represents a single trade execution . You may receive multiple messages per second during active trading.
{
"action" : "snapshot" ,
"type" : "quote" ,
"symbol" : "AAPL240119C00150000" ,
"symbolType" : "option" ,
"data" : {
"bidPrice" : 5.25 ,
"askPrice" : 5.30 ,
"bidSize" : 50 ,
"askSize" : 75 ,
"midPrice" : 5.275 ,
"spread" : 0.05 ,
"openInterest" : 12450
},
"id" : "sub-opt-1" ,
"timestamp" : 1701450000123
}
Greeks Snapshot & Update Example
Upon subscribing with greeksFields, the server immediately sends a snapshot of the last known Greeks values. Subsequent updates are streamed whenever Greeks are recalculated. 1. Initial snapshot (received immediately on subscribe):{
"type" : "event" ,
"payload" : {
"action" : "snapshot" ,
"type" : "greeks" ,
"symbol" : "XSP281215C00920000" ,
"data" : {
"delta" : 0.522 ,
"gamma" : 0.0386 ,
"impliedVolatility" : 0.2752 ,
"symbol" : "XSP281215C00920000" ,
"theta" : -0.0246 ,
"rho" : 0.004 ,
"timestamp" : "2026-02-13T15:07:16.65+05:30" ,
"vega" : 0.1606
},
"timestamp" : 1770975436651
}
}
2. Real-time update (streamed when Greeks change):{
"type" : "event" ,
"payload" : {
"action" : "update" ,
"type" : "greeks" ,
"symbol" : "XSP281215C00920000" ,
"data" : {
"delta" : 0.531 ,
"gamma" : 0.0391 ,
"impliedVolatility" : 0.2788 ,
"symbol" : "XSP281215C00920000" ,
"theta" : -0.0249 ,
"rho" : 0.004 ,
"timestamp" : "2026-02-13T15:08:22.10+05:30" ,
"vega" : 0.1618
},
"timestamp" : 1770975502651
}
}
Selective fields (using greeksFields: ["delta", "impliedVolatility"]):{
"type" : "event" ,
"payload" : {
"action" : "snapshot" ,
"type" : "greeks" ,
"symbol" : "AAPL240119C00150000" ,
"data" : {
"delta" : 0.638 ,
"impliedVolatility" : 0.3105
},
"timestamp" : 1701450000890
}
}
Use action: "snapshot" vs action: "update" to distinguish the initial state from real-time changes. Only the fields you subscribed to are included in each message.
Update Responses
After the snapshot, you receive real-time updates with only changed fields :
{
"action" : "update" ,
"type" : "quote" ,
"symbol" : "AAPL" ,
"data" : {
"bidPrice" : 150.26 , // Only changed fields
"bidSize" : 600 ,
"bidChange" : 0.01 ,
"bidSizeChange" : 100 ,
"bidTimestamp" : 1701450001450
},
"timestamp" : 1701450001456
}
Bandwidth Optimization : Updates contain only fields that changed since the last message, minimizing network usage.
{
"action" : "update" ,
"type" : "trade" ,
"symbol" : "AAPL" ,
"data" : {
"lastPrice" : 150.27 ,
"price" : 150.27 ,
"size" : 200 ,
"totalVolume" : 45679100 ,
"tickVolume" : 200 ,
"netChange" : 0.47 ,
"tick" : "up" ,
"tradeSeq" : 123458 ,
"tradeTimestamp" : 1701450001500
},
"timestamp" : 1701450001502
}
Response Structure
All server messages follow this structure:
Field Type Description actionstring Message action: snapshot, update, unsubscribe, pong, or error typestring Data type: quote, trade, level2, timeAndSales, or greeks symbolstring The ticker symbol symbolTypestring Symbol type: equity or option dataobject The market data payload idstring Correlation ID (if provided in request) timestampnumber Unix timestamp in milliseconds
Error Handling
{
"action" : "error" ,
"error" : {
"code" : "INVALID_SYMBOL" ,
"message" : "Symbol 'INVALID' not found or not supported" ,
"details" : {
"symbol" : "INVALID" ,
"symbolType" : "equity"
}
},
"id" : "sub-1" ,
"timestamp" : 1701450000123
}
Common Error Codes
Code Description Resolution INVALID_SYMBOLSymbol not found or not supported Verify the symbol ticker is correct INVALID_FIELDRequested field name is invalid Check field name against available fields INVALID_SYMBOL_TYPESymbol type must be ‘equity’ or ‘option’ Use correct symbolType value SUBSCRIPTION_NOT_FOUNDAttempting to unsubscribe from non-existent subscription Verify you subscribed to this symbol first RATE_LIMIT_EXCEEDEDToo many requests in a short time period Implement exponential backoff AUTHENTICATION_REQUIREDValid authentication token required Include auth token in connection headers INTERNAL_ERRORServer encountered an unexpected error Retry the request after a delay
Always implement error handling in your WebSocket client to handle network issues, invalid requests, and server errors gracefully.
Connection Management
Ping/Pong Keepalive
Send periodic pings to keep the WebSocket connection alive and detect network issues:
Client sends:
{
"type" : "ping" ,
"id" : "ping-001"
}
Server responds:
{
"action" : "pong" ,
"id" : "ping-001" ,
"timestamp" : 1701450000123
}
Recommended : Send a ping every 30-60 seconds to maintain the connection and detect disconnects quickly.
Handling Disconnects
const ws = new WebSocket ( 'wss://api.aries.com/v1/market/ws' );
ws . onclose = ( event ) => {
console . log ( 'WebSocket closed:' , event . code , event . reason );
// Implement reconnection logic with exponential backoff
setTimeout (() => {
reconnect ();
}, getBackoffDelay ());
};
ws . onerror = ( error ) => {
console . error ( 'WebSocket error:' , error );
};
Implement exponential backoff for reconnections: start with 1 second, then 2s, 4s, 8s, up to a maximum of 60 seconds.
Request/Response Pattern
Besides streaming subscriptions, the WebSocket supports on-demand queries using a RESTful-style request/response pattern.
Get Option Expiry Dates
Query all available expiration dates for an underlying symbol:
Request:
{
"type" : "request" ,
"id" : "req-expiry-1" ,
"payload" : {
"method" : "GET" ,
"path" : "/options/AAPL/expiry-dates"
}
}
Response:
{
"type" : "response" ,
"id" : "req-expiry-1" ,
"payload" : {
"status" : 200 ,
"data" : {
"symbol" : "AAPL" ,
"expiryDates" : [
"2024-01-19" ,
"2024-02-16" ,
"2024-03-15" ,
"2024-04-19"
]
}
},
"timestamp" : 1701450000123
}
Get Option Contract Symbols
Query all call and put contracts for a symbol and expiration date:
Request:
{
"type" : "request" ,
"id" : "req-003" ,
"payload" : {
"method" : "GET" ,
"path" : "/options/AAPL/contracts/2024-01-19"
}
}
Response:
{
"type" : "response" ,
"id" : "req-003" ,
"payload" : {
"status" : 200 ,
"data" : {
"symbol" : "AAPL" ,
"expiryDate" : "2024-01-19" ,
"calls" : [
{
"symbol" : "AAPL240119C00145000" ,
"strike" : 145.00
},
{
"symbol" : "AAPL240119C00150000" ,
"strike" : 150.00
}
],
"puts" : [
{
"symbol" : "AAPL240119P00145000" ,
"strike" : 145.00
},
{
"symbol" : "AAPL240119P00150000" ,
"strike" : 150.00
}
]
}
},
"timestamp" : 1701450000123
}
Response Status Codes
Status Meaning 200Success 400Bad Request - Invalid parameters 404Not Found - Symbol or resource not found 500Internal Server Error