이 제품 또는 기능은 기존 상태입니다. 기존 상태에 대한 자세한 내용은
기존 제품 및 기능을 참고하세요. iOS용 Places API(신규)로 이전하려면
이전 가이드를 참고하세요.
세션 토큰
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Place Autocomplete (기존)는 세션 토큰을 사용하여 사용자 자동 완성 검색의 쿼리 및 선택 단계를 결제 목적의 개별 세션으로 그룹화합니다. 세션은 사용자가 쿼리를 입력하기 시작하면 시작되고 장소를 선택하고 Place Details (기존) 호출이 이루어지면 종료됩니다. 세션마다 여러 개의 자동 완성 쿼리가 포함될 수 있으며 하나의 장소가 선택됩니다. 세션 내 각 요청에 사용되는 API 키는 동일한 Google Cloud 콘솔 프로젝트에 속해야 합니다. 세션이 종료되면 토큰이 더 이상 유효하지 않습니다. 앱에서 각 세션에 대해 새 토큰을 생성해야 합니다. sessiontoken
매개변수가 생략되거나 세션 토큰을 재사용하는 경우 세션 토큰이 제공되지 않은 것처럼 세션에 대해 요금이 청구됩니다 (각 요청에 대해 별도로 요금이 청구됨).
다음 가이드라인이 권장됩니다.
- 모든 자동 완성 세션에 세션 토큰을 사용합니다.
- 각 세션에 대해 새 토큰을 생성합니다.
- 세션 내 모든 장소 자동 완성(기존) 및 장소 세부정보(기존) 요청에 사용된 API 키가 동일한 Google Cloud 콘솔 프로젝트에 속하는지 확인합니다.
- 새 세션마다 고유한 세션 토큰을 전달해야 합니다. 두 개 이상의 세션에 동일한 토큰을 사용하면 각 요청에 대해 개별적으로 요금이 청구됩니다.
원하는 경우 요청에서 자동 완성 세션 토큰을 생략할 수 있습니다. 세션 토큰이 생략되면 각 요청에 대해 별도로 요금이 청구되어 Autocomplete - Per Request SKU가 트리거됩니다. 세션 토큰을 재사용하면 세션이 유효하지 않은 것으로 간주되어 세션 토큰이 제공되지 않은 것처럼 요청에 대해 요금이 청구됩니다.
예
사용자가 검색어를 입력하면 자동 완성 요청이 문자별이 아닌 몇 번의 키 입력마다 호출되고 가능한 결과 목록이 반환됩니다.
사용자가 결과 목록에서 항목을 선택하면 선택사항이 요청으로 집계되고 검색 중에 이루어진 모든 요청이 번들로 묶여 단일 요청으로 집계됩니다. 사용자가 장소를 선택하면 검색어는 무료로 사용할 수 있으며 장소 데이터 요청에 대해서만 요금이 청구됩니다. 사용자가 세션이 시작된 후 몇 분 이내에 선택하지 않으면 검색어 요금만 청구됩니다.
앱의 관점에서 이 이벤트 흐름을 살펴보겠습니다.
- 사용자가 '프랑스 파리'를 검색하기 위해 검색어를 입력하기 시작합니다.
- 사용자 입력을 감지하면 앱은 새 세션 토큰 '토큰 A'를 만듭니다.
- 사용자가 입력할 때마다 API는 몇 개의 문자마다 자동 완성 요청을 실행하여 각 문자에 대해 잠재적인 결과의 새 목록을 표시합니다.
"P"
"Par"
"Paris,"
"Paris, Fr"
- 사용자가 선택하면 다음과 같이 처리됩니다.
- 쿼리에서 발생한 모든 요청은 그룹화되어 '토큰 A'로 표시된 세션에 단일 요청으로 추가됩니다.
- 사용자의 선택사항이 장소 세부정보 요청으로 집계되고 '토큰 A'로 표시된 세션에 추가됩니다.
- 세션이 종료되고 앱에서 '토큰 A'를 삭제합니다.
Place Autocomplete (기존) 요청에 대한 자세한 요금 청구 방식은 사용량 및 결제를 참고하세요.
세션 토큰 만들기
세션 토큰을 만들려면 GMSAutocompleteSessionToken.init()
를 호출합니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-31(UTC)
[null,null,["최종 업데이트: 2025-08-31(UTC)"],[],[],null,["# Session Tokens\n\nSelect 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-------\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/ios-sdk/usage-and-billing).\n\nCreate session tokens\n---------------------\n\n\nTo create a session token, call\n[`GMSAutocompleteSessionToken.init()`](/maps/documentation/places/ios-sdk/reference/interface_g_m_s_autocomplete_session_token)."]]