Session Tokens  |  Places API  |  Google for Developers (2024)

Table of Contents
Example Create session tokens
Stay organized with collections Save and categorize content based on your preferences.

Place Autocomplete uses session tokens to group the query and selectionphases of a user autocomplete search into a discrete session for billingpurposes. The session begins when the user starts typing a query, and concludeswhen they select a place and a call to Place Details is made. Each session canhave multiple autocomplete queries, followed by one place selection. The APIkey(s) used for each request within a session must belong to the sameGoogle Cloud Console project. Once a session has concluded, the token is no longervalid; your app must generate a fresh token for each session. If thesessiontoken parameter is omitted, or if you reuse a sessiontoken, the session is charged as if no session token was provided (each requestis billed separately).

We recommend the following guidelines:

  • Use session tokens for all autocomplete sessions.
  • Generate a fresh token for each session.
  • Ensure that the API key(s) used for all Place Autocomplete and Place Details requests within a session belong to the same Google Cloud Console project.
  • Be sure to pass a unique session token for each new session. Using the same token for more than one session will result in each request being billed individually.

You can optionally omit the autocomplete session token from a request. Ifthe session token is omitted, each request is billed separately, triggering theAutocomplete - Per RequestSKU. If you reuse a session token, the session is considered invalid and therequests are charged as if no session token was provided.

Example

As the user types a query, an autocomplete request is called every fewkeystrokes (not per-character), and a list of possible results is returned.When the user makes a selection from the result list, the selection counts asa request, and all of the requests made during the search are bundled andcounted as a single request. If the user selects a place, the search query isavailable at no charge, and only the Place data request is charged. If the user does not make aselection within a few minutes of the beginning of the session, only thesearch query is charged.

Let's examine this flow of events from the perspective of an app.

  1. A user begins typing a query to search for "Paris, France".
  2. Upon detecting user input, the app creates a new session token, "Token A".
  3. As the user types, the API makes an autocomplete request every few characters, displaying a new list of potential results for each:
    "P"
    "Par"
    "Paris,"
    "Paris, Fr"
  4. When the user makes a selection:
    • All requests resulting from the query are grouped and added to the session represented by "Token A", as a single request.
    • The user's selection is counted as a Place Detail request, and added to the session represented by "Token A".
  5. The session is concluded, and the app discards "Token A".

For more information about how Autocomplete requests are billed, seeUsage and Billing.

Create session tokens

You can create session tokens using whichever programmatic mechanism youprefer. We recommend using a version 4 UUIDfor session tokens.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-08-23 UTC.

Session Tokens  |  Places API  |  Google for Developers (2024)
Top Articles
Why does my account have a negative balance? | Public FAQ
Delaware Tax Data Explorer
SZA: Weinen und töten und alles dazwischen
Dairy Queen Lobby Hours
Truist Bank Near Here
Methstreams Boxing Stream
Craigslist Portales
Watch Mashle 2nd Season Anime Free on Gogoanime
What is the surrender charge on life insurance?
Caroline Cps.powerschool.com
Herbalism Guide Tbc
Seafood Bucket Cajun Style Seafood Restaurant in South Salt Lake - Restaurant menu and reviews
Oscar Nominated Brings Winning Profile to the Kentucky Turf Cup
Everything You Need to Know About Holly by Stephen King
Craigslist Edmond Oklahoma
Bfg Straap Dead Photo Graphic
Aucklanders brace for gales, hail, cold temperatures, possible blackouts; snow falls in Chch
Jellyfin Ps5
Noaa Ilx
White Pages Corpus Christi
FDA Approves Arcutis’ ZORYVE® (roflumilast) Topical Foam, 0.3% for the Treatment of Seborrheic Dermatitis in Individuals Aged 9 Years and Older - Arcutis Biotherapeutics
Music Go Round Music Store
Shiftselect Carolinas
Naval Academy Baseball Roster
Project Reeducation Gamcore
Naya Padkar Gujarati News Paper
Spiritual Meaning Of Snake Tattoo: Healing And Rebirth!
800-695-2780
Bend Missed Connections
Generator Supercenter Heartland
3 Ways to Format a Computer - wikiHow
Elanco Rebates.com 2022
Wells Fargo Bank Florida Locations
Shaman's Path Puzzle
John F Slater Funeral Home Brentwood
Weather Underground Bonita Springs
Top 25 E-Commerce Companies Using FedEx
Mudfin Village Wow
Despacito Justin Bieber Lyrics
How To Get To Ultra Space Pixelmon
Frequently Asked Questions
Stoughton Commuter Rail Schedule
Suppress Spell Damage Poe
Doelpuntenteller Robert Mühren eindigt op 38: "Afsluiten in stijl toch?"
Wwba Baseball
The Significance Of The Haitian Revolution Was That It Weegy
Turning Obsidian into My Perfect Writing App – The Sweet Setup
Emmi-Sellers
Texas Lottery Daily 4 Winning Numbers
Latest Posts
Article information

Author: Carmelo Roob

Last Updated:

Views: 6426

Rating: 4.4 / 5 (65 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Carmelo Roob

Birthday: 1995-01-09

Address: Apt. 915 481 Sipes Cliff, New Gonzalobury, CO 80176

Phone: +6773780339780

Job: Sales Executive

Hobby: Gaming, Jogging, Rugby, Video gaming, Handball, Ice skating, Web surfing

Introduction: My name is Carmelo Roob, I am a modern, handsome, delightful, comfortable, attractive, vast, good person who loves writing and wants to share my knowledge and understanding with you.