Show Side Bar

Reverse Geocode

The API retrieves an address that lies within a specified buffer/radius of a specified location (in latitude/longitude under WGS84 coordinates or Y/X under SVY21 coordinates).

The maximum buffer/radius is 500m for buildings and 20m for roads. Fields without value will return as "NIL". Building name will return "null", if the building is not named. Longer response time is expected for searching of some addresses. By default, the system will return a maximum of 10 nearest buildings.

Reverse Geocode is available in SVY21 and WGS84 format.

Reverse Geocode (SVY21)

Possible Error Responses

400 - Please send the access token in the request header as a bearer token.

400 - Your provided location is empty.

400 - Your provided location is invalid.

401 - Token has expired: Session expired. Please refresh your token (if still within refresh window) or re-login.

401 - Invalid token: Could not decode token: The token xxx; is an invalid JWS.

403 - Access Forbidden. GET access to component 'xxx' of service 'xxx' is not allowed by this user's role.

429 - API limit(s) exceeded.

HEADER PARAMETERS

AuthorizationstringRequired

API token provided by the Authentication Service.

QUERY PARAMETERS

locationstring

X and Y coordinates in SVY21 format.

bufferstring

Optional. Values: 0-500 (in meters). Rounds up all buildings in a circumference from a point and search building add

addressTypestring

Optional. Values: HDB or All. Allows users to define property types within the buffer/radius. If HDB is selected, result

otherFeaturesstring

Optional. Values: Y or N. Allows uses the page to retrieve information on reservoirs, playgrounds, jetties, etc. Default is N.

GET
/api/public/revgeocodexy


Sample Request

GET
/api/public/revgeocodexy?location=24291.97788882387%2C31373.0117224489&buffer=40&addressType=All&otherFeatures=N
1const url = "https://www.onemap.gov.sg/api/public/revgeocodexy?location=24291.97788882387%2C31373.0117224489&buffer=40&addressType=All&otherFeatures=N"; 2const authToken = '**********************'; // Replace with your access token 3 4fetch(url, { 5 method: 'GET', 6 headers: { 7 'Authorization': `${authToken}`, // API token for authorization 8 } 9}) 10.then(response => response.json()) // Parse response as JSON 11.then(data => console.log(data)) // Log the data to the console 12.catch(error => console.error('Error:', error)); // Log any errors

Sample Response
1{ 2 "GeocodeInfo": [ 3 { 4 "BUILDINGNAME": "NEW TOWN PRIMARY SCHOOL", 5 "BLOCK": "300", 6 "ROAD": "TANGLIN HALT ROAD", 7 "POSTALCODE": "148812", 8 "XCOORD": "24303.3101027", 9 "YCOORD": "31333.3389857", 10 "LATITUDE": "1.2996418818103135", 11 "LONGITUDE": "103.80010216304007" 12 } 13 ] 14}

Reverse Geocode (WGS84)

Possible Error Responses

400 - Please send the access token in the request header as a bearer token.

400 - Your provided location is empty.

400 - Your provided location is invalid.

401 - Token has expired: Session expired. Please refresh your token (if still within refresh window) or re-login.

401 - Invalid token: Could not decode token: The token xxx; is an invalid JWS.

403 - Access Forbidden. GET access to component 'xxx' of service 'xxx' is not allowed by this user's role.

429 - API limit(s) exceeded.

HEADER PARAMETERS

AuthorizationstringRequired

API token provided by the Authentication Service.

QUERY PARAMETERS

locationstring

Latitude and longitude coordinates in WGS84 format.

bufferstring

Optional. Values: 0-500 (in meters). Rounds up all buildings in a circumference from a point and search building add

addressTypestring

Optional. Values: HDB or All. Allows users to define property types within the buffer/radius. If HDB is selected, result

otherFeaturesstring

Optional. Values: Y or N. Allows uses the page to retrieve information on reservoirs, playgrounds, jetties, etc. Default is N.

GET
/api/public/revgeocode


Sample Request

GET
/api/public/revgeocode?location=1.3254295,103.9005321&buffer=40&addressType=All&otherFeatures=N
1const url = "https://www.onemap.gov.sg/api/public/revgeocode?location=1.3254295,103.9005321&buffer=40&addressType=All&otherFeatures=N"; 2const authToken = '**********************'; // Replace with your access token 3 4fetch(url, { 5 method: 'GET', 6 headers: { 7 'Authorization': `${authToken}`, // API token for authorization 8 } 9}) 10.then(response => response.json()) // Parse response as JSON 11.then(data => console.log(data)) // Log the data to the console 12.catch(error => console.error('Error:', error)); // Log any errors

Sample Response
1{ 2 "GeocodeInfo": [ 3 { 4 "BUILDINGNAME": "KAMPONG UBI VIEW", 5 "BLOCK": "351", 6 "ROAD": "UBI AVENUE 1", 7 "POSTALCODE": "400351", 8 "XCOORD": "35501.9607216", 9 "YCOORD": "34191.1578935", 10 "LATITUDE": "1.325486284730739", 11 "LONGITUDE": "103.90072773995409" 12 }, 13 { 14 "BUILDINGNAME": "KAMPONG UBI VIEW", 15 "BLOCK": "352", 16 "ROAD": "UBI AVENUE 1", 17 "POSTALCODE": "400352", 18 "XCOORD": "35354.2225417", 19 "YCOORD": "34162.4855169", 20 "LATITUDE": "1.3252270180708603", 21 "LONGITUDE": "103.89940022649942" 22 }, 23 { 24 "BUILDINGNAME": "KAMPONG UBI VIEW", 25 "BLOCK": "349", 26 "ROAD": "UBI AVENUE 1", 27 "POSTALCODE": "400349", 28 "XCOORD": "35485.6405577", 29 "YCOORD": "34228.9805541", 30 "LATITUDE": "1.3258283432645641", 31 "LONGITUDE": "103.90058110378057" 32 } 33 ] 34}