Skip to main content
WSS
/
v1
/
charts
/
ws
What this stream is for. This WebSocket is a charting-specific feed designed to plug straight into the TradingView Charting Library or any chart widget that follows the TradingView data shape. If you’re rendering candlestick or line charts in your app and need them to update in real time, use this feed. If you need full market depth, Greeks, or T&S, use the Market Data WebSocket instead.

Key Features

Connect Then Authenticate

Open a WebSocket to the endpoint, then send a request to POST /auth with your token. Subscribe only after authSuccess.

Real-Time Quotes

Stream live bid/ask, last price, OHLC, volume, and change for charting.

Real-Time Trades

Receive last-trade updates (price, size, timestamp) for tape and chart integration.

Subscribed Quotes

Subscribe to one or more symbols; receive event messages with quote and trade data for each subscribed symbol.

TradingView Format

Quote and trade payloads use TradingView-friendly field names for easy integration.

Equities & Options

Support for stock tickers and OSI option symbols.

Keep-Alive

Ping/pong for connection health; optional correlation ID for pong.

Endpoint

Connect to the WebSocket at /v1/charts/ws.Production: wss://api.aries.com/v1/charts/ws
Staging: wss://api.aries.com/v1/charts/ws
Health check: GET /tv/health (HTTP)

Authentication

Authentication is required. Use an OAuth2 access token (e.g. from POST /v1/oauth2/token). After the connection is open, send a request message with method POST, path /auth, and body { "token": "<your_access_token>" }. Wait for a response with action authSuccess before sending subscribe messages. If the server returns authRequired or error, authentication failed (e.g. invalid or expired token).
This WebSocket follows a TradingView-compatible message format. All request/response messages use the shared envelope: type, id, payload (with method, path, body for requests).

Equities

Standard stock ticker symbols (e.g., AAPL, MSFT, GOOGL, TSLA). Use them exactly as a brokerage screen would display them.

Options

Option contracts use OSI (Options Symbology Initiative) symbols. Format: ROOT + YYMMDD + C/P + strike-in-cents (e.g., AAPL240119C00150000 is the AAPL Jan-19-2024 $150 Call).
Every message you send or receive uses the same outer JSON shape:
FieldTypeRequiredWhat to put here
typestringYesWhat kind of message this is. Sent by you: request (RPC-style call, e.g. auth), subscribe, unsubscribe, ping. Sent by the server: event (streaming push), response (reply to your request), pong (reply to your ping).
idstringNoA correlation ID you choose, like "sub-aapl-1". The server echoes it back in the matching response/event so you can pair them up.
timestampstringNoRFC3339 timestamp (e.g. 2026-05-13T10:30:00Z). Optional on client messages; the server fills it in on outbound messages.
payloadobjectYesThe actual body of the message. Shape depends on type — see the sections below.
The subscription payload.type controls what kind of data the server streams back:
  • quotes (default) — Bid/ask, last price, OHLC, volume, change, change percent, exchange, and description. This is what most chart widgets need for the price/quote display.
  • bars — Time-series bar/candle data. Use type: "bars" in the subscribe payload when this is supported, primarily for incremental chart updates.

Live Chart Updates

Display real-time price movements on interactive charts.

TradingView Widgets

Feed real-time data into TradingView charting library or embedded widgets.

Quote Displays

Show last price, bid/ask, and volume in chart widgets (after authenticating).

Technical Analysis

Provide data for indicators and overlays in charting tools.

Connection

Connect to the Charting WebSocket the same way you would the Market Data WebSocket: establish the connection, then authenticate, then subscribe to symbols to receive real-time quotes and trades.

Connect to the endpoint

Open a secure WebSocket connection to:
wss://api.aries.com/v1/charts/ws

Authenticate

Immediately after the connection is open, send one request message to authenticate. Do not send subscribe messages until you receive a successful auth response. Send the following auth message:
{
  "type": "request",
  "id": "auth-001",
  "payload": {
    "method": "POST",
    "path": "/auth",
    "body": {
      "token": "YOUR_ACCESS_TOKEN"
    }
  }
}
Server responds (success): type: "response", with payload.action: "authSuccess", optional payload.id (echoed from request), payload.timestamp (Unix milliseconds), and payload.data.expiresIn (session expiry in milliseconds). Server responds (failure): payload.action: "authRequired" or payload.action: "error" with payload.error (e.g. “token is required”, “authentication failed”). Reconnect or send a new auth request with a valid token.

Subscribe to symbols

After authSuccess, send subscribe messages to start receiving quote and trade event messages for the requested symbols. See Subscribing to Chart Data below.

Subscribing to Chart Data

After you have connected and authenticated, you can subscribe to real-time quotes (and trades) for one or more symbols. Each subscription uses a subscribe message; the server then sends event messages containing quote/trade data for those symbols.

