shmidt / GooglePlacesSearchController

Google Places autocompleting address search controller
MIT License
194 stars 44 forks source link

Debounce the search field input or use sessions #32

Open ricsantos opened 4 years ago

ricsantos commented 4 years ago

If the user is typing quickly, multiple requests are made to the /place/autocomplete endpoint. As Google charges per request, might be good to debounce or filter the keyboard input so that requests are made as soon as the user stops typing.

Alternatively, looking at the pricing page https://developers.google.com/places/web-service/usage-and-billing, it appears that a session can be used such that the /autocomplete request is free, and only the /details request is billed.