Messages
WebSockets
Market Data WebSocket
Real-time streaming API for equity quotes, trades, and market indices. Subscribe to specific symbols with field-level granularity to receive only the data you need, minimizing bandwidth and latency.
WSS
What this stream gives you. Open one connection to
wss://api.aries.com/v1/market/ws, authenticate once, and the server will push live prices, trades, and order-book activity for any symbols you ask about. You can stream the same data a professional trader watches on screen — bid/ask quotes, last sale prices, intraday OHLC, every individual trade as it prints, full depth-of-market, and option Greeks — without polling.Key Features
Key Features
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.
Supported Symbols
Supported Symbols
Equities
Standard stock ticker symbols. Pass them just as you’d type them on a brokerage screen — for exampleAAPL, MSFT, GOOGL, TSLA. No special formatting required.Indices
Major market indices are supported:| Symbol | Index |
|---|---|
SPX | S&P 500 — broad large-cap U.S. stocks |
NDX | Nasdaq 100 — 100 largest non-financial Nasdaq stocks |
DJI | Dow Jones Industrial Average — 30 blue-chip U.S. stocks |
VIX | CBOE Volatility Index — market “fear gauge” |
RUT | Russell 2000 — small-cap U.S. stocks |
COMP | Nasdaq Composite — all Nasdaq-listed stocks |
NYA | NYSE Composite — all NYSE-listed stocks |
OEX | S&P 100 — 100 largest S&P 500 companies |
MID | S&P MidCap 400 — mid-sized U.S. stocks |
SML | S&P SmallCap 600 — small-cap U.S. stocks |
Indices are computed values, not securities you can buy and sell directly, so they don’t have bid/ask quotes. When subscribing to an index, only request trade fields (
lastPrice, openPrice, highPrice, lowPrice, netChange, totalVolume, etc.). Quote fields like bidPrice/askPrice will be empty.Options
Option contracts use OSI (Options Symbology Initiative) symbols — the 21-character standard the U.S. options industry uses to uniquely identify a contract.The format isROOT + YYMMDD + C/P + 00000000 (the strike price in cents, left-padded). For example, AAPL240119C00150000 decodes as:AAPL— underlying stock240119— expiration date, 2024-01-19C— call (usePfor a put)00150000— strike price, $150.00 (00150000 ÷ 1000)
symbolType: "option" so the server knows to apply option-specific routing and to enable Greeks if requested.Data Types
Data Types
Quote Data
The best price a buyer is currently willing to pay (bid) and the best price a seller is currently willing to accept (ask), pulled from all U.S. exchanges combined — known as the NBBO (National Best Bid and Offer).
Trade Data
The price and size of the most recent trade, plus session-level totals: OHLC = Open, High, Low, Close — the standard four prices used to draw a candle on a chart.
Level 2 / Order Book Data
Market depth — every visible bid and ask across the major exchanges, not just the single best price. Lets you see how much demand is sitting at each price level and which exchanges are quoting it.
Time & Sales Data
Every individual trade as it prints, with price, size, timestamp, and the exchange where it executed. Often called “the tape” — traders use it to read order flow and gauge buying vs. selling pressure.
Greeks Data
For option contracts: the standard risk measures (delta, gamma, theta, vega, rho) plus implied volatility. The first message is a snapshot of the last known values; after that you receive updates whenever the Greeks are recalculated. Only available when
symbolType: "option" and greeksFields is specified.Market Status
Whether the U.S. market is currently
open, closed, in pre-market, or in after-hours trading, plus the status of individual exchanges.What you receive first: Quote, trade, and Greeks subscriptions all send an initial snapshot of the current state, then stream updates as values change. Level 2 is the exception — it does not send a snapshot, only live updates as new depth arrives from the exchanges.
Level 2: compact order book rows
Level 2: compact order book rows
Level 2 updates are forwarded from the market feed as compact string arrays.
payload.data.orderBook entries use askSize:price:bidSize, and payload.data.quotes entries use exchange:askPrice:askSize:bidPrice:bidSize.Example:Message Framing (NDJSON)
Message Framing (NDJSON)
To keep latency low when the market is active, the server may bundle several updates into a single WebSocket frame and separate them with a newline character (Clients should split on
\n). This format is called NDJSON — Newline-Delimited JSON.What this means for you: Don’t just call JSON.parse(frame) on every incoming message. Instead, split the frame on \n, drop empty lines, and parse each line independently. Otherwise you will silently lose messages whenever the server coalesces.Example
A single WebSocket frame may contain:\n and parse each line independently.Requirements
Requirements
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.
Use Cases
Use Cases
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.
Authentication
If authentication is enabled, authenticate after opening the WebSocket and before subscribing. Auth uses the request/response envelope withPOST /auth; the body is only the token object expected by the backend.
Client sends:
Subscribing to Market Data
Basic Subscription Structure
To start receiving data for a symbol, send a subscribe message. Thepayload is always an array, even when you only want one symbol — each item describes one symbol and the specific fields you want to receive for it.
Subscription object fields:
| Field | Type | Required | What to enter |
|---|---|---|---|
symbol | string | Yes | A stock ticker (e.g. AAPL), an index code (e.g. SPX), or an OSI option symbol (e.g. AAPL240119C00150000). |
symbolType | string | No | equity (default) for stocks and indices, or option for option contracts. Must be option if you want Greeks. |
quoteFields | string | array | No | Quote fields to subscribe to (see Quote Fields table below). Use ["*"] for all. |
tradeFields | string | array | No | Trade fields to subscribe to (see Trade Fields table below). Use ["*"] for all. |
level2 | boolean | No | true to receive full order-book depth for this symbol. Defaults to false. |
timeAndSales | boolean | No | true to receive a message for every individual trade execution. Defaults to false. |
timeAndSalesFields | string | array | No | Specific T&S fields to receive when timeAndSales: true. Defaults to all fields. |
greeksFields | string | array | No | Greek fields to subscribe to (options only). Use ["*"] for all. |
Defaults & shortcuts.
symbolTypedefaults to"equity". Set it to"option"only when you’re subscribing to an option contract.- If you omit both
quoteFieldsandtradeFields, the server treats it as “send me everything” and subscribes you to all quote and all trade fields for that symbol. - Any field list (
quoteFields,tradeFields,timeAndSalesFields,greeksFields) accepts either a single string ("bidPrice") or an array (["bidPrice", "askPrice"]). Arrays are recommended for consistency.
Subscription Examples
Basic Examples
Basic Examples
Subscribe to Trade Fields Only
Get just price and size data for AAPL:Subscribe to All Quote and Trade Fields
When bothquoteFields and tradeFields are omitted, the backend subscribes to all quote and all trade fields:Subscribe to Quote Fields Only
Include onlyquoteFields when you do not want a trade subscription:Subscribe to All Fields Using Wildcard
Use"*" to subscribe to all available fields:Multiple Symbols
Multiple Symbols
Level 2 & Time & Sales
Level 2 & Time & Sales
Option Contracts
Option Contracts
Subscribe to a Single Option Contract
Options use OSI (Options Symbology Initiative) symbols. You must set
symbolType: "option".Subscribe to Multiple Option Contracts
Subscribe to All Greeks (Wildcard)
Use"*" to receive all Greeks fields for an option contract:Subscribe to Specific Greeks Fields
Request only the Greeks you need to minimize bandwidth:Subscribe to Greeks Alongside Quotes
Combine Greeks with quote data in a single subscription:greeksFields is only applicable when symbolType is "option". Including it for equity symbols has no effect.Available Fields Reference
Frequently used fields you can subscribe to, organized by data type. The wildcard["*"] expands to every backend-supported field for that category.
Quote Fields
Quote Fields
Subscribe to these fields using the
Example:
quoteFields array. Use ["*"] for all fields.| Field | Description |
|---|---|
* | Wildcard - Subscribe to all available quote fields |
bidPrice | Current best bid price - the highest price a buyer is willing to pay |
bidChange | Change in bid price from the previous quote update |
bidSize | Number of shares available at the bid price (typically in round lots of 100) |
bidSizeChange | Change in bid size from the previous quote update |
bidTimestamp | Unix timestamp in milliseconds when the bid was last updated |
bidExchange | Exchange code where the best bid originated (e.g., ‘Q’ for NASDAQ, ‘N’ for NYSE) |
askPrice | Current best ask (offer) price - the lowest price a seller is willing to accept |
askChange | Change in ask price from the previous quote update |
askSize | Number of shares available at the ask price (typically in round lots of 100) |
askSizeChange | Change in ask size from the previous quote update |
askTimestamp | Unix timestamp in milliseconds when the ask was last updated |
askExchange | Exchange code where the best ask originated (e.g., ‘Q’ for NASDAQ, ‘N’ for NYSE) |
quoteTimestamp | Unix timestamp in milliseconds of the consolidated/top-of-book quote time |
midPrice | Midpoint price calculated as (bidPrice + askPrice) / 2 |
spread | Bid-ask spread calculated as askPrice - bidPrice |
openInterest | Total outstanding open contracts for the option (options only; include in quoteFields when symbolType is "option") |
Trade Fields
Trade Fields
Subscribe to these fields using the
Example:
tradeFields array. Use ["*"] for all fields.| Field | Description |
|---|---|
* | Wildcard - Subscribe to all available trade fields |
price | Last trade execution price (same as lastPrice in most cases) |
size | Number of shares in the last trade execution |
totalVolume | Cumulative trading volume for the current session (total shares traded) |
tickVolume | Volume of shares traded in the most recent tick/update |
openPrice | Opening price for the current trading session |
highPrice | Highest price reached during the current trading session |
lowPrice | Lowest price reached during the current trading session |
lastPrice | Most recent trade price (last sale price) |
netChange | Net price change from previous close (lastPrice - previousClosePrice) |
tick | Tick direction indicator: ‘up’ (uptick), ‘down’ (downtick), or ‘unchanged’ |
tradeSeq | Trade sequence number - monotonically increasing identifier for each trade |
tradeTimestamp | ISO 8601 timestamp of when the trade was executed |
closePrice | Official closing price (may be from current or previous session depending on market hours) |
previousClosePrice | Previous trading session’s official closing price, used to calculate netChange |
For Indices: Use trade fields only. Indices do not have bid/ask quote data.
Time & Sales Fields
Time & Sales Fields
Subscribe to these fields using the
Example:
timeAndSalesFields array when timeAndSales: true. Use ["*"] for all fields (default if not specified).| Field | Description |
|---|---|
* | Wildcard - Subscribe to all available Time & Sales fields |
symbol | The ticker symbol for the trade |
price | Trade execution price |
size | Number of shares in the trade |
tick | Tick direction indicator: ‘up’ (uptick), ‘down’ (downtick), or ‘unchanged’ |
tradeSeq | Trade sequence number - monotonically increasing identifier for each trade |
tradeExchange | Exchange code where the trade was executed (e.g., ‘Q’ for NASDAQ, ‘N’ for NYSE, ‘D’ for FINRA ADF) |
tradeTimestamp | ISO 8601 timestamp of when the trade was executed |
Time & Sales shows every individual trade execution in real-time. Essential for tape reading and order flow analysis.
Level 2 Fields
Level 2 Fields
Level 2 data is enabled with
Order Book Format:
Each entry in
level2: true. The response contains market depth across multiple exchanges in a compact format.| Field | Description |
|---|---|
symbol | The ticker symbol for the order book |
orderBook | Array of compact order book entries in format "askSize:price:bidSize" |
quotes | Array of exchange quotes in format "EXCHANGE:askPrice:askSize:bidPrice:bidSize" |
timestamp | ISO 8601 timestamp of the update |
orderBook follows: "askSize:price:bidSize"askSize: Number of shares at ask (0 if no ask)price: Price levelbidSize: Number of shares at bid (0 if no bid)
quotes follows: "EXCHANGE:askPrice:askSize:bidPrice:bidSize"EXCHANGE: Exchange code (NSDQ, NYSE, BATS, EDGX, etc.)askPrice: Ask price at this exchangeaskSize: Number of shares at askbidPrice: Bid price at this exchangebidSize: Number of shares at bid
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.00 bid with 500 shares)
Greeks Fields
Greeks Fields
Subscribe to these fields using the
Example (all Greeks):Example (selective fields):
greeksFields array. Only available for option contracts (symbolType: "option"). Use ["*"] for all fields.What are Greeks? Greeks are standard risk measures that tell you how an option’s price is likely to move when something changes — the underlying stock price, time, or volatility. They are the building blocks of options risk management.| Field | Description |
|---|---|
* | Wildcard — subscribe to all available Greeks fields |
delta | How much the option’s price moves for a **0.50 if the stock rises $1. Also a rough estimate of the probability the option expires in-the-money. |
gamma | How much delta itself changes per $1 move in the underlying. High gamma = delta swings quickly, so position risk changes fast. |
theta | How much value the option loses per day purely from time passing (the “time decay”). Almost always negative for long option holders. |
vega | How much the option’s price changes for a 1-percentage-point change in implied volatility. Long options have positive vega — they gain when volatility rises. |
rho | How much the option’s price changes for a 1-percentage-point change in interest rates. Usually small for short-dated options. |
impliedVolatility | The market’s expectation of how volatile the underlying will be over the option’s life, expressed as a decimal: 0.2752 means 27.52% annualized. Higher IV = more expensive options. |
symbol | The OSI symbol of the option contract |
timestamp | ISO 8601 timestamp of when the Greeks were last calculated |
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:This removes all quote, trade, Level 2, Time & Sales, and Greeks subscriptions for the specified symbols.
Unsubscribe Response
When you unsubscribe, the server confirms the action:Message Formats & Responses
Snapshot Responses
When you subscribe, you immediately receive a snapshot of current market data. The snapshot contains all requested fields.Quote Snapshot Example
Quote Snapshot Example
Trade Snapshot Example
Trade Snapshot Example
Level 2 Update Example
Level 2 Update Example
Format Guide:
- orderBook:
askSize:price:bidSize - quotes:
exchange:askPrice:askSize:bidPrice:bidSize
Time & Sales Update Example
Time & Sales Update Example
Each Time & Sales message represents a single trade execution. You may receive multiple messages per second during active trading.
Option Contract Snapshot
Option Contract Snapshot
Greeks Snapshot & Update Example
Greeks Snapshot & Update Example
Upon subscribing with 2. Real-time update (streamed when Greeks change):Selective fields (using
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):greeksFields: ["delta", "impliedVolatility"]):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:Quote Update
Quote Update
Bandwidth Optimization: Updates contain only fields that changed since the last message, minimizing network usage.
Trade Update
Trade Update
Market Status Updates
After successful authentication and whenever market status changes, the server can send a market status event:Streaming event structure
Streaming market data events use the following envelope:| Field | Type | Description |
|---|---|---|
type | string | Outer envelope type. Streaming market data events always use event. |
payload.action | string | What kind of event this is. One of: snapshot (the first message you receive after subscribing — current state), update (a real-time change), error (something went wrong), unsubscribe (the server confirming you’ve been removed from a feed). |
payload.type | string | Which data category the event belongs to. One of: quote (best bid/ask), trade (last sale info), level2nOB (order book depth), timeAndSales (every individual trade), greeks (option risk measures), marketStatus (market session state). |
payload.symbol | string | The ticker or option symbol the event is about. Omitted for market-wide events such as marketStatus. |
payload.data | object | The actual data payload. Note that update messages only include fields that changed since the last message — fields not in the update have not changed. |
payload.id | string | Correlation ID. When the event was triggered by one of your subscribe requests, the server echoes back the id you sent. |
payload.timestamp | integer | When the event happened, in Unix milliseconds (epoch). |
Quick guide to outer
type values:event— Streaming pushes from the server: market data, auth/refresh notifications, unsubscribe confirmations, subscription errors.pong— Reply to apingyou sent. Used only for keep-alive.response— Reply to an on-demandrequestyou sent (e.g. fetching option expiry dates).
Error Handling
Error Response Format
Common Error Messages
| Message | Description | Resolution |
|---|---|---|
authentication required | The connection must authenticate before this action | Send a POST /auth request message with a valid token |
invalid subscribe format | Subscribe payload could not be parsed as an array of symbol requests | Send payload as an array of objects |
invalid unsubscribe format | Unsubscribe payload could not be parsed as an array of strings or objects | Send payload as ["AAPL"] or [{ "symbol": "AAPL", "quote": true }] |
no symbols provided | The request did not include any symbols | Include at least one symbol |
too many symbols in request | Request exceeded the backend symbol limit | Split symbols across multiple requests |
invalid quote fields: ... | One or more quote field names are not supported | Check field names against the quote field list |
invalid trade fields: ... | One or more trade field names are not supported | Check field names against the trade field list |
invalid greeks fields: ... | One or more Greeks field names are not supported | Use only delta, gamma, theta, vega, rho, or impliedVolatility |
Connection Management
Ping/Pong Keepalive
Send periodic pings to keep the WebSocket connection alive and detect network issues: Client sends:Recommended: Send a ping every 30-60 seconds to maintain the connection and detect disconnects quickly.
Handling Disconnects
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:Get Option Contract Symbols
Query all call and put contracts for a symbol and expiration date: Request:Request Responses
Successful request replies are returned astype: "response" with payload.status and payload.data.
Request/response errors use type: "response" with payload.status and payload.error. Streaming subscription errors use type: "event" with payload.action: "error".Messages