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: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:
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.Fields from
type down are fundamental and reference data drawn from the symbol snapshot rather than the live order book. They are delivered as strings (except hasOptions, which is a boolean), and field names are case-sensitive — use the exact casing shown (e.g. PE, EPSDiluted).Trade Fields
Trade Fields
Subscribe to these fields using the
tradeFields array. Use ["*"] for all fields.Example:
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
timeAndSalesFields array when timeAndSales: true. Use ["*"] for all fields (default if not specified).Example:
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
level2: true. The response contains market depth across multiple exchanges in a compact format.Order Book Format:
Each entry in
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 (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.Example (all Greeks):
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: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
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".