본문 바로가기
개발/API

구글 Place API - Place Search

by dev_caleb 2021. 12. 1.
728x90

https://developers.google.com/maps/documentation/places/web-service/search

 

Place Search

 

The Places API lets you search for place information using a variety of categories, including establishments, prominent points of interest, and geographic locations. You can search for places either by proximity or a text string. A Place Search returns a list of places along with summary information about each place; additional information is available via a Place Details query.

 

The Places API는 설정, 주요 관심장소 및 지리적 위치 등 다양한 카테고리를 사용하여 플레이스 정보를 검색할 수 있도록 해줍니다. 근접한 장소 또는 텍스트 문자열로 플레이스를 검색할 수 있습니다. Places 검색은 플레이스 목록과 각 Places에 대한 요약 정보를 반환합니다. 추가 정보는 플레이스 세부사항 쿼리를 통해 사용할 수 있습니다.

Compare search types(검색 유형 비교)

There are three search endpoints available with different characteristics. The following table highlights some of these differences. 특성이 다른 세가지 검색이 있다.  다음 표에서는 이러한 몇 가지 차이점을 강조합니다.

 

Field selection

There is no way to constrain Nearby Search or Text Search to only return specific fields. To keep from requesting (and paying for) data that you don't need, use a Find Place request instead.

근접 검색 또는 텍스트 검색이 특정 필드만 반환하도록 제한할 수 없습니다. 필요하지 않은 데이터를 요청하거나 비용을 지불하지 않으려면  Find Place 요청을 사용하십시오.

Ambiguous text(모호한 텍스트)

Find Place and Text Search are optimized for matching ambiguous text across a number of fields while Nearby Search is constrained to strict matches on a subset of fields.

Find Place 및 Text Search은 필드 수에 걸쳐 모호한 텍스트를 일치시키는 데 최적화되어 있는 반면 Nearby Search은 필드 하위 집합에서 엄격한 일치로 제한됩니다.

Additional filters(추가적인 필터)

Nearby Search and Text Search allow additional parameters to filter results, (e.g. minprice, maxprice, opennow, and type). 

 

 

Find Place

A Find Place request takes a text input and returns a place. The input can be any kind of Places text data, such as a name, address, or phone number. The request must be a string. A Find Place request using non-string data such as a lat/lng coordinate or plus code generates an error.

A Find Place 요청은 텍스트 입력을 받고 장소를 반환합니다. 입력은 이름, 주소 또는 전화 번호와 같은 모든 종류의 플레이스 텍스트 데이터일 수 있습니다. 요청은 문자열이어야 합니다. lat/lng 좌표 또는 플러스 코드와 같은 문자열이 아닌 데이터를 사용하여 플레이스 찾기 요청은 오류를 생성합니다.

 

A Find Place request returns a subset of the fields that are returned by a Place Details request. For more information on the fields that are unavailable in a Find Place request, see Places API fields support. If the field you want is not returned, you can use Find Place to get a place_id, then use that ID to make a Place Details request.

 

A Find Place request Place Details 요청에 의해 반환된 필드의 하위 집합을 반환합니다. A Find Place request에서 사용할 수 없는 필드에 대한 자세한 내용은 Places API fields support을 참조하십시오. 원하는 필드가 반환되지 않은 경우, Find Place를 사용하여 플레이스_id를 가져온 후 해당 ID를 사용하여 플레이스 Place Details을 요청할 수 있습니다.

 

 

Required parameters

  • input
  • Text input that identifies the search target, such as a name, address, or phone number. The input must be a string. Non-string input such as a lat/lng coordinate or plus code generates an error.
  • 이름, 주소 또는 전화 번호와 같은 검색 대상을 식별하는 텍스트 입력입니다. 입력은 문자열이어야 합니다. lat/lng 좌표 또는 플러스 코드와 같은 문자열이 아닌 입력은 오류를 생성합니다.
  • inputtype
  • The type of input. This can be one of either textquery or phonenumber. Phone numbers must be in international format (prefixed by a plus sign ("+"), followed by the country code, then the phone number itself). See E.164 ITU recommendation for more information.

입력 유형입니다. 텍스트 쿼리 또는 전화번호 중 하나가 될 수 있습니다. 전화 번호는 국가 형식이어야 합니다(더하기 기호("+") 뒤에 국가 코드가 있고 전화 번호 자체). 자세한 내용은 E.164 ITU 권장 사항을 참조하십시오.

 

 

