Skip to content

Searches for keywords and returns a list of relevant places.

Endpoint

https://maps.track-asia.com/api/v2/geocode/{outputFormat}

outputFormat

outputFormat Description
json (recommended) indicates output in JavaScript Object Notation (JSON)
xml indicates output in XML

Parameters

Parameter Values Description Example
address String (required) The street address that you want to geocode. Specify addresses in accordance with the format used by the national postal service of the country concerned. Additional address elements such as business names and unit, suite or floor numbers should be avoided. Street address elements should be delimited by spaces (shown here as url-escaped to %20) Landmark 81
key String (required) API key public_key
size Number The maximum number of results to return from the search. 5

Example Code

This request demonstrates using the JSON output flag:

https://maps.track-asia.com/api/v2/geocode/json?address=Landmark 81&key=public_key

This request demonstrates using the XML output flag:

https://maps.track-asia.com/api/v2/geocode/xml?address=Landmark 81&size=1&key=public_key
curl -G "https://maps.track-asia.com/api/v2/geocode/json" \
--data-urlencode "address=Landmark 81" \
--data-urlencode "size=2" \
--data-urlencode "key=public_key"
const response = await fetch("https://maps.track-asia.com/api/v2/geocode/xml?address=Landmark 81&size=1&key=public_key")
const data = await response.json()
console.log(data)

Response

JSON Response

The response is a JSON object with the following structure:

  • plus_code: Object with global_code (and possibly compound_code).
  • status: Status string (e.g., "OK").
  • results: An array of result objects. Each result contains:
    • place_id: Unique identifier for the place.
    • name: Name of the place.
    • sublabel: Additional address or context for the place.
    • formatted_address: Full formatted address.
    • address_components: Array of objects with long_name, short_name, and types for each address part.
    • geometry: Object with location (lat/lng), location_type, and viewport (northeast/southwest bounds).
    • plus_code: Object with compound_code and global_code (may be repeated inside results).
    • partial_match: Boolean indicating if the result is a partial match.
    • icon, icon_background_color, class, subclass: Visual and classification info.
    • types: Array of place types.
XML Response

The XML response has a similar structure, with elements corresponding to the JSON fields above. Notable differences:

  • XML results are wrapped in a root <GeocodeResponse> element.
  • Arrays in JSON (like results, address_components, types) become repeated elements in XML (like <result>, <address_component>, <type>).
  • Blank elements are indicated by empty arrays in JSON, but by the absence of such elements in XML.

Status

Status Description
OK indicates that no errors occurred; the address was successfully parsed and at least one geocode was returned.
ZERO_RESULTS indicates that the geocode was successful but returned no results. This may occur if the geocoder was passed a non-existent address.

Error

When the geocoder returns a status code other than OK, there may be an additional error_message field within the Geocoding response object. This field contains more detailed information about the reasons behind the given status code.

Next steps