Live-probed documentation of Colombo Stock Exchange public JSON/WebSocket endpoints. Not affiliated with the CSE. Data may change without notice.
Community lists (e.g. GH0STH4CKER) name endpoints but often skip request shapes, failure modes, and WebSocket. This project:
- Verifies each endpoint with an automated probe harness (re-run weekly in CI)
- Stores truncated samples + last-verified dates
- Documents STOMP at
/api/ws - Ships curl + Python examples
- States ethics up front (rate limits, no auth abuse)
Hosted docs: https://cookie-cat21.github.io/cse-api-docs/
git clone https://github.com/Cookie-Cat21/cse-api-docs.git
cd cse-api-docs
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# Live probe (polite delays; writes samples/ + catalog/last_probe.json)
python3 scripts/probe.py
# Build static site into site/
python3 scripts/build_site.py
# Local preview
python3 -m http.server 8765 --directory site
# open http://127.0.0.1:8765/catalog/endpoints.yaml # source of truth
samples/ # truncated live JSON
scripts/probe.py # verifier
scripts/build_site.py # static HTML docs
docs/ # markdown sources (ethics, websocket, …)
examples/ # curl + python
site/ # generated (committed; deployed to GitHub Pages)
cd python
pip install -e .
python smoke.pyThin wrappers only (market_status, company_info, trade_summary, …). Same ethics as the docs.
Full request/response shapes, curl examples, and samples: https://cookie-cat21.github.io/cse-api-docs/. Source of truth: catalog/endpoints.yaml.
Prices
POST /companyInfoSummery— per-symbol quote (primary single-name source)POST /tradeSummary— bulk board, best poller source (all symbols in one call)POST /detailedTrades— market-wide detailed trades boardPOST /orderBook— order-book totals + live bid/ask levels for one symbolPOST /todaySharePrice— short list (~top N), not a full board
Market
POST /marketStatus— open/closed status for session gatingPOST /marketSummery— session aggregatesPOST /dailyMarketSummery— end-of-day market aggregates historyPOST /allSectors— sector index rows
Indices
POST /aspiData— All Share Price Index snapshotPOST /snpData— S&P Sri Lanka 20 snapshot
Leaderboards
POST /topGainers/POST /topLooses/POST /mostActiveTrades— also mirrored over WebSocket
Charts
POST /companyChartDataByStock— per-stock intraday ticks (usereqSymbolInfo.idasstockId)POST /chartData— index-scale series only;symbol=is ignoredPOST /daysTrade— day trade tape for one symbol
Company
POST /companyProfile— directors, business summary, logo, contactsPOST /financials— per-symbol annual/quarterly/other report archive +reqFinancialstatement-line array
Disclosures
POST /approvedAnnouncement,POST /getAnnouncementByCompany(preferred per-symbol),POST /announcements(legacy)POST /getFinancialAnnouncement,POST /getNonComplianceAnnouncements,POST /getNewListingsRelatedNoticesAnnouncements,POST /getBuyInBoardAnnouncementsPOST /circularAnnouncement,POST /directiveAnnouncement,POST /getCOVIDAnnouncementsPOST /getGeneralAnnouncementById,POST /getAnnouncementById— detail by id, often 204
Meta / media
GET /corporateAnnouncementCategory,GET /smd/categories,GET /notificationsGET /news/web,GET /events,GET /events/top
WebSocket (STOMP over SockJS at /api/ws) — mirrors aspi, snp, status, summary, today-sharePrice, top-gainers, top-looses, most-active-trades, daytrade. See docs/WEBSOCKET.md / the hosted site for topics and request destinations.
probe.yml— weekly (Mon 06:00 UTC) + on push: live-probes every endpoint, uploads the report.pages.yml— rebuilds the site and deploys it to GitHub Pages on push tomain.
Born from research for Chime, a Telegram-first alerting layer for the CSE that consumes a subset of these endpoints.
Documentation and harness: MIT. CSE data remains subject to CSE terms; we claim no ownership of exchange data. Nothing here is financial advice.