Viewing: Stocks

Real-time WebSocket - Stocks

Stream real-time quote updates through the stocks channel.

WS /ws/v1/stocks/

Pro+

Real-time quotes channel for live stock updates.

Endpoint

wss://app.sahmk.sa/ws/v1/stocks/?api_key=YOUR_API_KEY

Connected message

json
{
  "type": "connected",
  "plan": "enterprise",
  "delivery_profile": "standard",
  "limits": {
    "max_symbols_per_connection": 200,
    "max_symbols_per_call": 100,
    "stream_modes": ["standard"]
  },
  "message": "Connected to SAHMK real-time stock stream",
  "timestamp": "2026-07-09T15:05:37.749535+00:00"
}

Client actions

json
{"action":"subscribe","symbols":["2222","1120"]}
{"action":"unsubscribe","symbols":["1120"]}
{"action":"ping"}
{"action":"subscribe","symbols":["*"]} // Enterprise only

Quote message

200 OKapplication/json
{
  "type": "quote",
  "symbol": "2222",
  "mode": "standard",
  "data": {
    "price": 25.86,
    "bid": 25.84,
    "ask": 25.88
  },
  "timestamp": "2026-07-09T15:05:41.114000+00:00",
  "latency_ms": 14
}