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:
This request demonstrates using the XML output flag:
Response
JSON Response
The response is a JSON object with the following structure:
plus_code
: Object withglobal_code
(and possiblycompound_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 withlong_name
,short_name
, andtypes
for each address part.geometry
: Object withlocation
(lat/lng),location_type
, andviewport
(northeast/southwest bounds).plus_code
: Object withcompound_code
andglobal_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. |
Next steps
- Try API playground