Forum Academy Marketplace Showcase Pricing Features

Google Places API autocomplete excessive requests

I’m building a weather app that allows the user to search by address. I’m currently using a search box with Geographic Places set as the Choice style, using the built-in autocomplete with the Google Places API. I’m then using the Geocoding API to convert the address to coordinates…

It’s working great, but I’m finding that it’s making an excessive number of requests to the Places API. From what I can tell, it’s making a request every time it populates guesses in the auto-complete process.

For example, below is the before and after from performing a single address search:

PlacesAPI-1

PlacesAPI-2

15 requests were made while performing just 1 search, and my workflow includes only 1 call to the API. This isn’t a big deal for my own testing purposes, but once the app goes live and is being used by actual users, this could really add up.

Is there any way to conserve calls using the built-in geographic places search function?

It looks like Google offers an “offset” parameter where the autocomplete wouldn’t kick in until a set # of characters were typed. I believe this would help to lower the # of requests. Is there any way to enable something like this with the built-in search function?

I guess the alternative would be to use the API connector instead where there is more control over the parameters?

Thanks!
Brandon

3 Likes

Hello @brandondereksmith ,

Did you got your issue resolved? I am having similar issue with a high request number but can’t figure out why.

Thanks.

Hi @StefanL, I never did get this resolved unfortunately. I ended up moving on to a different project for unrelated reasons, but you might consider checking out the Algolia Places plugin as an alternative to Google.

Hi @brandondereksmith ,

Wow thanks for the answer!

For now, I simply tried to reduce the number of returned results (from 10 to 5) and will check if any positive impact.

I will definitely look into Algolia, I was anyways looking into this platform for other aspect of my app. Very interesting.