Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Ability to pass an Autocomplete session token into Autocomplete requests #123

Open
connor-odoherty opened this issue Aug 23, 2019 · 4 comments
Labels

Comments

@connor-odoherty
Copy link

The Google Places API is expensive when charged for every single autocomplete and places detail request. Luckily, they have added Session pricing to their rate model.

To do this, users provide a session token that is used for every "group" of autocomplete requests. A "group" is considered to be a series of Places Autocomplete requests that result in a Place Details request.

So instead of being charged for every single request, and then the Places Detail request, you only get charged for the single Places Detail request so long as the proceeding Autocomplete requests shared the same session token.

A session token can be any string, though Google recommends UUID 4.

I suggest allowing the user to specify the session token on each call to the client through the options hash as opposed to setting the token during the initialization phase

@qpowell
Copy link
Owner

qpowell commented Oct 8, 2019

@connor-odoherty Would you be interested in opening a PR for this? I'm all for providing mechanisms for people to access the API in a more cost-effective way, and if it's just a matter of making this one of the options that we include in the request, it seems reasonable.

I still prefer interacting with the Autocomplete API using the JS libraries, but this seems like a valid use case 👍

@edwinwills Any thoughts?

@NikoRoberts
Copy link

NikoRoberts commented Nov 5, 2019

Just to add a link to Google's documentation on how session tokens work
https://developers.google.com/places/web-service/session-tokens

Out of interest, has anyone started any work on this?

@qpowell
Copy link
Owner

qpowell commented Jan 29, 2020

Just to add a link to Google's documentation on how session tokens work
https://developers.google.com/places/web-service/session-tokens

Out of interest, has anyone started any work on this?

Thanks for the docs link! As far as I know, no one's started working on this. Are you interested in taking it on? 😉

@NikoRoberts
Copy link

Digging into this more we discovered that in our use case using session based requests was actually more expensive, as our users are only locating suburbs and not street addresses which on average requires less characters typed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants