Back

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-historyLive

    Historical line status. Optional ?days sets how far back to look.

    Auth: None.

    Response: application/json

  • GET/api/linesPlanned

    List train lines and their current status.

Pings

  • GET/api/pings/countsLive

    Planned-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/hourlyLive

    Hourly planned-trip ping counts. Requires ?station and ?date.

    Auth: None.

    Response: application/json

  • PUT/api/pings/{pingKey}Live

    Register or update a planned-trip ping (JSON body).

    Auth: None.

    Response: application/json

  • DELETE/api/pings/{pingKey}Live

    Remove a planned-trip ping.

    Auth: None.

    Response: application/json

Push notifications

  • POST/api/push/subscribeLive

    Save a web-push subscription. JSON body: endpoint, p256dh, auth, lineIds (string array).

    Auth: None.

    Response: application/json

  • POST/api/push/unsubscribeLive

    Remove a web-push subscription. JSON body: endpoint.

    Auth: None.

    Response: application/json

  • GET/api/push/checkLive

    Scheduled 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/reportsPlanned

    List commuter reports.

  • POST/api/reportsPlanned

    Submit a report.

  • DELETE/api/reports/{id}Planned

    Delete your own report.

  • POST/api/reports/{id}/votePlanned

    Vote on a report.