TrenT
TrenT

Reputation: 39

Google maps autocomplete - session token

I'm building a Flutter application where I'm using the Google Places Autocomplete API to let users select a location. For this, I make a direct HTTP request like this:

https://maps.googleapis.com/maps/api/place/autocomplete/json?input=San&key=MY_API_KEY&sessiontoken=cdea8139-0124-4393-8c74-e60dede6d6a2

I pass UUID as session token to group the requests but this doesn't seem to be working. I have also tested this API directly from Postman, even though I'm passing the sessionID its being counted as separate requests per character.

My questions are:

  1. Am I missing something about how session tokens work with the Places Autocomplete API? Why am I still being charged per input?
  2. Is there a better way to integrate the Google Places Autocomplete API in Flutter that will help me manage requests efficiently and reduce unnecessary billing?
  3. How should I handle session tokens properly to minimize costs in my Flutter application?

Upvotes: 0

Views: 57

Answers (0)

Related Questions