EGX.news
عربي
← Back to Our Data/WebSocket Feed Docs
EGX REAL-TIME WEBSOCKET STREAMING

Real-Time WebSocket Feed API & Python Guide

Institutional sub-second streaming for all ~288 EGX stocks and on-demand Level 2 depth up to 40 levels. 64-character token authentication with flat pricing: $1,500/mo or $100/day ($4,000 for 3 months, $7,500 for 6 months).

$1,500/mo • $100/day • $4,000 / 3mo
STEP 01 OF 06

Connect & Verify Authentication Handshake

Connect to the feed over TLS using your assigned credentials in the URL query string. The server immediately returns connection details and rate limits.

Python 3 • websockets
wss://server.egx.news/api/ws
import asyncio
import json
import websockets

FEED_URL = "wss://server.egx.news/api/ws"
GMAIL = "YOUR_ACCOUNT_EMAIL@gmail.com"
KEY = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"  # 64-character cryptographic token
VALIDITY = "2026-12-31"

async def main():
    uri = f"{FEED_URL}?gmail={GMAIL}&key={KEY}&validity={VALIDITY}"
    print(f"[*] Connecting to {FEED_URL}...")
    
    async with websockets.connect(uri, ping_interval=None) as ws:
        # Await Connection Acknowledgment
        raw_response = await ws.recv()
        data = json.loads(raw_response)
        print("[✔] Connected successfully!")
        print(json.dumps(data, indent=2))

if __name__ == "__main__":
    asyncio.run(main())
Server Response Sample
JSON UTF-8
{
  "feed": "egx.realtime",
  "type": "connection_established",
  "timestamp": 1794384573000,
  "data": {
    "account": "YOUR_ACCOUNT_EMAIL@gmail.com",
    "validUntil": "2026-12-31",
    "limits": {
      "maxConcurrentConnections": 1,
      "depthSwitchMinIntervalMs": 2000
    }
  }
}