1
2
Debounce the input
Firing a request per keystroke burns through your quota and produces flickering results
as responses arrive out of order. 300 ms is a good default.The
cancelled flag matters as much as the timer — without it, a slow early request can
resolve after a fast later one and overwrite fresh results with stale ones.3
Render the suggestions
4
Resolve the selected place
Search results carry no coordinates — that keeps autocomplete responses small. Fetch
them only for the result the user actually picks.
/places accepts either placeId (from a Baato search result) or osmId (an
OpenStreetMap object ID). Both return a one-element array — read data[0].Next
Reverse geocoding
Go the other way — coordinates to an address.
Search API reference
Every parameter, with a live playground.