Skip to content

Searches for keywords and returns a list of relevant places.

Endpoint

https://maps.track-asia.com/api/v1/search

Parameters

Parameter Values Description Example
text String (required) Representing what a user has typed 2 Nguyen Hue, phuong Sai Gon, thanh pho Ho Chi Minh
lang Target language The target language code in the BCP47 standard. Only the language subtag information is used to set the target language e.g. en vi
size Number The number of results returned 5
focus.point.lat {latitude} Latitude to focus search based on geographic area 10.761
focus.point.lon {longitude} Longitude to focus search based a geographical area 106.68
new_admin Boolean Return address according to new administrative boundaries true
key String (required) API key (use your own key; public_key is limited and for testing only) public_key

Example Code

https://maps.track-asia.com/api/v1/search?new_admin=true&lang=vi&text=2 Nguyen Hue, phuong Sai Gon, thanh pho Ho Chi Minh&key=public_key
https://maps.track-asia.com/api/v1/search?lang=vi&text=2 Nguyen Hue, quan 1, thanh pho Ho Chi Minh&focus.point.lat=10.761&focus.point.lon=106.68&size=2&key=public_key
curl -G "https://maps.track-asia.com/api/v1/search" \
--data-urlencode "lang=vi" \
--data-urlencode "text=2 Nguyen Hue, phuong Sai Gon, thanh pho Ho Chi Minh" \
--data-urlencode "focus.point.lat=10.761" \
--data-urlencode "focus.point.lon=106.68" \
--data-urlencode "size=5" \
--data-urlencode "key=public_key"
const response = await fetch("https://maps.track-asia.com/api/v1/search?new_admin=true&lang=vi&text=2 Nguyen Hue, phuong Sai Gon, thanh pho Ho Chi Minh&key=public_key")
const data = await response.json()
console.log(data)

Response

JSON Response

The response is a JSON object with the following structure:

  • type: "FeatureCollection". Indicates the type of GeoJSON object.
  • features: An array of Feature objects, each representing a found place. Each Feature has:
    • type: "Feature".
    • geometry: The geometry of the feature:
      • type: "Point".
      • coordinates: An array of [longitude, latitude] for the point.
    • properties: An object with details about the place:
      • id: Unique identifier for the feature.
      • gid: Global identifier for the feature.
      • layer: The layer type (e.g., "venue", "address").
      • name: Name of the place.
      • street: Street address (if available).
      • confidence: Confidence score for the result.
      • country, country_code, country_a, country_id: Country info.
      • region, region_a, region_id: Region info.
      • county, county_id: County info.
      • locality, locality_id: Locality info.
      • label: Formatted label for the place.
      • ...and other address-related fields as available.
  • bbox: An array [minLon, minLat, maxLon, maxLat] representing the bounding box of the results.

Next steps