GEOGovernment ยท Singapore Land Authority (SLA)

OneMap Routing

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

3 stops to a working call

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

Get a OneMap token (login)

OneMap uses a token, not a static API key. Register an account on OneMap, then POST your email and password:

curl -X POST 'https://www.onemap.gov.sg/api/auth/post/getToken' \
  -H 'Content-Type: application/json' \
  -d '{"email":"you@example.com","password":"YOUR_PASSWORD"}'
{"access_token":"***","expiry_timestamp":"1689388144"}

Each token is valid for 3 days. It does not auto renew. Call getToken again when it expires. Errors: 401 authentication failed, 404 user not registered.

Routing request

Send the token in the Authorization header. Example from the official docs:

curl -H 'Authorization: YOUR_TOKEN' \
  'https://www.onemap.gov.sg/api/public/routingsvc/route?start=1.3081592%2C103.8551479&end=1.2739864%2C103.8012642&routeType=pt&date=11-10-2025&time=11%3A19%3A47&mode=TRANSIT&maxWalkDistance=1000&numItineraries=3'
  • start, end: lat,lng. Required.
  • routeType: walk, drive, cycle or pt. Required.
  • For pt only: date (MM-DD-YYYY), time (HH:MM:SS, 24 hour), mode (transit, bus or rail). Optional: maxWalkDistance, numItineraries (1 to 3).

Walk, drive and cycle responses include status_message, an encoded route_geometry, route_instructions and route_summary with total_time (seconds) and total_distance (metres). Public transport responses return itineraries with legs such as WALK and SUBWAY.

Errors

We called the routing endpoint without a token on 2026-09-25 and got {"message":"Unauthorized"}. Documented errors:

  • 401 Unauthorized: missing or expired token.
  • 400: missing start or end, bad routeType, missing pt mode, bad date or time format, date more than 1 year past or 1 month ahead, coordinates outside Singapore, numItineraries outside 1 to 3.
  • 404: no route found between the locations.

The Search API now also needs a token. Our untokened search call still returned results with an error field reading "Authentication token missing".

OneMap Routing: common questions

Is the OneMap Routing free?

Yes. Singapore Land Authority (SLA) offers the OneMap Routing free of charge.

Does the OneMap Routing need an API key?

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

What is the OneMap Routing endpoint?

The base URL is https://www.onemap.gov.sg/api/public/routingsvc/route. A working example: 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'

How do I log in to the OneMap API?

POST your registered email and password as JSON to https://www.onemap.gov.sg/api/auth/post/getToken. You get access_token and expiry_timestamp.

Is there a OneMap API key?

No static key. You use an access token from getToken, sent in the Authorization header.

How long does a OneMap token last?

3 days. It does not renew itself, so request a new one before expiry_timestamp.

What route types does the OneMap routing API support?

walk, drive, cycle and pt. pt also needs date, time and mode.

Why do I get Unauthorized from OneMap routing?

The Authorization header is missing or the token has expired. Generate a new token.

Verified 2026-09-25 against www.onemap.gov.sg, www.onemap.gov.sg

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

On the same line