OneMap Routing

Government

by Singapore Land Authority (SLA)

Turn-by-turn routing within Singapore for drive, walk, cycle and public transport modes, including bus and train legs with fares for the pt mode. Free alternative to commercial routing for SG-only apps.

How to authenticate

  1. 1Register a free account at onemap.gov.sg.
  2. 2POST email and password to https://www.onemap.gov.sg/api/auth/post/getToken to get a 3-day access_token.
  3. 3Send the token in the Authorization header on every routing call.

Example request

Request
curl -H 'Authorization: YOUR_TOKEN' 'https://www.onemap.gov.sg/api/public/routingsvc/route?start=1.320981,103.844150&end=1.326762,103.8559&routeType=drive'

Example response

Response (truncated)
{"status_message":"Found route between points","route_geometry":"encoded_polyline...","route_summary":{"total_time":420,"total_distance":3600}}

Notes for AI agents

routeType=pt needs extra params (date, time, mode=TRANSIT, maxWalkDistance). Geometry is an encoded polyline; decode with any polyline library.

Machine-readable version: /api/apis/onemap-routing

Related APIs