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.
- Connect — open
wss://stream.tickerlayer.com/?apiKey=…(parameter name must be exactlyapiKey). - Ready — wait for
{ "type": "system", "event": "ready" }before sending anything. - Subscribe — send a JSON text frame with
action,channels, andsymbols. The server replies withsubscribed(and an optional snapshot). - Receive — live
quote/tradeframes on those channels. Useunsubscribe/pingas 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.
Channel crypto.quotes
Flow: connect → ready → subscribe → live quote / trade frames. Same protocol as production clients.
Connect to see the live tick update here.
Minimal example
Same flow in code. Full walkthrough also lives in the Quickstart.
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.tradesStocks
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.statusForex
FX quotes and trades for supported pairs.
forex.quotesforex.tradesRaw single-venue line: SYMBOL.RAW, see Forex → Raw line.
Bonds
Government bond yields (e.g. US:10Y): the latest daily observation on subscribe, then one frame per new observation. See Bonds.
bonds.quotesSymbols 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.
Connection
URL, upgrade outcomes, and the ready frame.
Open →Authentication
Why auth is URL-only, and how it differs from REST.
Open →Subscriptions
subscribe / unsubscribe / ping, snapshot flag, limits.
Open →Message types
system, quote, trade, and error payloads.
Open →Errors & troubleshooting
Upgrade failures, error codes, common fixes.
Open →