GET /v1/suggest
Place autocomplete predictions.
Returns up to 7 prediction matches for a partial text input.
Required scope: geocoding:read
Request
Query parameters
| Name | Required | Description |
|---|---|---|
input | yes | Search text. Minimum 2 characters. |
lang | no | Language code, defaults to vi. |
country | no | ISO 3166 alpha-2 or alpha-3 (e.g. VN or VNM). |
sessionToken | no | Group autocomplete keystrokes into one billable session. Pass it in X-Session-Token header instead if you prefer. |
focus.lat | no | Bias predictions toward this latitude. |
focus.lon | no | Bias predictions toward this longitude. |
Response
Response fields
| Field | Type | Description |
|---|---|---|
predictions[].placeId | string | Stable identifier. Pass to /v1/place/resolve. |
predictions[].text | string | Full formatted address. |
predictions[].mainText | string | Primary line (e.g. street + number, POI name). |
predictions[].secondaryText | string | Secondary line (admin hierarchy). |
predictions[].types | string[] | Optional Google-style place types. |
source | string | Layer that served the response: cache, postgres, or google. |
elapsed_ms | number | Server-side processing time. |
Common errors
400 BAD_REQUEST—inputshorter than 2 characters.401 INVALID_API_KEY— key not recognized.403 INSUFFICIENT_SCOPE— key is missinggeocoding:read.429 RATE_LIMIT_MINUTE— back off using theretry_afterfield.