DocsOverview

WebSocket stream

One native WebSocket. Authenticate on connect, wait for ready, subscribe to channels, receive quote and trade frames. No Socket.IO.

How it works

Think of four steps. Everything else in this section is detail around the same loop.

  1. Connect — open wss://stream.tickerlayer.com/?apiKey=… (parameter name must be exactly apiKey).
  2. Ready — wait for { "type": "system", "event": "ready" } before sending anything.
  3. Subscribe — send a JSON text frame with action, channels, and symbols. The server replies with subscribed (and an optional snapshot).
  4. Receive — live quote / trade frames on those channels. Use unsubscribe / ping as needed.

Auth happens only on the HTTP upgrade — not on later frames. Details: Connection · Authentication.

Try it live

Signed-in accounts with an active key can open a real stream from this page — pick an asset and stream, add up to two symbols, and watch the latest tick update in place.

Try it live

WebSocket playground

Connect with your account key, subscribe to one channel, and watch the latest tick update in place. The key is never shown in this panel.

Idle
Stream

Channel crypto.quotes

Flow: connect → ready → subscribe → live quote / trade frames. Same protocol as production clients.

Latest frame

Connect to see the live tick update here.

Minimal example

Same flow in code. Full walkthrough also lives in the Quickstart.

Browser / Node
const ws = new WebSocket(
  "wss://stream.tickerlayer.com/?apiKey=" + encodeURIComponent(rawKey)
);

ws.onmessage = (ev) => {
  const msg = JSON.parse(String(ev.data));
  if (msg.type === "system" && msg.event === "ready") {
    ws.send(JSON.stringify({
      action: "subscribe",
      channels: ["crypto.quotes"],
      symbols: ["BTCUSD"],
    }));
    return;
  }
  console.log(msg); // quote | trade | system | error
};

Supported channels

Fourteen public channels: quote/trade pairs for six asset classes, a trading status channel for US equities, and a daily rate channel for government bond yields.

Crypto

Real-time quotes and trades for supported symbols.

crypto.quotescrypto.trades

Stocks

US and international equities — same CC:SYMBOL convention as REST (e.g. US:AAPL, DE:BMW). stocks.status streams US trading halt and resume events.

stocks.quotesstocks.tradesstocks.status

Forex

FX quotes and trades for supported pairs.

forex.quotesforex.trades

Raw single-venue line: SYMBOL.RAW, see Forex → Raw line.

Commodities

Metals, energy, and agriculture — see Commodities.

commodities.quotescommodities.trades

Indices

Public index codes (e.g. US500). REST: /docs/rest/indices.

indices.quotesindices.trades

ETFs

ETF product codes (e.g. US500ETF). REST: /docs/rest/etfs.

etfs.quotesetfs.trades

Bonds

Government bond yields (e.g. US:10Y): the latest daily observation on subscribe, then one frame per new observation. See Bonds.

bonds.quotes

Symbols must be enabled for the asset class you subscribe to — same registries as REST.

Deeper reference

Keep these pages for detail. Start above if you only need the happy path.