API
A public REST API for JomKomute (live commuter reports and train line status) is being planned. This page is a temporary placeholder.
Placeholder, not yet public. This API is a placeholder and is not yet public or stable. Endpoints marked Live exist in the app today, but they are internal, not documented for third parties and may change without notice. Everything marked Planned is a roadmap and cannot be called yet.
Authenticating
API keys are not available yet. When they ship, requests will use a bearer token:
curl -H "Authorization: Bearer <api-key>" https://jomkomute.taufikhamid.com/api/...Line status
- GET
/api/line-historyLiveHistorical line status. Optional ?days sets how far back to look.
Auth: None.
Response: application/json
- GET
/api/linesPlannedList train lines and their current status.
Pings
- GET
/api/pings/countsLivePlanned-trip ping counts for a station and date. Requires ?station and ?date; optional ?bucket and ?window (numbers).
Auth: None.
Response: application/json
- GET
/api/pings/hourlyLiveHourly planned-trip ping counts. Requires ?station and ?date.
Auth: None.
Response: application/json
- PUT
/api/pings/{pingKey}LiveRegister or update a planned-trip ping (JSON body).
Auth: None.
Response: application/json
- DELETE
/api/pings/{pingKey}LiveRemove a planned-trip ping.
Auth: None.
Response: application/json
Push notifications
- POST
/api/push/subscribeLiveSave a web-push subscription. JSON body: endpoint, p256dh, auth, lineIds (string array).
Auth: None.
Response: application/json
- POST
/api/push/unsubscribeLiveRemove a web-push subscription. JSON body: endpoint.
Auth: None.
Response: application/json
- GET
/api/push/checkLiveScheduled job that sends line-status push notifications. Called daily by Vercel Cron.
Auth: Bearer CRON_SECRET (internal, not for public use).
Response: application/json
Reports
- GET
/api/reportsPlannedList commuter reports.
- POST
/api/reportsPlannedSubmit a report.
- DELETE
/api/reports/{id}PlannedDelete your own report.
- POST
/api/reports/{id}/votePlannedVote on a report.