DocsConnection

Connection

Open one native WebSocket to the stream host. Authentication is part of the upgrade URL. After a successful handshake the first application message is always a ready frame.

Connect URL

Production stream host is wss://stream.tickerlayer.com. Pass your raw API key as the apiKey query parameter (URL-encode it). Auth details: Authentication. Prefer trying the live panel on the WebSocket overview before wiring your own client.

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

Path note

The public path defaults to /. If your account was given a custom stream path, append it before the query string (for example wss://stream.tickerlayer.com/stream?apiKey=…). Most customers use the default.

Upgrade outcomes

  • 401 — missing or invalid apiKey, or key not entitled for WebSocket. Plain HTTP response; no WebSocket frames.
  • 403 — key exists but the ws surface is not enabled for this account. See Authentication.
  • 429 — global or per-account connection limit. Account-limit bodies may include WS_CONNECTION_LIMIT_EXCEEDED. If your account reserves connections for specific keys, the message can also say the remaining slots are reserved even while the account is below its total limit; see Reserved connections.
  • 101 Switching Protocols — success. First app message is the ready frame below.

Reserved connections per key

Your connection allowance is account-wide and shared by every API key. From the dashboard's Manage API keys panel you can reserve part of that allowance for a specific key: a key with N reserved slots can always open at least N connections, no matter how many connections your other keys hold. Keys without a reservation share the remaining slots. This protects a critical consumer (an oracle feed, a production service) from reconnect storms or leaks in your other environments.

Once the shared portion is exhausted, further connects from non-reserved keys are refused with the same WS_CONNECTION_LIMIT_EXCEEDED body even while the account is below its total limit; the message states that the remaining slots are reserved. Reservation changes apply to new connections within a few seconds and never disconnect sockets that are already open. The sum of reservations across your keys can never exceed the account allowance.

Ready frame

Sent immediately after a successful upgrade. Wait for this frame before any subscribe actions.

Server → client
{
  "type": "system",
  "event": "ready",
  "ts": 1743512400000
}