DocsAuthentication

Authentication

Unlike REST, the public WebSocket does not read x-api-key headers on data frames. Authentication happens exactly once during the HTTP upgrade.

Open .md

How it works

Pass your raw API key as the apiKey query parameter on the upgrade URL. The server checks it for the ws surface before completing the 101 handshake. This is native WebSocket: no Socket.IO namespace, no handshake object and no in-frame authentication step.

Connect URL
wss://stream.tickerlayer.com/?apiKey=<YOUR_API_KEY>

Case-sensitive parameter name

It must be exactly apiKey. Other spellings such as api_key or APIKEY are rejected with 401 before the upgrade completes.

To try a live connection without pasting your key into the page, use the WebSocket overview.

Compared to REST

SurfaceKey goes inAlso accepted
RESTx-api-key header?apiKey= query parameter, for compatibility
WebSocket?apiKey= on the upgrade URLNothing else: headers on later frames are not read

Auth errors

StatusMeaning
401Invalid or missing apiKey, or a key not entitled for WebSocket. The upgrade is rejected and no frames are sent.
403The key exists but the ws surface is not enabled for this account tier.