Session tokens

Session tokens are user-generated strings (or objects) that trackAutocomplete (New)calls assessions. Autocomplete (New) uses session tokens to group the queryand selection phases of a user autocomplete search into a discrete session forbilling purposes.

Users are responsible for creating session tokens for each session. Sessiontokens must be URL- and filename-safe base64 strings. Users can generate sessiontokens in any manner, although Google recommends usingversion 4 universallyunique identifiers (UUIDs) for session tokens.

The session begins with a call to Autocomplete (New), and concludes with a calltoPlace Details (New) orAddress Validation. Each session can havemultiple Autocomplete (New) queries, followed by one request to Place Details(New) or Address Validation. The API key(s) used for each request within asession must belong to the same Google Cloud Console project.

Note: Session tokens cannot be exchanged between Places API (Legacy) endpoints andPlaces API (New) or Address Validation endpoints. For example, aPlace Autocomplete (Legacy) request can be followed by a Place Details (Legacy) request in the samesession, but it cannot be followed by a Place Details (New) request or anAddress Validation request in the same session.

Session tokens terminate in the following ways:

  • Place Details (New) is called.
  • Address Validation is called.
  • The session is abandoned.
Note: You can optionally omit the Autocomplete (New) session token from arequest. If the session token is omitted, each request is billed separately andcharges theSKU: Autocomplete Requests.

Once a session has concluded, the token is no longer valid; your app mustgenerate a fresh token for each new session. If thesessionToken parameter isomitted, or if you reuse a session token, the new session is charged as if nosession token was provided (each request is billed separately).

For more information about how Autocomplete (New) requests are billed, seeAutocomplete (New) and session pricing.

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

Last updated 2025-11-21 UTC.