

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 국가 내에서 인근을 검색하는 방법
<a name="how-to-search-nearby-country"></a>

SearchNearby API를 사용하면 특정 국가 내에서 가까운 장소를 검색할 수 있습니다. API를 사용하려면 다음과 같은 QueryPosition을 제공해야 합니다.
+ 디바이스 위치
+ IP 기반 위치
+ 맵의 뷰포트 중심

또는 사용자가 도시 이름이나 장소를 제공할 수 있으며 애플리케이션은 해당 위치의 지리 좌표에 따라 결과를 편향시킬 수 있습니다.

## 가능한 사용 사례
<a name="potential-use-search-nearby-country"></a>
+ 국가 내에서 사업체 탐색
+ 국가 내에서 가까운 B2B 고객 찾기
+ 국가 내 관광지 탐색

## 예제
<a name="search-neaby-country-examples"></a>

### 캐나다에서 골프 코스 검색
<a name="search-nearby-country-example"></a>

다음 예제는 캐나다 내에서 지정된 좌표에 가까운 골프 코스를 검색하는 방법을 보여줍니다.

------
#### [ Sample request ]

이 요청은 캐나다에서 지정된 위치 근처의 골프 코스를 검색합니다.

```
{
    "QueryPosition": [
            -122.741803, 
            49.002478
    ],
    "Filter" : {
        "IncludeCategories": ["golf_course"],
        "IncludeCountries": ["CAN"]
    }
}
```

------
#### [ Sample response ]

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "PointOfInterest",
            "Title": "Peace Portal Golf Course",
            "Address": {
                "Label": "Peace Portal Golf Course, 16900 * Ave, Surrey, BC V*Z *P*, Canada",
                "Country": {
                    "Code2": "CA",
                    "Code3": "CAN",
                    "Name": "Canada"
                },
                "Region": {
                    "Code": "BC",
                    "Name": "British Columbia"
                },
                "SubRegion": {
                    "Name": "Metro Vancouver"
                },
                "Locality": "Surrey",
                "District": "South Surrey",
                "PostalCode": "V*Z *P*",
                "Street": "* Ave",
                "StreetComponents": [
                    {
                        "BaseName": "4",
                        "Type": "Ave",
                        "TypePlacement": "AfterBaseName",
                        "TypeSeparator": " ",
                        "Language": "en"
                    }
                ],
                "AddressNumber": "16900"
            },
            "Position": [
                -122.75086,
                49.00921
            ],
            "Distance": 998,
            "Categories": [
                {
                    "Id": "golf_course",
                    "Name": "Golf Course",
                    "LocalizedName": "Golf Course",
                    "Primary": true
                }
            ],
            "Contacts": {
                "Phones": [
                    {
                        "Value": "+16045384818"                    }
                ],
                "Websites": [
                    {
                        "Value": "http://www.peaceportalgolf.com"
                    }
                ]
            },
            "AccessPoints": [
                {
                    "Position": [
                        -122.75087,
                        49.00935
                    ]
                }
            ]
        }
    ]
}
```

------
#### [ cURL ]

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-nearby?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
    "QueryPosition": [
         -122.741803, 
         49.002478
        ],
        "Filter" : {
        "IncludeCategories": ["golf_course"],
              "IncludeCountries": ["CAN"]
    }
    
}'
```

------
#### [ AWS CLI ]

```
aws geo-places search-nearby --key ${YourKey} \
--query-position -122.741803 49.002478 \
--filter '{"IncludeCategories": ["golf_course"], "IncludeCountries": ["CAN"]}'
```

------