Skip to main content
Version: Next

WebSocket Connection Guide

Real-time market data interface for Spot, supporting K-line, Ticker, order book and other data push.

Connection Address

wss://api9528mystks.mystonks.org/api/v1/ws/kline

General Rules

  • Protocol: WebSocket (ws:// or wss://)
  • Data Format: JSON
  • Heartbeat Timeout: Auto disconnect after 60 seconds of no message
  • Recommended Heartbeat Interval: Send ping every 20 seconds

Heartbeat Mechanism

Heartbeat Request

Client needs to periodically send heartbeat to maintain connection

{"action": "ping"}

Heartbeat Response

Server returns pong response

{"event": "pong", "time": 1736163000000}