세션 토큰은 사용자 자동 완성 검색의 쿼리 및 선택 단계를 결제 목적의 개별 세션으로 그룹화합니다.
세션 토큰 만들기
사용자는 각 세션에 대해 고유한 세션 토큰을 생성해야 합니다. Google에서는 버전 4 UUID를 사용하는 것이 좋습니다.
예
사용자가 쿼리를 입력하면 몇 번의 키 입력마다 (문자별이 아님) 자동 완성 요청이 호출되고 가능한 결과 목록이 반환됩니다. 사용자가 결과 목록에서 선택하면 선택이 요청으로 간주되며 검색 중에 이루어진 모든 요청이 번들로 묶여 단일 요청으로 집계됩니다. 사용자가 장소를 선택하면 검색어는 무료로 제공되며 장소 데이터 요청에만 요금이 청구됩니다. 사용자가 세션이 시작된 후 몇 분 이내에 선택하지 않으면 검색어에 대해서만 요금이 청구됩니다.
앱의 관점에서 이 이벤트 흐름을 살펴보겠습니다.
사용자가 '파리, 프랑스'를 검색하기 위해 검색어를 입력하기 시작합니다.
사용자 입력을 감지하면 앱은 새 세션 토큰 '토큰 A'를 만듭니다.
사용자가 입력하면 API는 몇 글자마다 자동 완성 요청을 실행하여 각 글자에 대한 잠재적 결과의 새 목록을 표시합니다.
'P'
'Par'
'Paris'
'Paris, Fr'
사용자가 선택하면 다음이 발생합니다.
쿼리로 인해 발생하는 모든 요청은 그룹화되어 '토큰 A'로 표시되는 세션에 단일 요청으로 추가됩니다.
사용자의 선택은 Place Detail 요청으로 집계되고 '토큰 A'로 표시되는 세션에 추가됩니다.
세션이 종료되고 앱이 '토큰 A'를 삭제합니다.
자동 완성 요청에 대한 요금 청구 방식에 대한 자세한 내용은 사용량 및 결제를 참고하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-31(UTC)"],[[["\u003cp\u003eSession tokens are used to group autocomplete search queries and selections for billing purposes.\u003c/p\u003e\n"],["\u003cp\u003eEach session requires a unique token, ideally a version 4 UUID.\u003c/p\u003e\n"],["\u003cp\u003eAutocomplete requests are bundled and billed as a single request when a user makes a selection.\u003c/p\u003e\n"],["\u003cp\u003eIf no selection is made, only the search query is charged after a few minutes.\u003c/p\u003e\n"],["\u003cp\u003eSession tokens can be shared across different Google Cloud projects, but must be unique within a single project.\u003c/p\u003e\n"]]],["This document details the use of session tokens with the Places API. A session token groups a user's autocomplete search into a single session for billing. Users must create unique session tokens (version 4 UUIDs recommended) for each session, ensuring uniqueness within a project. Requests are bundled into a session. If a user selects a place, only the place details are charged; otherwise, only the search query is charged. Each session ends after a user's selection or inactivity, at which point the token is discarded.\n"],null,["# Use session tokens\n\n\u003cbr /\u003e\n\n| This feature requires that you enable Places API (New), the next generation of the Places API. For more information, see [Enable APIs](/maps/documentation/places/ios-sdk/cloud-setup#enabling-apis).\n\n\u003cbr /\u003e\n\n\nSelect platform: [Android](/maps/documentation/places/android-sdk/using-session-tokens \"View this page for the Android platform docs.\") [iOS](/maps/documentation/places/ios-sdk/using-session-tokens \"View this page for the iOS platform docs.\") [Web Service](/maps/documentation/places/web-service/using-session-tokens \"View this page for the Web Service platform docs.\")\n\n\u003cbr /\u003e\n\nSession tokens group the query and selection phases of a user autocomplete\nsearch into a discrete session for billing purposes.\n\nCreate a session token\n----------------------\n\nUsers are responsible for generating unique session\ntokens for each session. Google recommends using [version 4\nUUIDs](https://tools.ietf.org/html/rfc4122).\n| **Note:** Session tokens can overlap across Google Cloud Console projects, but they must be unique per project. For example, an app using Project A and an app using Project B can use the same session token, but multiple apps using Project A cannot use the same session token.\n\nExample\n-------\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. When\nthe user makes a selection from the result list, the selection counts as a\nrequest, and all of the requests made during the search are bundled and counted\nas a single request. If the user selects a place, the search query is available\nat no charge, and only the Place data request is charged. If the user does not\nmake a selection 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\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\".\n- The session is concluded, and the app discards \"Token A\".\n\nFor more information about how Autocomplete requests are billed, see [Usage and\nBilling](/maps/documentation/places/ios-sdk/usage-and-billing)."]]