Real-Time
WebSocket Streaming
Persistent connections for live market ticks, instant price updates, and real-time subscription management.
Connection Flow
Four steps from connection to live data.
Connect
Open a WebSocket connection to the server endpoint
Authenticate
Send your API key within the 30-second auth window
Subscribe
Subscribe to one or many symbols for live ticks
Stream
Receive real-time bid/ask ticks as JSON messages
You must authenticate within 30 seconds of connecting or the server will close the connection.
Message Reference
All JSON messages you send and receive over the WebSocket.
Client → Server
Authenticate
Required — send within 30 seconds of connecting
{ "type": "auth", "apiKey": "<your-api-key>" }Subscribe to Symbol
Start receiving ticks for a single instrument
{ "type": "subscribe", "symbol": "EURUSD" }Subscribe to Multiple
Batch subscribe to many symbols at once
{ "type": "subscribe", "symbols": ["EURUSD", "GBPUSD", "XAUUSD"] }Unsubscribe
Stop receiving ticks for a symbol
{ "type": "unsubscribe", "symbol": "EURUSD" }List Subscriptions
Query your current active subscriptions
{ "type": "list" }Server → Client
Tick Data
Real-time price update for a subscribed symbol
{
"type": "tick",
"symbol": "EURUSD",
"bid": 1.0850,
"ask": 1.0852,
"time": 1709742000000
}Auth Response
Confirms successful authentication
{
"type": "auth",
"success": true,
"message": "Authenticated successfully"
}Subscription Confirmation
Confirms subscription changes
{
"type": "subscribed",
"symbols": ["EURUSD"],
"totalSubscriptions": 1
}Error
Returned when a message is invalid or auth fails
{
"type": "error",
"message": "Authentication required"
}Stream ticks
in any language
Full working examples covering connection, authentication, subscribing to symbols, and processing live tick data.
Tip: For Python, install websocket-client via pip. For Node.js, use the built-in ws package.
1import websocket, json23API_KEY = "tk_live_a1b2c3d4e5f6"4WS_URL = "ws://127.0.0.1:8080"56ws = websocket.create_connection(WS_URL)7print(ws.recv()) # Welcome message89# Authenticate10ws.send(json.dumps({"type": "auth", "apiKey": API_KEY}))11auth = json.loads(ws.recv())12print(f"Auth: {auth['message']}")1314# Subscribe to symbols15ws.send(json.dumps({16 "type": "subscribe",17 "symbols": ["EURUSD", "GBPUSD", "XAUUSD"]18}))19print(ws.recv()) # Subscription confirmation2021# Stream ticks22while True:23 msg = json.loads(ws.recv())24 if msg["type"] == "tick":25 print(f"{msg['symbol']:>8} {msg['bid']:.5f} / {msg['ask']:.5f}")Built for Real-Time
Enterprise-grade WebSocket infrastructure for production trading systems.
Sub-Millisecond Delivery
Ticks delivered from the matching engine to your client with minimal network overhead.
Multi-Symbol Streaming
Subscribe to hundreds of instruments on a single persistent connection.
API Key Authentication
Secure connections with scoped API keys and automatic timeout on unauthenticated sessions.
Auto-Reconnect Friendly
Stateless subscriptions — simply re-subscribe after reconnecting. No session state to restore.
Heartbeat & Keep-Alive
Built-in ping/pong to detect stale connections and keep firewalls from closing idle sockets.
Cross-Platform
Standard WebSocket protocol works with every language and platform — Python, Node.js, C#, browser JS, and more.
Need request-response instead?
Use our REST API for account management, trade execution, and market data queries.