Market Data WebSocket API
Connect to the real-time market data WebSocket for live quotes, time & sales, level 2 order book data, and market status updates.
Connection URL
wss://api.aries.com/v1/market/ws
All messages use the standard envelope format:
{
"type": "<message-type>",
"id": "<optional-correlation-id>",
"payload": <type-specific-payload>
}
Authentication
After connecting, authenticate before subscribing to any data. Send a request message to the /auth route. The token must be a direct property of body (body.token). Do not nest it under body.data — the server only reads body.token and will return “token is required” if token is missing at that level.
Request:
{
"type": "request",
"id": "auth-001",
"payload": {
"method": "post",
"path": "/auth",
"body": {
"action": "auth",
"token": "YOUR_ACCESS_TOKEN"
}
}
}
Success Response:
{
"type": "event",
"payload": {
"action": "authSuccess",
"id": "auth-001",
"data": {
"expiresIn": 2700000
},
"timestamp": 1701450000123
}
}
Error Response:
{
"type": "event",
"payload": {
"action": "error",
"error": "authentication failed",
"id": "auth-001",
"timestamp": 1701450000123
}
}
After successful authentication, the server automatically sends the current market status without any additional request.
Market Status
Sent automatically after successful authentication. Subsequent updates are pushed whenever status changes.
Server Push:
{
"type": "event",
"payload": {
"action": "update",
"type": "marketStatus",
"data": {
"afterHours": false,
"currencies": { "crypto": "open", "fx": "open" },
"earlyHours": false,
"exchanges": { "nasdaq": "closed", "nyse": "closed", "otc": "closed" },
"indicesGroups": {
"dow_jones": "closed",
"nasdaq": "open",
"s_and_p": "open"
},
"market": "closed",
"serverTime": "2025-07-17T03:33:11.000Z"
},
"timestamp": 1701450000123
}
}
Subscriptions
Subscribe using type: "subscribe". The payload is an array of symbol requests.
Subscribe to Equity Quotes:
{
"type": "subscribe",
"id": "sub-1",
"payload": [
{
"symbol": "AAPL",
"quoteFields": ["askPrice", "bidPrice", "askSize", "bidSize"]
},
{
"symbol": "GOOGL",
"quoteFields": ["*"]
}
]
}
Subscribe to Equity Trades:
{
"type": "subscribe",
"id": "sub-2",
"payload": [
{
"symbol": "AAPL",
"tradeFields": ["lastPrice", "size", "totalVolume", "netChange"]
}
]
}
Subscribe to Option Quotes:
{
"type": "subscribe",
"id": "sub-3",
"payload": [
{
"symbol": "SPXW250606P04200000",
"symbolType": "option",
"quoteFields": ["askPrice", "bidPrice", "askSize", "bidSize"]
}
]
}
Subscribe to Time & Sales:
{
"type": "subscribe",
"id": "sub-4",
"payload": [
{
"symbol": "AAPL",
"timeAndSales": true
}
]
}
Subscribe to Level 2 / Order Book:
{
"type": "subscribe",
"id": "sub-5",
"payload": [
{
"symbol": "AAPL",
"level2": true
}
]
}
Snapshot Response
On subscribe, the server immediately sends a snapshot of current data:
{
"type": "event",
"payload": {
"action": "snapshot",
"type": "quote",
"symbol": "AAPL",
"data": {
"bidPrice": 150.25,
"askPrice": 150.26,
"askSize": 300,
"bidSize": 500
},
"id": "sub-1",
"timestamp": 1701450000123
}
}
Real-Time Update
After the snapshot, updates stream with only changed fields:
{
"type": "event",
"payload": {
"action": "update",
"type": "quote",
"symbol": "AAPL",
"data": {
"bidPrice": 150.26,
"bidSize": 600
},
"timestamp": 1701450001456
}
}
Time & Sales Update
{
"type": "event",
"payload": {
"action": "update",
"type": "timeAndSales",
"symbol": "AAPL",
"data": {
"price": 212.40,
"size": 11,
"tick": "down",
"tradeExchange": "BATS",
"tradeSeq": 1436256,
"tradeTimestamp": 1751882611326
},
"timestamp": 1751882611330
}
}
Level 2 Update
{
"type": "event",
"payload": {
"action": "update",
"type": "level2nOB",
"symbol": "AAPL",
"data": {
"symbol": "AAPL",
"quotes": ["NSDQ:123.12:10:234.32:15", "BATS:123.12:10:234.32:15"],
"orderBook": ["12:123.12:25", "15:123.15:30"],
"timestamp": "2025-07-07T07:03:31.326-04:00"
},
"timestamp": 1751882611330
}
}
Unsubscriptions
Unsubscribe from all data for symbols:
{
"type": "unsubscribe",
"id": "unsub-1",
"payload": ["AAPL", "MSFT"]
}
Unsubscribe from specific data types:
{
"type": "unsubscribe",
"id": "unsub-2",
"payload": [
{
"symbol": "AAPL",
"quote": true
}
]
}
Unsubscribe from Level 2 or Time & Sales:
{
"type": "unsubscribe",
"id": "unsub-3",
"payload": [
{
"symbol": "AAPL",
"level2": true,
"timeAndSales": true
}
]
}
Error Response:
{
"type": "event",
"payload": {
"action": "error",
"error": "no symbols provided",
"timestamp": 1701450000123
}
}
Request/Response Model
For on-demand data (option chains, equity snapshots), use type: "request" with a method and path.
Get Option Expiry Dates:
{
"type": "request",
"id": "req-1",
"payload": {
"method": "GET",
"path": "/options/AAPL/expiry-dates"
}
}
Response:
{
"type": "response",
"id": "req-1",
"payload": {
"status": 200,
"data": {
"symbol": "AAPL",
"expiryDates": ["2026-01-16", "2026-02-16", "2026-03-21"]
}
}
}
Get Option Contract Symbols:
{
"type": "request",
"id": "req-2",
"payload": {
"method": "GET",
"path": "/options/AAPL/contracts/2026-01-16"
}
}
Response:
{
"type": "response",
"id": "req-2",
"payload": {
"status": 200,
"data": {
"symbol": "AAPL",
"expiryDate": "2026-01-16",
"calls": [
{ "symbol": "AAPL260116C00145000", "strike": 145.0 },
{ "symbol": "AAPL260116C00150000", "strike": 150.0 }
],
"puts": [
{ "symbol": "AAPL260116P00145000", "strike": 145.0 },
{ "symbol": "AAPL260116P00150000", "strike": 150.0 }
]
}
}
}
Get Equity Snapshot:
{
"type": "request",
"id": "req-3",
"payload": {
"method": "GET",
"path": "/equities/AAPL/snapshot"
}
}
Available Fields
| Field | Description |
|---|
symbol | Ticker or option symbol |
price | Last trade price |
size | Trade size |
totalVolume | Total traded volume for the session |
tickVolume | Volume of the most recent tick |
openPrice | Opening price |
highPrice | Session high price |
lowPrice | Session low price |
lastPrice | Last traded price |
netChange | Net change from previous close |
tradeExchange | Exchange where trade executed |
tradeTimestamp | Trade timestamp (ISO 8601) |
tradeSeq | Trade sequence number |
tick | Tick direction: up, down, or unchanged |
askPrice | Best ask price |
askChange | Change in ask price |
askExchange | Exchange of best ask |
askSize | Shares available at ask |
askSizeChange | Change in ask size |
bidPrice | Best bid price |
bidChange | Change in bid price |
bidExchange | Exchange of best bid |
bidSize | Shares available at bid |
bidSizeChange | Change in bid size |
quoteTimestamp | Quote timestamp (ISO 8601) |
openInterest | Open interest (options) |
* | Wildcard — subscribe to all fields |