Optional parameters

 

fields

Caution: Place Search requests and Place Details requests do not return the same fields. Place Search requests return a subset of the fields that are returned by Place Details requests. If the field you want is not returned by Place Search, you can use Place Search to get a place_id, then use that Place ID to make a Place Details request. For more information on the fields that are unavailable in a Place Search request, see Places API fields support.

주의: Place Search 요청과 Place Detail은 동일한 필드를 반환하지 않습니다.  Place Search 요청Place Detail에 의해 반환되는 필드의 하위 집합을 반환합니다. 원하는 필드가 Place Search에서 반환되지 않은 경우, Place Search을 사용하여 플레이스_id를 가져온 후 플레이스 ID를 사용하여 Place Detail을 요청할 수 있습니다. Place Search 요청에서 사용할 수 없는 필드에 대한 자세한 내용은 Places API fields support을 참조하십시오.

 

Use the fields parameter to specify a comma-separated list of place data types to return. For example:fields=formatted_address,name,geometry. Use a forward slash when specifying compound values. For example: opening_hours/open_now.

Fields are divided into three billing categories: Basic, Contact, and Atmosphere. Basic fields are billed at base rate, and incur no additional charges. Contact and Atmosphere fields are billed at a higher rate. See the pricing sheet for more information. Attributions, html_attributions, are always returned with every call, regardless of whether the field has been requested.

 

필드 parameter를 사용하여 반환할 플레이스 데이터 유형의 쉼표로 구분된 리스트를 지정합니다. 예:fields=fields_address,name,geometry. 복합한 값을 지정할 때 forward slash를 사용합니다. 예: open_hours/open_now.
필드는 세 가지 청구 범주로 구분됩니다. 기본, 연락처 및 분위기. 기본 필드는 기본 요금으로 청구되며 추가 요금이 발생하지 않습니다. 연락처 및 ㅂ 필드는 더 높은 요율로 청구됩니다. 자세한 내용은 가격표를 참조하십시오.  html_attributions속성은 필드가 요청되었는지 여부에 관계없이 모든 호출과 함께 항상 반환됩니다.

 

Nearby Search

A Nearby Search lets you search for places within a specified area. You can refine your search request by supplying keywords or specifying the type of place you are searching for.

A Nearby Search을 사용하면 지정된 영역 내에서 위치를 검색할 수 있습니다. 키워드를 제공하거나 검색할 place 유형을 지정하여 검색 요청을 구체화할 수 있습니다.

 

Required parameters

  • location
  • The point around which to retrieve place information. This must be specified as latitude,longitude.
  • 장소 정보를 검색할 지점입니다. 이 값은 위도, 경도로 지정해야 합니다.

