Developers API

Realtime Event Engine

WebSocket streaming, event webhooks, payload schemas, rule conditions, delivery lifecycle, signature verification, event history, and errors.

WebSocket Streaming

Real-time stock price streaming via WebSocket, with market updates pushed as soon as they change.

WebSocket URL:

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

Availability: WebSocket streaming requires Pro, Business, or Enterprise plans.

Subscription Limits

PlanMax symbols/connectionMax symbols/callSubscribe all (*)
Pro6020No
Business12040No
Enterprise20020 (or 100 on enterprise profile)Yes

Client -> Server Messages

ActionMessageDescription
Subscribe{"action":"subscribe","symbols":["2222","1120"]}Subscribe to specific symbols
Subscribe All{"action":"subscribe","symbols":["*"]}Enterprise-only full market subscription
Unsubscribe{"action":"unsubscribe","symbols":["2222"]}Stop updates for selected symbols
Ping{"action":"ping"}Keep-alive probe

Server -> Client Message Types

connectedsubscribedunsubscribedquotepongerror

No required ping interval is published. Clients may send ping and receive pong.

Per-call limits can vary by plan profile. Use limits returned in the connected message for your account.