Streaming millisecond-level data.
Use the Market Data WebSocket API to subscribe to realtime quote, snapshot, and kline updates from one stream endpoint.
- Transport
- WSS
- Heartbeat
- quote / kline / snapshot
- Avg latency
- Client-driven reconnect
Connection
Connect to the stream endpoint with a server-side WebSocket client or SDK. The current API authenticates with the Authorization bearer header.
Endpoint
Market Data stream
wss://api.tickquote.com/api/v1/market/streamscope: market:stream
Connection rules
- Connect with the Authorization bearer header from a server-side client or SDK.
- Native browser WebSocket does not allow custom Authorization headers.
- Do not put API keys in the WebSocket URL unless a future release explicitly documents that transport.
- Reconnect with bounded backoff after network loss.
- Replay active subscriptions after reconnecting.
Authentication
Provide your product API key in the Authorization header. Website login JWTs are not accepted for market data streams.
Authorization: Bearer tkp_****redacted****Subscribe
Send a subscribe frame with compact tickers and one or more stream names. If streams is omitted, the server subscribes to quote updates.
{
"op": "subscribe",
"tickers": ["EURUSD", "GBPUSD"],
"streams": ["quote"]
}Message Types
quoteQuote
Latest bid and ask state for a subscribed ticker.
message: subscribed
snapshotSnapshot
A broader market panel snapshot. Nullable fields mean the upstream source did not provide that value.
klineKline
Incremental OHLCV-style kline updates for supported timeframes.
Live preview
A quote message contains the latest bid, ask, mid, spread, ticker, and millisecond timestamp.
Failure codes
WebSocket errors use stable codes. Clients should branch on code instead of parsing message text.
40001invalid_market_subscription
- HTTP
- 400
- Retry
- false
remove unsupported stream or operation values
40101unauthorized
- HTTP
- 401
- Retry
- false
provide a valid product API key
40301market_access_denied
- HTTP
- 403
- Retry
- false
request market data entitlement
42901market_rate_limited
- HTTP
- 429
- Retry
- true
back off and retry later
JavaScript Example
import WebSocket from "ws"
const ws = new WebSocket("wss://api.tickquote.com/api/v1/market/stream", {
headers: { Authorization: `Bearer ${TICKQUOTE_API_KEY}` },
})
ws.onopen = () => {
ws.send(JSON.stringify({
op: "subscribe",
tickers: ["EURUSD", "GBPUSD"],
streams: ["quote"],
}))
}
ws.onmessage = (event) => {
const msg = JSON.parse(event.data)
if (msg.type === "quote") {
console.log(msg.ticker, msg.bid, msg.ask)
}
}
ws.onerror = (err) => console.error("stream error", err)
ws.onclose = () => console.log("connection closed")Next up
Error Codes