Help users find what they're looking for without requiring them to fully specify their search term.
Endpoint
https://sg-maps.track-asia.com/api/v1/autocomplete
Parameters
| Parameter | Values | Description | Example |
|---|---|---|---|
text | String (required) | Representing what a user has typed | KFC |
lang | Target language | The target language code in the BCP47 standard. Only the language subtag information is used to set the target language. | en |
size | Number | The number of results returned | 5 |
focus.point.lat | {latitude} | Latitude to focus search based on geographic area | 1.4761 |
focus.point.lon | {longitude} | Longitude to focus search based a geographical area | 103.68 |
key | String (required) | API key | public_key |
Example Code
Response
JSON Response
The response is a JSON object with the following structure:
type:"FeatureCollection". Indicates the type of GeoJSON object.features: An array ofFeatureobjects, each representing a suggested location. EachFeaturehas the following structure:type:"Feature". Indicates the type of GeoJSON feature.geometry: Represents the geometry of the feature.type:"Point". Indicates the geometry type is a point.coordinates: An array of[longitude, latitude]representing the point's coordinates.
properties: An object containing properties of the feature:id: A unique identifier for the feature.gid: A global identifier for the feature.layer: The layer type of the feature (e.g.,"venue","street").country_code: The two-letter country code.name: The name of the location.street: The street address of the location (if available).confidence: A score indicating the confidence level of the result.country: The name of the country.country_a: The three-letter country code.region: The name of the region.region_a: The region code.county: The name of the county.locality: The name of the locality.label: A formatted label for the location.country_id: The ID of the country.region_id: The ID of the region.county_id: The ID of the county.locality_id: The ID of the locality.
bbox: An array representing the bounding box of the results in the format[minLon, minLat, maxLon, maxLat].
Next steps
- Try API playground