Unofficial CSE API Docs

Live-probed documentation for https://www.cse.lk/api. Not affiliated with the Colombo Stock Exchange.

WebSocket / STOMP guide

The cse.lk Next.js app opens a STOMP session (via SockJS / @stomp/stompjs) against:


https://www.cse.lk/api/ws

Topics (subscribe)

User-queue mirrors: /user/topic/<same>.

Request destinations (send)

After connect, the UI sends empty/trigger frames to:

Notes

Minimal JS sketch (illustrative)


// Illustrative only — match current @stomp/stompjs + SockJS versions yourself.
import { Client } from "@stomp/stompjs";
import SockJS from "sockjs-client";

const client = new Client({
  webSocketFactory: () => new SockJS("https://www.cse.lk/api/ws"),
  onConnect: () => {
    client.subscribe("/topic/status", (msg) => console.log(JSON.parse(msg.body)));
    client.publish({ destination: "/app/request-status", body: "" });
  },
});
client.activate();