자동 완성으로 이전 (신규)
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
소개
Places API는 Place Autocomplete (기존) 및 Query Autocomplete (기존) API를 지원합니다.
이러한 API를 잘 알고 있다면 자동 완성 (신규)에서 다음과 같이 변경됩니다.
- Autocomplete (New)는 HTTP POST 요청을 사용합니다. HTTP POST 요청의 일부로 요청 본문이나 헤더에 매개변수를 전달합니다. 반면 기존 API를 사용하면 HTTP GET 요청을 사용하여 URL 매개변수를 전달합니다.
- Autocomplete (New)는 인증 메커니즘으로 API 키와 OAuth 토큰을 모두 지원합니다.
- Autocomplete (New)에서는 JSON만 응답 형식으로 지원됩니다.
다음 표에는 Autocomplete (신규)에서 이름이 바뀌거나 수정된 Place Autocomplete (기존) 및 Query Autocomplete (기존)의 매개변수 또는 더 이상 지원되지 않는 매개변수가 나와 있습니다.
현재 매개변수 |
새 매개변수 |
참고 |
components |
includedRegionCodes |
|
language |
languageCode |
|
location |
locationBias |
|
ipbias |
|
locationBias 와 locationRestriction 를 모두 생략하면 API에서 기본적으로 IP 바이어싱을 사용합니다. |
offset |
inputOffset |
|
radius |
locationBias 또는 locationRestriction |
|
region |
regionCode |
|
stricbounds |
locationRestriction |
|
sessiontoken |
sessionToken |
|
types |
includedPrimaryTypes |
|
요청 예시
다음 예시 GET 요청은 Place Autocomplete (레거시)를 사용합니다. 이 예에서는 establishment
유형의 'Amoeba'라는 장소에 관한 정보가 포함된 JSON 응답을 요청하고 모든 매개변수를 URL 매개변수로 전달합니다.
curl -L -X GET 'https://maps.googleapis.com/maps/api/place/autocomplete/json?input=amoeba&types=establishment&location=37.76999%2C-122.44696&radius=500&key=YOUR_API_KEY'
자동 완성 (신규)을 사용하면 POST 요청을 하고 JSON 요청 본문 또는 헤더에서 모든 매개변수를 POST 요청의 일부로 전달합니다.
필드 마스크는 Autocomplete (New) 요청에 필요하지 않지만 응답에서 특정 결과를 필터링하는 데 사용할 수 있습니다. 예를 들어 다음 요청은 필드 마스크를 사용하므로 응답에는 추천의 suggestions.placePrediction.text
만 포함됩니다.
curl -X POST -d '{
"input": "Amoeba",
"locationBias": {
"circle": {
"center": {
"latitude": 37.76999,
"longitude": -122.44696
},
"radius": 500.0
}
}
}' \
-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: API_KEY' \
-H 'X-Goog-FieldMask: suggestions.placePrediction.text' \
https://places.googleapis.com/v1/places:autocomplete
필드 마스크 사용에 대해 자세히 알아보려면 장소 세부정보 (신규)를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-29(UTC)
[null,null,["최종 업데이트: 2025-08-29(UTC)"],[],[],null,["# Migrate to Autocomplete (New)\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\nIntroduction\n------------\n\nPlaces API supports the\n[Place Autocomplete (Legacy)](/maps/documentation/places/web-service/autocomplete)\nand [Query Autocomplete (Legacy)](/maps/documentation/places/web-service/query) APIs.\nIf you are familiar with these APIs, Autocomplete (New) makes the following changes:\n\n- Autocomplete (New) uses HTTP POST requests. Pass parameters in the request body or in headers as part of an HTTP POST request. In contrast, with the legacy APIs, you pass URL parameters using an HTTP GET request.\n- Autocomplete (New) supports both [API keys](/maps/documentation/places/web-service/get-api-key) and [OAuth](/maps/documentation/places/web-service/oauth-token) tokens as the authentication mechanism.\n- Only JSON is supported as a response format in Autocomplete (New).\n\nThe following table lists parameters in Place Autocomplete (Legacy) and Query Autocomplete (Legacy) that have been renamed or modified for Autocomplete (New), or parameters that are no longer supported.\n\n| Current parameter | New parameter | Notes |\n|-------------------|-----------------------------------------|-----------------------------------------------------------------------------------------------------|\n| `components` | `includedRegionCodes` | |\n| `language` | `languageCode` | |\n| `location` | `locationBias` | |\n| `ipbias` | | If you omit both `locationBias` and `locationRestriction`, then the API uses IP biasing by default. |\n| `offset` | `inputOffset` | |\n| `radius` | `locationBias` or `locationRestriction` | |\n| `region` | `regionCode` | |\n| `stricbounds` | `locationRestriction` | |\n| `sessiontoken` | `sessionToken` | |\n| `types` | `includedPrimaryTypes` | |\n\nExample request\n---------------\n\nThe following example GET request uses Place Autocomplete (Legacy). In this\nexample, you request a JSON response containing information about places called\n\"Amoeba\" that are of type `establishment` and pass all parameters as URL\nparameters: \n\n```curl\ncurl -L -X GET 'https://maps.googleapis.com/maps/api/place/autocomplete/json?input=amoeba&types=establishment&location=37.76999%2C-122.44696&radius=500&key=YOUR_API_KEY'\n```\n\nWith Autocomplete (New), you make a POST request and pass all parameters\nin the JSON request body or in headers as part of the POST request.\n\nField masks are not required for Autocomplete (New) requests, but they can\nbe used to filter for specific results in the response. For example, the\nfollowing request uses a field mask so the response only includes the\n`suggestions.placePrediction.text` of the suggestion: \n\n```curl\ncurl -X POST -d '{\n \"input\": \"Amoeba\",\n \"locationBias\": {\n \"circle\": {\n \"center\": {\n \"latitude\": 37.76999,\n \"longitude\": -122.44696\n },\n \"radius\": 500.0\n }\n }\n}' \\\n-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: API_KEY' \\\n-H 'X-Goog-FieldMask: suggestions.placePrediction.text' \\\nhttps://places.googleapis.com/v1/places:autocomplete\n```\n\nTo learn more about using field masks, see\n[Place Details (New)](/maps/documentation/places/web-service/place-details#fieldmask)."]]