Reverse Geocoding (V2)
Find places or addresses near a longitude/latitude pair
Url
Method: GET
https://sg-maps.track-asia.com/api/v2/geocode/json
Example
https://sg-maps.track-asia.com/api/v2/geocode/json?latlng=1.301998,103.81143&radius=100&key=public_key
https://sg-maps.track-asia.com/api/v2/geocode/json?latlng=1.301998,103.81143&radius=100&key=public_key
outputFormat
outputFormat | Description |
---|---|
json | indicates output in JavaScript Object Notation (JSON) |
xml | indicates output in XML |
Parameters
Parameter | Values | Description | Example |
---|---|---|---|
latlng | {latitude}, {longitude} (required) | The latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address. | 10.7952219,106.7217912 |
key | String (required) | API key | public_key |
radius | Number | The search radius in meters (m) | 500, 100, 50, etc. |
JSON Response
{"plus_code": {"global_code": "6PH58R26+QH"},"status": "OK","results": [{"place_id": "openstreetmap:venue:node/4712455214","name": "Little Mandaríns","sublabel": "Loewen Road, Tanglin, CENTRAL REGION, Singapore","formatted_address": "Little Mandaríns, Loewen Road, Tanglin, CENTRAL REGION, Singapore","address_components": [{"long_name": "Loewen Road","short_name": "Loewen Road","types": ["route"]},{"long_name": "Tanglin","short_name": "Tanglin","types": ["administrative_area_level_2","political"]},{"long_name": "CENTRAL REGION","short_name": null,"types": ["administrative_area_level_1","political"]},{"long_name": "Singapore","short_name": "SG","types": ["country","political"]}],"geometry": {"location": {"lat": 1.302119,"lng": 103.811462},"location_type": "ROOFTOP","viewport": {"northeast": {"lat": 1.3039156223499822,"lng": 103.81325908641236},"southwest": {"lat": 1.300322377650018,"lng": 103.80966491358765}}},"plus_code": {"compound_code": "8R26+RH Tanglin, CENTRAL REGION, Singapore","global_code": "6PH58R26+RH"},"partial_match": false,"icon": "marker2-11","icon_background_color": "#5c6f84","types": ["point_of_interest","professional"]}]}
XML Response
<?xml version="1.0" encoding="UTF-8"?><GeocodeResponse><plus_code><global_code>6PH58R26+QH</global_code></plus_code><status>OK</status><result><place_id>openstreetmap:venue:node/4712455214</place_id><name>Little Mandaríns</name><sublabel>Loewen Road, Tanglin, CENTRAL REGION, Singapore</sublabel><formatted_address>Little Mandaríns, Loewen Road, Tanglin, CENTRAL REGION, Singapore</formatted_address><geometry><location><lat>1.302119</lat><lng>103.811462</lng></location><location_type>ROOFTOP</location_type><viewport><northeast><lat>1.3039156223499822</lat><lng>103.81325908641236</lng></northeast><southwest><lat>1.300322377650018</lat><lng>103.80966491358765</lng></southwest></viewport></geometry><plus_code><compound_code>8R26+RH Tanglin, CENTRAL REGION, Singapore</compound_code><global_code>6PH58R26+RH</global_code></plus_code><partial_match>false</partial_match><icon>marker2-11</icon><icon_background_color>#5c6f84</icon_background_color><types>point_of_interest</types><types>professional</types><address_component><long_name>Loewen Road</long_name><short_name>Loewen Road</short_name><type>route</type></address_component><address_component><long_name>Tanglin</long_name><short_name>Tanglin</short_name><type>administrative_area_level_2</type><type>political</type></address_component><address_component><long_name>CENTRAL REGION</long_name><short_name/><type>administrative_area_level_1</type><type>political</type></address_component><address_component><long_name>Singapore</long_name><short_name>SG</short_name><type>country</type><type>political</type></address_component></result></GeocodeResponse>