Autosuggest
Autosuggest does two things: it improves the user experience by suggesting destinations as they type, and — more importantly — it maps the selected destination to the precise coordinates and location type that drive every downstream API call. Without it, you would need to supply your own coordinate data.
The Autosuggest suite has two APIs that work in sequence.
Get Suggestions API
Trigger after 3+ keystrokes. Returns a ranked list of matching locations and hotels with a type, id, and coordinates. The type field determines which search mode to use.
Get Location Details API
Pass the id from Get Suggestions to retrieve the full polygon boundary of a city or region. Required before calling Search Init for any city type result.
Search type decision table
The type field in the Get Suggestions response tells you exactly which search mode to use in Search Init. Follow this table — no guesswork needed.
| Autosuggest type | Examples | Search mode to use |
|---|---|---|
| city, multiCity, region, neighbourhood | London, Greater London, Mayfair | Polygon or multi-polygon — call Get Location Details first to get the boundary |
| hotel | Taj Mahal Palace Mumbai | Hotel ID search — use the referenceId as the hotelId directly |
| pointOfInterest, airport, trainStation | Heathrow Airport, Eiffel Tower | Circular search — use the returned lat/long with a 2–5 km radius |
Updated about 1 month ago