텍스트 검색으로 이전 (신규)
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
소개
Places API (기존)는 텍스트 검색 (기존)을 지원합니다. 텍스트 검색 (기존)에 익숙한 경우 텍스트 검색 (신규)에서는 다음과 같은 변경사항이 적용됩니다.
- 텍스트 검색 (신규)은 HTTP POST 요청을 사용합니다. HTTP POST 요청의 일부로 요청 본문이나 헤더에 매개변수를 전달합니다.
반면 텍스트 검색 (기존)에서는 HTTP GET 요청을 사용하여 URL 매개변수를 전달합니다.
- 필드 마스킹이 필요합니다. 응답에서 반환할 필드를 지정해야 합니다. 반환된 필드의 기본 목록은 없습니다. 이 목록을 생략하면 메서드에서 오류를 반환합니다. 자세한 내용은 FieldMask를 참고하세요.
- 텍스트 검색 (신규)은 인증 메커니즘으로 API 키와 OAuth 토큰을 모두 지원합니다.
- 텍스트 검색 (신규)에서는 JSON만 응답 형식으로 지원됩니다.
텍스트 검색 (기존)을 사용하면 쿼리 문자열에서 위도 및 경도 좌표를 지정할 수 있습니다. 예: query=37.4239,-122.0925
이 옵션은 텍스트 검색 (신규)에서 지원되지 않습니다.
역 지오코딩을 사용하여 좌표를 검색하고 주소를 반환하거나 주변 지역 검색 (신규)을 사용하여 특정 위치 주변의 장소를 찾습니다.
- 텍스트 검색 (신규)의 JSON 응답 형식이 기존 API의 형식과 달라졌습니다. 자세한 내용은 Places API 응답 이전을 참고하세요.
다음 표에는 텍스트 검색 (신규)으로 이름이 바뀌거나 수정된 텍스트 검색 (기존)의 매개변수 또는 더 이상 지원되지 않는 매개변수가 나와 있습니다.
현재 매개변수 |
새 매개변수 |
참고 |
|
evOptions |
새 매개변수입니다. |
language |
languageCode |
|
location |
locationBias |
|
maxprice/minprice |
priceLevels |
|
opennow |
openNow |
|
pagetoken |
pageToken |
|
query |
textQuery |
모든 요청에 필요합니다. |
radius |
locationBias |
locationBias 을 정의할 때 반지름을 지정합니다. |
region |
regionCode |
|
type |
includedType |
단일 값만 사용합니다. |
|
strictTypeFiltering |
새 매개변수입니다. |
요청 예시
다음 예시 GET 요청은 텍스트 검색 (레거시)을 사용합니다. 이 예에서는 'Spicy Vegetarian Food in Sydney, Australia'에 관한 정보가 포함된 JSON 응답을 요청하고 모든 매개변수를 URL 매개변수로 전달합니다.
curl -L -X GET \
'https://maps.googleapis.com/maps/api/place/textsearch/json?query=Spicy%20Vegetarian%20Food%20in%20Sydney%20Australia&key=API_KEY
텍스트 검색(신규)을 사용하면 POST 요청을 하고 JSON 요청 본문 또는 헤더에 모든 매개변수를 전달합니다(POST 요청의 일부로). 이 예시에서는 필드 마스크도 사용하므로 응답에는 장소의 표시 이름과 형식화된 주소만 포함됩니다.
curl -X POST -d '{
"textQuery" : "Spicy Vegetarian Food in Sydney, Australia"
}' \
-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:searchText'
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 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 Text 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 (Legacy) supports\n[Text Search (Legacy)](/maps/documentation/places/web-service/legacy/search-text). If you are familiar with\nText Search (Legacy),\n[Text Search (New)](/maps/documentation/places/web-service/text-search)\nmakes the following changes:\n\n- Text 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 Text 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/text-search#fieldmask).\n- Text Search (New) supports both [API keys](/maps/documentation/places/web-service/legacy/get-api-key) and [OAuth](/maps/documentation/places/web-service/legacy/oauth-token) tokens as the authentication mechanism.\n- Only JSON is supported as a response format in Text Search (New).\n- Text Search (Legacy) lets you specify latitude and longitude\n coordinates in the query string. For example: `query=37.4239,-122.0925`.\n That option is not supported in Text Search (New).\n\n Use\n [Reverse Geocoding](/maps/documentation/geocoding/requests-reverse-geocoding)\n to search on coordinates and return an address, or\n [Nearby Search (New)](/maps/documentation/places/web-service/nearby-search)\n to find places around a certain location.\n- The JSON response format for Text 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 Text Search (Legacy) that have been\nrenamed or modified for Text Search (New), or parameters that are no\nlonger supported.\n\n| Current parameter | New parameter | Notes |\n|---------------------|-----------------------|----------------------------------------------------|\n| | `evOptions` | New parameter. |\n| `language` | `languageCode` | |\n| `location` | `locationBias` | |\n| `maxprice/minprice` | `priceLevels` | |\n| `opennow` | `openNow` | |\n| `pagetoken` | `pageToken` | |\n| `query` | `textQuery` | Required in all requests. |\n| `radius` | `locationBias` | Specify the radius when defining a `locationBias`. |\n| `region` | `regionCode` | |\n| `type` | `includedType` | Only takes a single value. |\n| | `strictTypeFiltering` | New parameter. |\n\nExample request\n---------------\n\nThe following example GET request uses Text Search (Legacy). In this example, you\nrequest a JSON response containing information about \"Spicy Vegetarian Food in\nSydney, Australia\" and pass all parameters as URL parameters: \n\n```curl\ncurl -L -X GET \\\n'https://maps.googleapis.com/maps/api/place/textsearch/json?query=Spicy%20Vegetarian%20Food%20in%20Sydney%20Australia&key=API_KEY\n```\n\nWith Text Search (New), you make a POST request and pass all parameters in\nthe JSON request body or in headers as part of the POST request. This example\nalso uses a field mask so the response only includes the display name and\nformatted address of the place: \n\n```\ncurl -X POST -d '{\n \"textQuery\" : \"Spicy Vegetarian Food in Sydney, Australia\"\n}' \\\n-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: API_KEY' \\\n-H 'X-Goog-FieldMask: places.displayName,places.formattedAddress' \\\n'https://places.googleapis.com/v1/places:searchText'\n```"]]