GoGoDuk

GET /v1/suggest

Place autocomplete predictions.

Returns up to 7 prediction matches for a partial text input.

Required scope: geocoding:read

Request

GET /v1/suggest?input=ho+chi
X-API-Key: gdk_live_xxxxxxxxxxxxxxxxxxxxxxxx

Query parameters

NameRequiredDescription
inputyesSearch text. Minimum 2 characters.
langnoLanguage code, defaults to vi.
countrynoISO 3166 alpha-2 or alpha-3 (e.g. VN or VNM).
sessionTokennoGroup autocomplete keystrokes into one billable session. Pass it in X-Session-Token header instead if you prefer.
focus.latnoBias predictions toward this latitude.
focus.lonnoBias predictions toward this longitude.

Response

{
  "predictions": [
    {
      "placeId": "ChIJi85p5P0ldTERfqSM08G0C1Q",
      "text": "201 Trần Não, Khu phố 3, An Khánh, Thủ Đức, Thành phố Hồ Chí Minh",
      "mainText": "201 Trần Não",
      "secondaryText": "Khu phố 3, An Khánh, Thủ Đức, Thành phố Hồ Chí Minh",
      "types": ["geocode", "subpremise"]
    }
  ],
  "source": "cache",
  "elapsed_ms": 42
}

Response fields

FieldTypeDescription
predictions[].placeIdstringStable identifier. Pass to /v1/place/resolve.
predictions[].textstringFull formatted address.
predictions[].mainTextstringPrimary line (e.g. street + number, POI name).
predictions[].secondaryTextstringSecondary line (admin hierarchy).
predictions[].typesstring[]Optional Google-style place types.
sourcestringLayer that served the response: cache, postgres, or google.
elapsed_msnumberServer-side processing time.

Common errors

  • 400 BAD_REQUESTinput shorter than 2 characters.
  • 401 INVALID_API_KEY — key not recognized.
  • 403 INSUFFICIENT_SCOPE — key is missing geocoding:read.
  • 429 RATE_LIMIT_MINUTE — back off using the retry_after field.

On this page