

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# ビジネスチェーンに基づいて近隣を検索する方法
<a name="how-to-search-nearby-business"></a>

SearchNearby API を使用すると、近隣のビジネスチェーンにクエリを実行できます。検索条件に特定のビジネスチェーンを含めることも除外することもできます。この機能を使用すると、エンドユーザーは近所を調べたり、関心のあるポイントを見つけたりできます。

SearchNearby API を使用するには、QueryPosition を指定する必要があります。
+ デバイスの位置
+ IP ベースの位置
+ マップのビューポート中心

さらに、ユーザーが都市名や場所を指定すると、アプリケーションはその場所の地理座標に基づいて結果にバイアスを掛けることができます。

サポートされるビジネスチェーンの詳細については、「[ビジネスチェーンフィルター](places-filtering.md#business-chains)」を参照してください。

## 想定されるユースケース
<a name="potential-use-search-nearby-business"></a>
+ 近隣でビジネスを検索する
+ 近くの B2B 顧客を検索してビジネスを拡大する

## 例
<a name="search-neaby-business-examples"></a>

### 近くの場所をビジネスチェーンで検索する
<a name="search-nearby-business-example"></a>

次の例は、近くのスターバックスの場所を検索する方法を示しています。

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

このリクエストは、指定された座標に近いスターバックスの場所を検索します。

```
{
    "QueryPosition": [
        12.49563,
        41.90325
    ],
    "Filter" : {
        "IncludeBusinessChains": ["Starbucks"]
    }    
}
```

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

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "PointOfInterest",
            "Title": "Starbucks",
            "Address": {
                "Label": "Starbucks, Via Giovanni Giolitti, 2, 00185 Roma RM, Italia",
                "Country": {
                    "Code2": "IT",
                    "Code3": "ITA",
                    "Name": "Italia"
                },
                "Region": {
                    "Name": "Lazio"
                },
                "SubRegion": {
                    "Code": "RM",
                    "Name": "Roma"
                },
                "Locality": "Roma",
                "District": "Esquilino",
                 "PostalCode": "00185",
                "Street": "Via Giovanni Giolitti",
                "StreetComponents": [
                    {
                        "BaseName": "Giovanni Giolitti",
                        "Type": "Via",
                        "TypePlacement": "BeforeBaseName",
                        "TypeSeparator": " ",
                        "Language": "it"
                    }
                ],
                "AddressNumber": "2"
            },
            "Position": [
                12.50102,
                41.90093
            ],
            "Distance": 515,
            "Categories": [
                {
                    "Id": "coffee_shop",
                    "Name": "Coffee Shop",
                    "LocalizedName": "Bar",
                    "Primary": true
                }
            ],
            "BusinessChains": [
                {
                    "Name": "Starbucks",
                    "Id": "Starbucks"
                }
            ]
        }
    ]
}
```

------
#### [ 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": [
                12.49563,
                41.90325
        ],
        "Filter" : {
        "IncludeBusinessChains": ["Starbucks"]
    }    
}'
```

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

```
aws geo-places search-nearby --key ${YourKey} \
--query-position 12.49563 41.90325 \
--filter '{"IncludeBusinessChains": ["Starbucks"]}'
```

------

## デベロッパー向けのヒント
<a name="search-nearby-business-developer-tips"></a>
+ `ExcludeBusinessChains` を使用すると、特定のビジネスチェーンを結果から除外できます。
+ 複数のビジネスチェーンを除外または含めることができます。