주변 검색으로 이전 (신규)
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
소개
Places API는 주변 검색 (기존)을 지원합니다.
Nearby Search (기존)에 익숙한 경우
Nearby Search (신규)에서 다음과 같이 변경됩니다.
- Nearby Search (신규)는 HTTP POST 요청을 사용합니다.
HTTP POST 요청의 일부로 요청 본문 또는 헤더에 매개변수를 전달합니다. 반면 주변 검색 (기존)에서는 HTTP GET 요청을 사용하여 URL 매개변수를 전달합니다.
- 필드 마스킹이 필요합니다. 응답에서 반환할 필드를 지정해야 합니다. 반환된 필드의 기본 목록은 없습니다. 이 목록을 생략하면 메서드에서 오류를 반환합니다. 자세한 내용은 FieldMask를 참고하세요.
- Nearby Search (신규)는 인증 메커니즘으로 API 키와 OAuth 토큰을 모두 지원합니다.
- 인근 검색 (신규)에서는 JSON만 응답 형식으로 지원됩니다.
- 이제 텍스트 쿼리가 포함된 모든 요청은 텍스트 검색 (신규)을 사용해야 합니다. 주변 검색 (신규)은 텍스트 입력을 지원하지 않기 때문입니다.
- Nearby Search (신규)의 JSON 응답 형식이 기존 API의 형식과 달라졌습니다. 자세한 내용은 Places API 응답 이전을 참고하세요.
다음 표에는 Nearby Search (신규)로 이름이 변경되거나 수정된 Nearby Search (기존)의 파라미터 또는 더 이상 지원되지 않는 파라미터가 나와 있습니다.
현재 매개변수 |
새 매개변수 |
참고 |
keyword |
|
지원되지 않음. 대신 텍스트 검색 (신규)을 사용하세요. |
language |
languageCode |
|
location |
locationRestriction |
필수입니다. |
maxprice/minprice |
|
지원되지 않음. |
|
maxResultCount |
새 매개변수입니다. |
opennow |
|
지원되지 않음. |
pagetoken |
|
지원되지 않음. |
radius |
|
지금 locationRestriction 를 사용해 줘. |
rankby |
rankPreference |
|
|
regionCode |
새 매개변수입니다. |
type |
includedTypes
excludedTypes
includedPrimaryTypes
excludedPrimaryTypes
|
새 매개변수는 여러 유형 값도 허용합니다. 기존 API는 단일 값만 허용합니다. |
요청 예시
다음 예시 GET 요청은 Nearby Search (레거시)를 사용합니다. 이 예에서는 restaurant
유형의 장소에 관한 정보가 포함된 JSON 응답을 요청하고 모든 매개변수를 URL 매개변수로 전달합니다.
curl -L -X GET \
'https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=37.7937%2C-122.3965&radius=500&type=restaurant&key=API_KEY'
Nearby Search (New)를 사용하면 POST 요청을 하고 JSON 요청 본문 또는 헤더에서 모든 매개변수를 POST 요청의 일부로 전달합니다.
이 예시에서는 필드 마스크도 사용하므로 응답에는 장소의 표시 이름과 형식이 지정된 주소만 포함됩니다.
curl -X POST -d '{
"includedTypes": ["restaurant"],
"locationRestriction": {
"circle": {
"center": {
"latitude": 37.7937,
"longitude": -122.3965},
"radius": 500.0
}
}
}' \
-H 'Content-Type: application/json' -H "X-Goog-Api-Key: API_KEY" \
-H "X-Goog-FieldMask: places.displayName,places.formattedAddress" \
https://places.googleapis.com/v1/places:searchNearby
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 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 Nearby Search (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\n[Nearby Search (Legacy)](/maps/documentation/places/web-service/search-nearby).\nIf you are familiar with Nearby Search (Legacy), the [Nearby Search (New)](/maps/documentation/places/web-service/nearby-search) makes the following\nchanges:\n\n- Nearby Search (New) uses HTTP POST requests. Pass parameters in the request body or in headers as part of an HTTP POST request. In contrast, with Nearby Search (Legacy), you pass URL parameters using an HTTP GET request.\n- Field masking is required. You must specify which fields you want returned in the response. There is no default list of returned fields. If you omit this list, the methods return an error. For more information, see [FieldMask](/maps/documentation/places/web-service/nearby-search#fieldmask).\n- Nearby Search (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 Nearby Search (New).\n- All requests that include a text query should now use [Text Search (New)](/maps/documentation/places/web-service/text-search) because Nearby Search (New) does not support text input.\n- The JSON response format for Nearby Search (New) has changed from the format of the legacy APIs. For more details, see [Migrate the Places API response](/maps/documentation/places/web-service/migrate-response).\n\nThe following table lists parameters in Nearby Search (Legacy) that have been\nrenamed or modified for Nearby Search (New), or parameters that are no\nlonger supported.\n\n| Current parameter | New parameter | Notes |\n|---------------------|-------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|\n| `keyword` | | Not supported. Use [Text Search (New)](/maps/documentation/places/web-service/text-search) instead. |\n| `language` | `languageCode` | |\n| `location` | `locationRestriction` | Required. |\n| `maxprice/minprice` | | Not supported. |\n| | `maxResultCount` | New parameter. |\n| `opennow` | | Not supported. |\n| `pagetoken` | | Not supported. |\n| `radius` | | Use `locationRestriction` now. |\n| `rankby` | `rankPreference` | |\n| | `regionCode` | New parameter. |\n| `type` | `includedTypes` `excludedTypes` `includedPrimaryTypes` `excludedPrimaryTypes` | The new parameters also accept multiple type values. The legacy API only accepts a single value. |\n\nExample request\n---------------\n\nThe following example GET request uses the Nearby Search (Legacy). In this\nexample, you request a JSON response containing information about places of type\n`restaurant` and pass all parameters as URL parameters: \n\n```curl\ncurl -L -X GET \\\n'https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=37.7937%2C-122.3965&radius=500&type=restaurant&key=API_KEY'\n```\n\nWith Nearby Search (New), you make a POST request and pass all\nparameters in the JSON request body or in headers as part of the POST request.\nThis example also uses a field mask so the response only includes the display\nname and formatted address of the place: \n\n```curl\ncurl -X POST -d '{\n \"includedTypes\": [\"restaurant\"],\n \"locationRestriction\": {\n \"circle\": {\n \"center\": {\n \"latitude\": 37.7937,\n \"longitude\": -122.3965},\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: places.displayName,places.formattedAddress\" \\\nhttps://places.googleapis.com/v1/places:searchNearby\n```"]]