Auto Complete (V2)

Help users find what they're looking for without requiring them to fully specify their search term.

Url

Method: GET

  https://sg-maps.track-asia.com/api/v2/place/autocomplete/json

Example

https://sg-maps.track-asia.com/api/v2/place/autocomplete/json?&input=KFC&key=public_key
https://sg-maps.track-asia.com/api/v2/place/autocomplete/json?input=KFC&location=1.301998,103.81143&key=public_key

outputFormat

outputFormatDescription
jsonindicates output in JavaScript Object Notation (JSON)
xmlindicates output in XML

Parameters

ParameterValuesDescriptionExample
inputString (required)input — The input string that you want to autocomplete. This input string could be a partial address, a place name, or any other string that you want to find a match forKFC
keyString (required)API keypublic_key
bounds{latitude}, {longitude}The bounding box of the viewport within which to bias geocode results more prominently. This parameter will only influence, not fully restrict, results from the geocoder
sizeNumberThe maximum number of results to return from the search.
location{latitude}, {longitude}The latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address.10.7952219,106.7217912

JSON Response

{
"status": "OK",
"predictions": [
{
"place_id": "openstreetmap:venue:node/9375731817",
"reference": "openstreetmap:venue:node/9375731817",
"name": "KFC",
"sublabel": "Sembawang, NORTH REGION, Singapore",
"description": "KFC, Sembawang, NORTH REGION, Singapore",
"matched_substrings": [
{
"length": 0,
"offset": null
}
],
"structured_formatting": {
"main_text": "KFC",
"main_text_matched_substrings": [
{
"length": 0,
"offset": null
}
],
"secondary_text": "Sembawang, NORTH REGION, Singapore"
},
"terms": [
{
"offset": 0,
"value": "KFC"
},
{
"offset": 5,
"value": "Sembawang"
},
{
"offset": 16,
"value": "NORTH REGION"
},
{
"offset": 30,
"value": "Singapore"
}
],
"geometry": {
"location": {
"lat": 1.443529,
"lng": 103.830258
},
"location_type": "ROOFTOP",
"viewport": {
"northeast": {
"lat": 1.4453256223499822,
"lng": 103.83205519270786
},
"southwest": {
"lat": 1.441732377650018,
"lng": 103.82846080729215
}
}
},
"plus_code": {
"compound_code": "CRVJ+C4 Sembawang, NORTH REGION, Singapore",
"global_code": "6PH5CRVJ+C4"
},
"icon": "marker2-11",
"types": [
"point_of_interest",
"food",
"retail",
"food:chicken"
]
},
{
"place_id": "openstreetmap:venue:node/11641240718",
"reference": "openstreetmap:venue:node/11641240718",
"name": "KFC",
"sublabel": "Orchard, CENTRAL REGION, Singapore",
"description": "KFC, Orchard, CENTRAL REGION, Singapore",
"matched_substrings": [
{
"length": 0,
"offset": null
}
],
"structured_formatting": {
"main_text": "KFC",
"main_text_matched_substrings": [
{
"length": 0,
"offset": null
}
],
"secondary_text": "Orchard, CENTRAL REGION, Singapore"
},
"terms": [
{
"offset": 0,
"value": "KFC"
},
{
"offset": 5,
"value": "Orchard"
},
{
"offset": 14,
"value": "CENTRAL REGION"
},
{
"offset": 30,
"value": "Singapore"
}
],
"geometry": {
"location": {
"lat": 1.307103,
"lng": 103.833306
},
"location_type": "ROOFTOP",
"viewport": {
"northeast": {
"lat": 1.308899622349982,
"lng": 103.83510308997242
},
"southwest": {
"lat": 1.3053063776500178,
"lng": 103.83150891002757
}
}
},
"plus_code": {
"compound_code": "8R4M+R8 Orchard, CENTRAL REGION, Singapore",
"global_code": "6PH58R4M+R8"
},
"icon": "marker2-11",
"types": [
"point_of_interest",
"food",
"retail",
"food:chicken"
]
}
]
}

XML Response

<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
<status>OK</status>
<predictions>
<place_id>openstreetmap:venue:node/9375731817</place_id>
<reference>openstreetmap:venue:node/9375731817</reference>
<name>KFC</name>
<sublabel>Sembawang, NORTH REGION, Singapore</sublabel>
<description>KFC, Sembawang, NORTH REGION, Singapore</description>
<matched_substrings>
<length>0</length>
<offset/>
</matched_substrings>
<structured_formatting>
<main_text>KFC</main_text>
<main_text_matched_substrings>
<length>0</length>
<offset/>
</main_text_matched_substrings>
<secondary_text>Sembawang, NORTH REGION, Singapore</secondary_text>
</structured_formatting>
<terms>
<offset>0</offset>
<value>KFC</value>
</terms>
<terms>
<offset>5</offset>
<value>Sembawang</value>
</terms>
<terms>
<offset>16</offset>
<value>NORTH REGION</value>
</terms>
<terms>
<offset>30</offset>
<value>Singapore</value>
</terms>
<geometry>
<location>
<lat>1.443529</lat>
<lng>103.830258</lng>
</location>
<location_type>ROOFTOP</location_type>
<viewport>
<northeast>
<lat>1.4453256223499822</lat>
<lng>103.83205519270786</lng>
</northeast>
<southwest>
<lat>1.441732377650018</lat>
<lng>103.82846080729215</lng>
</southwest>
</viewport>
</geometry>
<plus_code>
<compound_code>CRVJ+C4 Sembawang, NORTH REGION, Singapore</compound_code>
<global_code>6PH5CRVJ+C4</global_code>
</plus_code>
<icon>marker2-11</icon>
<types>point_of_interest</types>
<types>food</types>
<types>retail</types>
<types>food:chicken</types>
</predictions>
<predictions>
<place_id>openstreetmap:venue:node/11641240718</place_id>
<reference>openstreetmap:venue:node/11641240718</reference>
<name>KFC</name>
<sublabel>Orchard, CENTRAL REGION, Singapore</sublabel>
<description>KFC, Orchard, CENTRAL REGION, Singapore</description>
<matched_substrings>
<length>0</length>
<offset/>
</matched_substrings>
<structured_formatting>
<main_text>KFC</main_text>
<main_text_matched_substrings>
<length>0</length>
<offset/>
</main_text_matched_substrings>
<secondary_text>Orchard, CENTRAL REGION, Singapore</secondary_text>
</structured_formatting>
<terms>
<offset>0</offset>
<value>KFC</value>
</terms>
<terms>
<offset>5</offset>
<value>Orchard</value>
</terms>
<terms>
<offset>14</offset>
<value>CENTRAL REGION</value>
</terms>
<terms>
<offset>30</offset>
<value>Singapore</value>
</terms>
<geometry>
<location>
<lat>1.307103</lat>
<lng>103.833306</lng>
</location>
<location_type>ROOFTOP</location_type>
<viewport>
<northeast>
<lat>1.308899622349982</lat>
<lng>103.83510308997242</lng>
</northeast>
<southwest>
<lat>1.3053063776500178</lat>
<lng>103.83150891002757</lng>
</southwest>
</viewport>
</geometry>
<plus_code>
<compound_code>8R4M+R8 Orchard, CENTRAL REGION, Singapore</compound_code>
<global_code>6PH58R4M+R8</global_code>
</plus_code>
<icon>marker2-11</icon>
<types>point_of_interest</types>
<types>food</types>
<types>retail</types>
<types>food:chicken</types>
</predictions>
</GeocodeResponse>