When Bus API
Live Singapore bus arrival data through a small HTTP API.
This service wraps the LTA DataMall API for personal projects. Every endpoint uses GET with query parameters, and JSON endpoints return validation errors in a consistent shape.
GET
/getBusArrival
Get arrivals for one bus stop
Pass an LTA bus stop code and receive the available services with upcoming arrival minutes, load status, operator, and wheelchair availability.
busStopCoderequired, example71119
curl -sS 'https://when-bus.shaikzhafir.com/getBusArrival?busStopCode=71119' | jq .
GET
/getNearestBusStops
Find the nearest bus stops with arrivals
Provide WGS84 coordinates and get the nearest four bus stops, each with distance in kilometers and live arrival data.
latrequired, double precisionlngrequired, double precision
curl -sS 'https://when-bus.shaikzhafir.com/getNearestBusStops?lat=1.326277&lng=103.890342' | jq .
GET
/api
Demo response endpoint
Optional plain-text endpoint for checking that the server is responding. The
name query parameter is optional.
nameoptional
curl -sS 'https://when-bus.shaikzhafir.com/api?name=Alice'