Basic subscription structure

Send a subscribe message with type fixed as "subscribe", any id you want (used to correlate the server’s responses), and a payload describing what you want to receive:
Payload fieldTypeRequiredWhat to enter
typestringYes"quotes" for real-time price ticks (the common case), or "bars" for time-series candle/bar data.
symbolstringYesThe instrument identifier — a stock ticker like "AAPL", or an OSI option symbol like "AAPL240119C00150000".
symbolTypestringNo"symbol" (default — for equities/indices) or "option" when subscribing to an option contract.
Full message to send:
{
  "type": "subscribe",
  "id": "sub-1",
  "payload": {
    "type": "quotes",
    "symbol": "AAPL"
  }
}

Subscription examples

Single symbol (quotes)

Subscribe to real-time quotes for one equity:
{
  "type": "subscribe",
  "id": "sub-1",
  "payload": { "type": "quotes", "symbol": "AAPL" }
}
You will receive event messages with payload.type: "quotes" and payload.symbol: "AAPL" containing payload.data.quote and payload.data.trade.
Subscribe to quotes for several symbols by sending one subscribe message per symbol (each with its own id if needed):First symbol:
{
  "type": "subscribe",
  "id": "sub-aapl",
  "payload": { "type": "quotes", "symbol": "AAPL" }
}
Second symbol:
{
  "type": "subscribe",
  "id": "sub-msft",
  "payload": { "type": "quotes", "symbol": "MSFT" }
}
Third symbol:
{
  "type": "subscribe",
  "id": "sub-googl",
  "payload": { "type": "quotes", "symbol": "GOOGL" }
}
The server sends event messages for each subscribed symbol; use payload.symbol to route updates.
For option contracts, use the OSI symbol:
{
  "type": "subscribe",
  "id": "sub-opt-1",
  "payload": { "type": "quotes", "symbol": "AAPL240119C00150000" }
}
{
  "type": "subscribe",
  "id": "sub-2",
  "payload": { "type": "quotes", "symbol": "TSLA" }
}

Connection Flow

1

Connect

Open a WebSocket connection to wss://api.aries.com/v1/charts/ws
2

Authenticate

Send a request message: type: "request", payload: { "method": "POST", "path": "/auth", "body": { "token": "<access_token>" } }. Wait for a response with payload.action: "authSuccess".
3

Subscribe

Send subscribe messages with payload.type and payload.symbol for each symbol you want.
4

Receive events

Process event messages containing quote and trade data for your subscribed symbols.
5

Unsubscribe (optional)

Send unsubscribe with the same symbol to stop updates.
6

Keep-Alive (optional)

Send ping periodically; server responds with pong.

Client → Server Messages

Subscribe

Provide payload.type and payload.symbol; the full message is built as:
{
  "type": "subscribe",
  "id": "sub-1",
  "payload": {
    "type": "quotes",
    "symbol": "AAPL"
  }
}

Unsubscribe

Stop receiving updates for a symbol. Provide payload.type and payload.symbol (must match the subscription).
{
  "type": "unsubscribe",
  "id": "unsub-1",
  "payload": {
    "type": "quotes",
    "symbol": "AAPL"
  }
}

Ping

Keep-alive; server responds with pong. Optional id is echoed in the pong.
{ "type": "ping", "id": "ping-1" }

Server → Client Messages

Event (quote/trade update)

