Auto Complete (V2)
Help users find what they're looking for without requiring them to fully specify their search term.
Url
Method: GET
https://maps.track-asia.com/api/v2/place/autocomplete/{outputFormat}
Example
https://maps.track-asia.com/api/v2/place/autocomplete/json?input=toa nha bw&bounds=21.6463420,104.8429379;21.7503187,104.9330227&size=2&key=public_key
https://maps.track-asia.com/api/v2/place/autocomplete/xml?input=toa nha bw&bounds=21.6463420,104.8429379;21.7503187,104.9330227&key=public_key
outputFormat
outputFormat | Description |
---|---|
json | indicates output in JavaScript Object Notation (JSON) |
xml | indicates output in XML |
Parameters
Parameter | Values | Description | Example |
---|---|---|---|
input | String (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 for | toa nha bw |
key | String (required) | API key | public_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 | 21.6463420,104.8429379;21.7503187,104.9330227 |
size | Number | The maximum number of results to return from the search. | 2 |
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": "2:venue:5742c73c-e04b-5151-a776-7290bf659c21","reference": "2:venue:5742c73c-e04b-5151-a776-7290bf659c21","name": "Tòa Nhà Bw","sublabel": "15A Đường Võ Văn Kiệt, Phường 16, Quận 8, Thành phố Hồ Chí Minh","description": "Tòa Nhà Bw, 15A Đường Võ Văn Kiệt, Phường 16, Quận 8, Thành phố Hồ Chí Minh","matched_substrings": [{"length": 10,"offset": 0}],"structured_formatting": {"main_text": "Tòa Nhà Bw","main_text_matched_substrings": [{"length": 10,"offset": 0}],"secondary_text": "15A Đường Võ Văn Kiệt, Phường 16, Quận 8, Thành phố Hồ Chí Minh"},"terms": [{"offset": 0,"value": "Tòa Nhà Bw"},{"offset": 12,"value": "15A Đường Võ Văn Kiệt"},{"offset": 35,"value": "Phường 16"},{"offset": 46,"value": "Quận 8"},{"offset": 54,"value": "Thành phố Hồ Chí Minh"}],"geometry": {"location": {"lat": 10.727988,"lng": 106.625478},"location_type": "ROOFTOP","viewport": {"northeast": {"lat": 10.729784622349982,"lng": 106.62730658234071},"southwest": {"lat": 10.726191377650018,"lng": 106.6236494176593}}},"plus_code": {"compound_code": "PJHG+55 Quận 8, Thành phố Hồ Chí Minh, Việt Nam","global_code": "7P28PJHG+55"},"types": ["point_of_interest"]},{"place_id": "17:venue:e779f882-6d20-5c9b-8cf9-7616582e1714","reference": "17:venue:e779f882-6d20-5c9b-8cf9-7616582e1714","name": "Bw Premier Marvella Nha Trang","sublabel": "Phường Lộc Thọ, Thành phố Nha Trang, Tỉnh Khánh Hòa","description": "Bw Premier Marvella Nha Trang, Phường Lộc Thọ, Thành phố Nha Trang, Tỉnh Khánh Hòa","matched_substrings": [{"length": 6,"offset": 2}],"structured_formatting": {"main_text": "Bw Premier Marvella Nha Trang","main_text_matched_substrings": [{"length": 6,"offset": 2}],"secondary_text": "Phường Lộc Thọ, Thành phố Nha Trang, Tỉnh Khánh Hòa"},"terms": [{"offset": 0,"value": "Bw Premier Marvella Nha Trang"},{"offset": 31,"value": "Phường Lộc Thọ"},{"offset": 47,"value": "Thành phố Nha Trang"},{"offset": 68,"value": "Tỉnh Khánh Hòa"}],"geometry": {"location": {"lat": 12.224968,"lng": 109.200844},"location_type": "ROOFTOP","viewport": {"northeast": {"lat": 12.226764622349982,"lng": 109.2026823083604},"southwest": {"lat": 12.223171377650019,"lng": 109.19900569163961}}},"plus_code": {"compound_code": "66F2+X8 Thành phố Nha Trang, Tỉnh Khánh Hòa, Việt Nam","global_code": "7P4F66F2+X8"},"class": "lodging","subclass": "hotel","types": ["point_of_interest","hotel","lodging"]}]}
XML Response
<?xml version="1.0" encoding="UTF-8"?><GeocodeResponse><status>OK</status><predictions><place_id>2:venue:5742c73c-e04b-5151-a776-7290bf659c21</place_id><reference>2:venue:5742c73c-e04b-5151-a776-7290bf659c21</reference><name>Tòa Nhà Bw</name><sublabel>15A Đường Võ Văn Kiệt, Phường 16, Quận 8, Thành phố Hồ Chí Minh</sublabel><description>Tòa Nhà Bw, 15A Đường Võ Văn Kiệt, Phường 16, Quận 8, Thành phố Hồ Chí Minh</description><matched_substrings><length>10</length><offset>0</offset></matched_substrings><structured_formatting><main_text>Tòa Nhà Bw</main_text><main_text_matched_substrings><length>10</length><offset>0</offset></main_text_matched_substrings><secondary_text>15A Đường Võ Văn Kiệt, Phường 16, Quận 8, Thành phố Hồ Chí Minh</secondary_text></structured_formatting><terms><offset>0</offset><value>Tòa Nhà Bw</value></terms><terms><offset>12</offset><value>15A Đường Võ Văn Kiệt</value></terms><terms><offset>35</offset><value>Phường 16</value></terms><terms><offset>46</offset><value>Quận 8</value></terms><terms><offset>54</offset><value>Thành phố Hồ Chí Minh</value></terms><geometry><location><lat>10.727988</lat><lng>106.625478</lng></location><location_type>ROOFTOP</location_type><viewport><northeast><lat>10.729784622349982</lat><lng>106.62730658234071</lng></northeast><southwest><lat>10.726191377650018</lat><lng>106.6236494176593</lng></southwest></viewport></geometry><plus_code><compound_code>PJHG+55 Quận 8, Thành phố Hồ Chí Minh, Việt Nam</compound_code><global_code>7P28PJHG+55</global_code></plus_code><types>point_of_interest</types></predictions></GeocodeResponse>