This product or feature is in Legacy status. For more information about the Legacy status see Legacy products and features. To migrate to the Places API (New), see the Migration guide.
Place Autocomplete (Legacy) uses session tokens to group the query and selection
phases of a user autocomplete search into a discrete session for billing
purposes. The session begins when the user starts typing a query, and concludes
when they select a place and a call to Place Details (Legacy) is made. Each session can
have multiple autocomplete queries, followed by one place selection. The API
key(s) used for each request within a session must belong to the same
Google Cloud console project. Once a session has concluded, the token is no longer
valid; your app must generate a fresh token for each session. If the
sessiontoken parameter is omitted, or if you reuse a session
token, the session is charged as if no session token was provided (each request
is billed separately).
Ensure that the API key(s) used for all Place Autocomplete (Legacy) and Place Details (Legacy)
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. If
the session token is omitted, each request is billed separately, triggering the
Autocomplete - Per Request
SKU. If you reuse a session token, the session is considered invalid and the
requests are charged as if no session token was provided.
Example
As the user types a query, an autocomplete request is called every few
keystrokes (not per-character), and a list of possible results is returned.
When the user makes a selection from the result list, the selection counts as
a request, and all of the requests made during the search are bundled and
counted as a single request. If the user selects a place, the search query is
available at no charge, and only the Place data request is charged. If the user does not make a
selection within a few minutes of the beginning of the session, only the
search query is charged.
Let's examine this flow of events from the perspective of an app.
A user begins typing a query to search for "Paris, France".
Upon detecting user input, the app creates a new session
token, "Token A".
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"
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".
The session is concluded, and the app discards "Token A".
For more information about how Place Autocomplete (Legacy) requests are billed, see
Usage and Billing.
Create session tokens
You can create session tokens using whichever programmatic mechanism you
prefer. We recommend using a version 4 UUID
for session tokens.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-18 UTC."],[],[],null,["Select platform: [Android](/maps/documentation/places/android-sdk/session-tokens \"View this page for the Android platform docs.\") [iOS](/maps/documentation/places/ios-sdk/session-tokens \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/places-autocomplete#session_tokens \"View this page for the JavaScript platform docs.\") [Web Service](/maps/documentation/places/web-service/session-tokens \"View this page for the Web Service platform docs.\")\n\nPlace Autocomplete (Legacy) uses session tokens to group the query and selection\nphases of a user autocomplete search into a discrete session for billing\npurposes. The session begins when the user starts typing a query, and concludes\nwhen they select a place and a call to Place Details (Legacy) is made. Each session can\nhave multiple autocomplete queries, followed by one place selection. The API\nkey(s) used for each request within a session must belong to the same\nGoogle Cloud console project. Once a session has concluded, the token is no longer\nvalid; your app must generate a fresh token for each session. If the\n`sessiontoken` parameter is omitted, or if you reuse a session\ntoken, the session is charged as if no session token was provided (each request\nis billed separately).\n\nWe recommend the following guidelines:\n\n- Use session tokens for all autocomplete sessions.\n- [Generate a fresh token](#create-session-tokens) for each session.\n- Ensure that the API key(s) used for all Place Autocomplete (Legacy) and Place Details (Legacy) requests within a session belong to the same Google Cloud console project.\n- 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.\n\nYou can optionally omit the autocomplete session token from a request. If\nthe session token is omitted, each request is billed separately, triggering the\n\n[Autocomplete - Per Request](/maps/billing-and-pricing/sku-details#autocomplete-request-new-ess-sku)\n\n\nSKU. If you reuse a session token, the session is considered invalid and the\nrequests are charged as if no session token was provided.\n\nExample\n\nAs the user types a query, an autocomplete request is called every few\nkeystrokes (not per-character), and a list of possible results is returned.\nWhen the user makes a selection from the result list, the selection counts as\na request, and all of the requests made during the search are bundled and\ncounted as a single request. If the user selects a place, the search query is\navailable at no charge, and only the Place data request is charged. If the user does not make a\nselection within a few minutes of the beginning of the session, only the\nsearch query is charged.\n\nLet's examine this flow of events from the perspective of an app.\n\n1. A user begins typing a query to search for \"Paris, France\".\n2. Upon detecting user input, the app creates a new session token, \"Token A\".\n3. As the user types, the API makes an autocomplete request every few characters, displaying a new list of potential results for each: \n \"P\" \n \"Par\" \n \"Paris,\" \n \"Paris, Fr\" \n4. When the user makes a selection:\n - All requests resulting from the query are grouped and added to the session represented by \"Token A\", as a single request.\n - The user's selection is counted as a Place Detail request, and added to the session represented by \"Token A\".\n5. The session is concluded, and the app discards \"Token A\".\n\nFor more information about how Place Autocomplete (Legacy) requests are billed, see\n\n[Usage and Billing](/maps/documentation/places/web-service/usage-and-billing#about-autocomplete-sessions).\n\nCreate session tokens\n\n\nYou can create session tokens using whichever programmatic mechanism you\nprefer. We recommend using a [version 4 UUID](https://tools.ietf.org/html/rfc4122)\nfor session tokens."]]