Server pushes quote and/or trade data for subscribed symbols.
{
  "type": "event",
  "timestamp": "2026-02-23T18:36:59Z",
  "payload": {
    "type": "quotes",
    "symbol": "AAPL",
    "data": {
      "isDelayed": false,
      "quote": {
        "s": "ok",
        "n": "AAPL",
        "v": {
          "ch": 4.77,
          "chp": 1.80,
          "short_name": "AAPL",
          "exchange": "NASDAQ",
          "description": "Apple Inc.",
          "lp": 269.35,
          "ask": 269.36,
          "bid": 269.34,
          "open_price": 263.48,
          "high_price": 269.43,
          "low_price": 263.38,
          "prev_close_price": 264.58,
          "volume": 48234100.00
        }
      },
      "trade": {
        "s": "ok",
        "t": 1771871819,
        "lp": 269.35,
        "v": 100
      }
    },
    "timestamp": 1771871819072
  }
}
The field names below (ch, chp, lp, n, v, etc.) are TradingView’s short-form keys. They look cryptic but they’re standardized — the TradingView Charting Library expects exactly these names. Do not rename them in your handler if you’re piping data into a TradingView widget.
Event payload fields:
FieldTypeDescription
typestringAlways "quotes" for quote/trade events.
symbolstringThe symbol this event is about (e.g. AAPL). Match against your active subscriptions.
dataobjectThe quote and trade payload (see below).
timestampintegerWhen the event was emitted, in Unix milliseconds.
payload.data fields:
FieldTypeDescription
quoteobjectQuote data. Contains s (status string, usually "ok"), n (the symbol), and v (the actual quote values — see next table).
tradeobjectTrade data (see below). Omitted if there’s no recent trade to report.
isDelayedbooleanfalse = real-time market data, true = the feed is delayed (typically 15 min). Show users a “delayed” badge when this is true.
payload.data.quote.v fields — these are the values the chart actually plots. All numbers and all optional (only changed fields may be present in an update):
FieldTypeWhat it represents
chnumberChange — net price change from previous close (today’s last price − yesterday’s close). Drives the +/− indicator on a chart.
chpnumberChange percentch expressed as a percent of previous close.
short_namestringDisplay ticker, e.g. "AAPL".
exchangestringPrimary listing exchange, e.g. "NASDAQ".
descriptionstringHuman-readable name, e.g. "Apple Inc." — what to show as the chart title.
lpnumberLast price — most recent trade price. The number on the big “current price” label.
asknumberBest ask (the lowest price someone is willing to sell at).
bidnumberBest bid (the highest price someone is willing to pay).
open_pricenumberToday’s opening price (first trade of the session).
high_pricenumberToday’s highest price so far.
low_pricenumberToday’s lowest price so far.
prev_close_pricenumberYesterday’s closing price — the baseline for calculating today’s change.
volumenumberCumulative number of shares traded today.
payload.data.trade fields — emitted whenever a new print appears on the tape:
FieldTypeWhat it represents
sstringStatus — "ok" when the trade is valid.
tintegerTrade timestamp in Unix seconds (note: trade t is seconds, but the outer payload.timestamp is milliseconds).
lpnumberLast trade price — the price the trade printed at.
vintegerTrade size (number of shares/contracts).

Response (auth or error)

Auth success: type: "response", payload.action: "authSuccess", optional payload.id (echoed request ID), payload.timestamp (Unix milliseconds), payload.data.expiresIn (session expiry in milliseconds). Error (e.g. invalid subscribe): type: "response", payload.error with message.
{
  "type": "response",
  "id": "sub-1",
  "payload": {
    "error": "symbol is required in payload",
    "timestamp": 1736946600123
  }
}

Pong

Reply to ping.
{
  "type": "pong",
  "id": "ping-1",
  "timestamp": "2025-01-15T14:30:00Z"
}

Quick Start Example

Connect, authenticate, then subscribe to quotes (same pattern as the Market Data WebSocket):
const ws = new WebSocket('wss://api.aries.com/v1/charts/ws');

ws.onopen = () => {
  // 1. Authenticate first
  ws.send(JSON.stringify({
    type: 'request',
    id: 'auth-001',
    payload: {
      method: 'POST',
      path: '/auth',
      body: { token: 'YOUR_OAUTH2_ACCESS_TOKEN' }
    }
  }));
};

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);

  if (msg.type === 'response' && msg.payload?.action === 'authSuccess') {
    // 2. After auth success, subscribe to quotes
    ws.send(JSON.stringify({
      type: 'subscribe',
      id: 'sub-1',
      payload: { type: 'quotes', symbol: 'AAPL' }
    }));
  } else if (msg.type === 'event' && msg.payload?.data) {
    const { quote, trade } = msg.payload.data;
    if (quote?.v) console.log('Quote:', quote.v.lp, quote.v.ch, quote.v.volume);
    if (trade) console.log('Trade:', trade.lp, trade.v, trade.t);
  } else if (msg.type === 'response' && msg.payload?.error) {
    console.error('Error:', msg.payload.error);
  } else if (msg.type === 'pong') {
    console.log('Pong received');
  }
};

// Optional keep-alive
const pingInterval = setInterval(() => {
  if (ws.readyState === WebSocket.OPEN) {
    ws.send(JSON.stringify({ type: 'ping', id: 'ping-1' }));
  }
}, 30000);

ws.onclose = () => clearInterval(pingInterval);

Support

Need help with the Charting WebSocket?

Email Support

Messages
Auth Request
type:object

Authenticate with OAuth2 access token

Subscribe Request
type:object

Subscribe to quotes/trades for a symbol

Unsubscribe Request
type:object

Unsubscribe from a symbol

Ping Request
type:object

Keep-alive ping

Quote/Trade Event
type:object

Server-pushed quote and/or trade update

Error Response
type:object

Error response for subscribe/unsubscribe or auth

Auth Required Response
type:object

Server requests authentication

Auth Success Response
type:object

Successful authentication response

Pong Response
type:object

Pong reply to ping