Optional parameters

  • keyword
  • A term to be matched against all content that Google has indexed for this place, including but not limited to name and type, as well as customer reviews and other third-party content. Note that explicitly including location information using this parameter may conflict with the location, radius, and rankby parameters, causing unexpected results.
  • 이름 및 유형뿐만 아니라 고객 후기 및 기타 타사 콘텐츠를 포함하여 Google이 이 플레이스에 대해 인덱싱한 모든 콘텐츠와 일치시키는 용어입니다. 이 매개 변수를 사용하여 위치 정보를 명시적으로 포함하면 위치, 반지름 및 순위 기준 매개 변수와 충돌하여 예기치 않은 결과를 초래할 수 있습니다.
  • language
    • See the list of supported languages. Google often updates the supported languages, so this list may not be exhaustive.
    • If language is not supplied, the API attempts to use the preferred language as specified in the Accept-Language header.
    • The API does its best to provide a street address that is readable for both the user and locals. To achieve that goal, it returns street addresses in the local language, transliterated to a script readable by the user if necessary, observing the preferred language. All other addresses are returned in the preferred language. Address components are all returned in the same language, which is chosen from the first component.
    • API는 사용자와 지역 주민 모두가 읽을 수 있는 거리 주소를 제공하기 위해 최선을 다한다. 그 목표를 달성하기 위해, 그것은 지역 언어로 된 거리 주소를 반환하고, 필요한 경우 사용자가 읽을 수 있는 스크립트로 번역하여 선호 언어를 관찰한다. 다른 모든 주소는 기본 설정 언어로 반환됩니다. 주소 구성요소는 모두 첫 번째 구성요소에서 선택한 동일한 언어로 반환됩니다.
    • If a name is not available in the preferred language, the API uses the closest match.
    • The preferred language has a small influence on the set of results that the API chooses to return, and the order in which they are returned. The geocoder interprets abbreviations differently depending on language, such as the abbreviations for street types, or synonyms that may be valid in one language but not in another. For example, utca and tér are synonyms for street in Hungarian.
    • 선호 언어는 API가 반환하기로 선택한 결과 집합과 반환 순서에 작은 영향을 미친다. 지오코더는 거리 형태의 약자나 한 언어에서는 유효할 수 있지만 다른 언어에서는 유효하지 않은 동의어와 같이 언어에 따라 약어를 다르게 해석한다. 예를 들어, utca와 tér는 헝가리어로 거리의 동의어이다.
  • The language in which to return results.
  • maxprice
  • Restricts results to only those places within the specified range. Valid values range between 0 (most affordable) to 4 (most expensive), inclusive. The exact amount indicated by a specific value will vary from region to region.
  • minprice
  • Restricts results to only those places within the specified range. Valid values range between 0 (most affordable) to 4 (most expensive), inclusive. The exact amount indicated by a specific value will vary from region to region.
  • name
  • Not Recommended A term to be matched against all content that Google has indexed for this place. Equivalent to keyword. The name field is no longer restricted to place names. Values in this field are combined with values in the keyword field and passed as part of the same search string. We recommend using only the keyword parameter for all search terms.
  • opennow
  • Returns only those places that are open for business at the time the query is sent. Places that do not specify opening hours in the Google Places database will not be returned if you include this parameter in your query.
  • pagetoken
  • Returns up to 20 results from a previously run search. Setting a pagetoken parameter will execute a search with the same parameters used previously — all parameters other than pagetoken will be ignored.
  • radiusThe radius will automatically be clamped to a maximum value depending on the type of search and other parameters.
    • Autocomplete: 50,000 meters
    • Nearby Search:
      • with keyword or name: 50,000 meters
      • without keyword or name
        • rankby=prominence (default): 50,000 meters
        • rankby=distance: A few kilometers depending on density of area
    • Query Autocomplete: 50,000 meters
    • Text Search: 50,000 meters
  • Defines the distance (in meters) within which to return place results. You may bias results to a specified circle by passing a location and a radius parameter. Doing so instructs the Places service to prefer showing results within that circle; results outside of the defined area may still be displayed.
  • rankby
    • prominence (default). This option sorts results based on their importance. Ranking will favor prominent places within the set radius over nearby places that match but that are less prominent. Prominence can be affected by a place's ranking in Google's index, global popularity, and other factors. When prominence is specified, the radius parameter is required.
    • distance. This option biases search results in ascending order by their distance from the specified location. When distance is specified, one or more of keyword, name, or type is required.
  • Specifies the order in which results are listed. Possible values are:
  • type
    • type=hospital|pharmacy|doctor becomes type=hospital
    • type=hospital,pharmacy,doctor is ignored entirely
    See the list of supported types.
  • Note: Adding both `keyword` and `type` with the same value (`keyword=cafe&type=cafe` or `keyword=parking&type=parking`) can yield `ZERO_RESULTS`.
  • Restricts the results to places matching the specified type. Only one type may be specified. If more than one type is provided, all types following the first entry are ignored.

Text Search

A Text Search returns information about a set of places based on a string — for example "pizza in New York" or "shoe stores near Ottawa" or "123 Main Street". The service responds with a list of places matching the text string and any location bias that has been set.

 

텍스트 검색은 "뉴욕의 피자", "오타와 인근의 신발 가게", "123 메인 스트리트"와 같은 문자열을 기준으로 플레이스 집합에 대한 정보를 반환합니다. 텍스트 검색는 텍스트 문자열과 일치하는 플레이스 목록과 설정된 위치 편향으로 응답합니다.The service is especially useful for making ambiguous address queries in an automated system, and non-address components of the string may match businesses as well as addresses. Examples of ambiguous address queries are poorly-formatted addresses or requests that include non-address components such as business names. Requests like the first two examples below may return ZERO_RESULTS unless a location bias - such as Region, Location, or Bounds - is set.

 

 

 

 

 

 

 

 

728x90

'개발 > API' 카테고리의 다른 글

Google map Marker 만들기  (0) 2021.12.21
Material Icon  (0) 2021.12.20
좌표로 주소 찾기  (0) 2021.12.20
내 주변 지역 찾기  (0) 2021.12.20
구글 Place API - Place AutoComplete  (0) 2021.11.28