

# How to use Suggest
<a name="suggest-how-to"></a>

This section contains a variety of how-to guides and examples for using the `Suggest` API with response data.

**Topics**
+ [How to predict suggestions based on input](how-to-predict-suggestions.md)
+ [How to get results for a partially typed or misspelled query](how-to-get-results-for-partial-or-misspelled-queries.md)
+ [Choose a route using Suggest and the ability to highlight matched query terms](suggest-highlight-matched-query-terms.md)
+ [Use Suggest and the ability to filter for a region or country](suggest-filter-region-country.md)
+ [How to help users disambiguate between similar results](suggest-disambiguate-results.md)

# How to predict suggestions based on input
<a name="how-to-predict-suggestions"></a>

The Suggest API enables applications to complete user queries for places or categories of results. These suggestions can be used directly or refined further with the SearchText API to retrieve additional details and results.

## Potential use cases
<a name="potential-use"></a>
+ **Restaurant or park lookup:** Locate restaurants, parks, or other places near a specific position.

## Examples
<a name="suggest-api-examples"></a>

### Look up restaurants near a position
<a name="lookup-restaurants"></a>

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

```
{
  "QueryText": "restaura",
  "BiasPosition": [-124.81035775620968, 49.234628873773985],
  "AdditionalFeatures": ["Core"]
}
```

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

```
{
    "ResultItems": [
        {
            "Title": "Restaurant",
            "SuggestResultItemType": "Query",
            "Query": {
                "QueryId": "AQAAAHgAw1x7...",
                "QueryType": "Category"
            },
            "Highlights": {
                "Title": [
                    {
                        "StartIndex": 0,
                        "EndIndex": 8,
                        "Value": "Restaura"
                    }
                ]
            }
        }
    ],
    "QueryRefinements": []
}
```

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

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
  "QueryText": "restaura",
  "BiasPosition": [-124.81035775620968, 49.234628873773985],
  "AdditionalFeatures": ["Core"]
}'
```

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

```
aws geo-places suggest --key ${YourKey} \
--query-text "restaura" \
--bias-position -124.81035775620968 49.234628873773985 \
--additional-features "Core"
```

------

### Look up locations of a chain near a position
<a name="lookup-chain-locations"></a>

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

```
{
  "QueryText": "Domin",
  "BiasPosition": [-124.81035775620968, 49.234628873773985],
  "AdditionalFeatures": ["Core"]
}
```

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

```
{
    "ResultItems": [
        {
            "Title": "Domino's",
            "SuggestResultItemType": "Query",
            "Query": {
                "QueryId": "AQAAAHUA4UNp...",
                "QueryType": "BusinessChain"
            },
            "Highlights": {
                "Title": [
                    {
                        "StartIndex": 0,
                        "EndIndex": 5,
                        "Value": "Domin"
                    }
                ]
            }
        }
    ],
    "QueryRefinements": []
}
```

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

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
  "QueryText": "Domin",
  "BiasPosition": [-124.81035775620968, 49.234628873773985],
  "AdditionalFeatures": ["Core"]
}'
```

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

```
aws geo-places suggest --key ${YourKey} \
--query-text "Domin" \
--bias-position -124.81035775620968 49.234628873773985 \
--additional-features "Core"
```

------

### Complete a query using a QueryId
<a name="complete-query-queryid"></a>

------
#### [ Sample request (SearchText) ]

```
{
  "QueryId": "<QueryId from Suggest API>",
  "AdditionalFeatures": ["Core"]
}
```

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

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "PointOfInterest",
            "Title": "Domino's",
            "Address": {
                "Label": "Domino's, 233 Shelly Rd, Parksville, BC V9P, Canada",
                "Country": {
                    "Code2": "CA",
                    "Code3": "CAN",
                    "Name": "Canada"
                },
                "Region": {
                    "Code": "BC",
                    "Name": "British Columbia"
                },
                "SubRegion": {
                    "Name": "Nanaimo"
                },
                "Locality": "Parksville",
                "PostalCode": "V9P",
                "Street": "Shelly Rd",
                "StreetComponents": [
                    {
                        "BaseName": "Shelly",
                        "Type": "Rd",
                        "TypePlacement": "AfterBaseName",
                        "TypeSeparator": " ",
                        "Language": "en"
                    }
                ],
                "AddressNumber": "233"
            },
            "Position": [
                -124.29334,
                49.31669
            ],
            "Distance": 38602,
            "Categories": [
                {
                    "Id": "fast_food",
                    "Name": "Fast Food",
                    "LocalizedName": "Fast Food",
                    "Primary": true
                },
                {
                    "Id": "take_out_and_delivery_only",
                    "Name": "Take Out and Delivery Only",
                    "LocalizedName": "Take Out & Delivery Only",
                    "Primary": false
                }
            ],
            "FoodTypes": [
                {
                    "LocalizedName": "Pizza",
                    "Id": "pizza",
                    "Primary": true
                }
            ],
            "BusinessChains": [
                {
                    "Name": "Domino's",
                    "Id": "Domino's"
                }
            ],
            "Contacts": {
                "Phones": [
                    {
                        "Value": "+12502489296"
                    }
                ],
                "Websites": [
                    {
                        "Value": "http://pizza.dominos.ca/Parksville-British-Columbia-10039"
                    }
                ]
            },
            "OpeningHours": [
                {
                    "Display": [
                        "Mon-Fri: 11:00 - 24:00",
                        "Sat, Sun: 00:00 - 01:00, 11:00 - 24:00"
                    ],
                    "OpenNow": true,
                    "Components": [
                        {
                            "OpenTime": "T110000",
                            "OpenDuration": "PT13H00M",
                            "Recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,SU"
                        },
                        {
                            "OpenTime": "T110000",
                            "OpenDuration": "PT14H00M",
                            "Recurrence": "FREQ:DAILY;BYDAY:FR,SA"
                        }
                    ]
                }
            ],
            "AccessPoints": [
                {
                    "Position": [
                        -124.29319,
                        49.31669
                    ]
                }
            ]
        },
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "PointOfInterest",
            "Title": "Domino's",
            "Address": {
                "Label": "Domino's, 215 Port Augusta St, Comox, BC V9M, Canada",
                "Country": {
                    "Code2": "CA",
                    "Code3": "CAN",
                    "Name": "Canada"
                },
                "Region": {
                    "Code": "BC",
                    "Name": "British Columbia"
                },
                "SubRegion": {
                    "Name": "Comox Valley"
                },
                "Locality": "Comox",
                "PostalCode": "V9M",
                "Street": "Port Augusta St",
                "StreetComponents": [
                    {
                        "BaseName": "Port Augusta",
                        "Type": "St",
                        "TypePlacement": "AfterBaseName",
                        "TypeSeparator": " ",
                        "Language": "en"
                    }
                ],
                "AddressNumber": "215"
            },
            "Position": [
                -124.92492,
                49.67378
            ],
            "Distance": 49528,
            "Categories": [
                {
                    "Id": "fast_food",
                    "Name": "Fast Food",
                    "LocalizedName": "Fast Food",
                    "Primary": true
                },
                {
                    "Id": "take_out_and_delivery_only",
                    "Name": "Take Out and Delivery Only",
                    "LocalizedName": "Take Out & Delivery Only",
                    "Primary": false
                }
            ],
            "FoodTypes": [
                {
                    "LocalizedName": "Pizza",
                    "Id": "pizza",
                    "Primary": true
                }
            ],
            "BusinessChains": [
                {
                    "Name": "Domino's",
                    "Id": "Domino's"
                }
            ],
            "Contacts": {
                "Phones": [
                    {
                        "Value": "+17784310222"
                    }
                ],
                "Websites": [
                    {
                        "Value": "http://pizza.dominos.ca/comox-british-columbia-39035"
                    }
                ]
            },
            "OpeningHours": [
                {
                    "Display": [
                        "Mon-Thu: 10:30 - 23:00",
                        "Fri: 10:30 - 24:00",
                        "Sat: 00:00 - 01:00, 10:30 - 24:00",
                        "Sun: 00:00 - 01:00, 10:30 - 23:00"
                    ],
                    "OpenNow": true,
                    "Components": [
                        {
                            "OpenTime": "T103000",
                            "OpenDuration": "PT12H30M",
                            "Recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,SU"
                        },
                        {
                            "OpenTime": "T103000",
                            "OpenDuration": "PT14H30M",
                            "Recurrence": "FREQ:DAILY;BYDAY:FR,SA"
                        }
                    ]
                }
            ],
            "AccessPoints": [
                {
                    "Position": [
                        -124.92518,
                        49.67387
                    ]
                }
            ]
        },
        ...
    ],
    "QueryRefinements": []
}
```

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

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
  "QueryId": "<QueryId from Suggest API>",
  "AdditionalFeatures": ["Core"]
}'
```

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

```
aws geo-places suggest --key ${YourKey} \
--query-id "<QueryId from Suggest API>" \
--additional-features "Core"
```

------

## Developer tips
<a name="developer-tips"></a>

Use filters such as `Filter.IncludeCountries` or `Filter.BoundingBox` with `BiasPosition`. These filters apply to subsequent queries using the `QueryId`. 

```
{
  "QueryText": "Domin",
  "BiasPosition": [-124.81035775620968, 49.234628873773985],
  "Filter": {
    "IncludeCountries": ["CAN"]
  }
}
```

# How to get results for a partially typed or misspelled query
<a name="how-to-get-results-for-partial-or-misspelled-queries"></a>

The Suggest API enables applications to complete user queries for places or categories of results. These results are sorted from most likely to less-likely matches, allowing the API to resolve incomplete or misspelled words.

## Potential use cases
<a name="potential-use"></a>
+ **Complete a partially typed point of interest query:** Assists users by providing suggestions based on partially typed or incorrect entries.

## Examples
<a name="suggest-api-examples"></a>

### Look up a misspelled point of interest
<a name="misspelled-point-of-interest"></a>

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

```
{
  "QueryText": "Effel tow",
  "Filter": {
    "Circle": {
      "Radius": 10000,
      "Center": [2.3431932014695382, 48.858844492141145]
    },
    "IncludeCountries": ["FRA"]
  },
  "AdditionalFeatures": ["Core"]
}
```

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

```
{
    "ResultItems": [
        {
            "Title": "Tour Eiffel (Eiffel Tower)",
            "SuggestResultItemType": "Place",
            "Place": {
                "PlaceId": "<Redacted>",
                "PlaceType": "PointOfInterest",
                "Address": {
                    "Label": "Tour Eiffel, 5 Avenue Anatole France, 75007 Paris, France",
                    "Country": {"Code2": "FR", "Code3": "FRA", "Name": "France"},
                    "Region": {"Code": "IDF", "Name": "Île-de-France"},
                    "SubRegion": {"Name": "Paris"},
                    "Locality": "Paris",
                    "District": "7e Arrondissement",
                    "PostalCode": "75007",
                    "Street": "Avenue Anatole France",
                    "StreetComponents": [{"BaseName": "Anatole France", "Type": "Avenue", "Language": "fr"}],
                    "AddressNumber": "5"
                },
                "Position": [2.2945, 48.85824],
                "Distance": 3563,
                "Categories": [
                    {"Id": "historical_monument", "Name": "Historical Monument", "LocalizedName": "Monument historique", "Primary": true},
                    {"Id": "landmark-attraction", "Name": "Landmark-Attraction", "LocalizedName": "Lieu d'intérêt/Attraction", "Primary": false},
                    {"Id": "tourist_attraction", "Name": "Tourist Attraction", "LocalizedName": "Attraction touristique", "Primary": false},
                    {"Id": "sports_complex-stadium", "Name": "Sports Complex-Stadium", "LocalizedName": "Stade ou complexe sportif", "Primary": false}
                ]
            },
            "Highlights": {"Title": [{"StartIndex": 13, "EndIndex": 23, "Value": "Eiffel Tow"}]}
        }
    ],
    "QueryRefinements": []
}
```

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

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
  "QueryText": "Effel tow",
  "Filter": {
    "Circle": {"Radius": 10000, "Center": [2.3431932014695382, 48.858844492141145]},
    "IncludeCountries": ["FRA"]
  },
  "AdditionalFeatures": ["Core"]
}'
```

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

```
aws geo-places suggest --key ${YourKey} \
--query-text "Effel tow" \
--filter '{"Circle": {"Radius": 1000, "Center": [2.3431932014695382, 48.858844492141145]}, "IncludeCountries": ["FRA"]}' \
--additional-features "Core"
```

------

## Developer tips
<a name="developer-tips"></a>

Use filters such as `Filter.IncludeCountries` or `Filter.BoundingBox` with `BiasPosition`. These filters can help narrow down possible results and improve accuracy.

```
{
  "QueryText": "Effel tow",
  "BiasPosition": [2.2982750966095398, 48.856078089325294],
  "Filter": {"IncludeCountries": ["FRA"]}
}
```

# Choose a route using Suggest and the ability to highlight matched query terms
<a name="suggest-highlight-matched-query-terms"></a>

With the Suggest API, you get real-time autocomplete suggestions as users type their search queries for places or categories. Results are ranked by relevance, with the most likely matches appearing first. The API response includes highlighting information that shows how each suggestion matches the user's query.

## Potential use cases
<a name="suggest-disambiguate-results-potential-use"></a>

Use highlighting to show users which parts of each suggestion match their input, making it easier to quickly select the desired result.

## Examples
<a name="suggest-hightlight-results-examples"></a>

When displaying the result list to users, the **Highlights** fields in the response can be used to help the user identify how the input has been matched to the results. In the example below, the user makes a query for “Effel tow”. This matches a result with the **Title** “Tour Eiffel (Eiffel Tower)”. Using the Highlights result field, the result can be styled to show where the input query was matched to the output, resulting in the text being showed to the user as “Tour Eiffel (**Eiffel Tow**er).”

### Highlight the query results with the Suggest API
<a name="suggest-hightlight-example"></a>

This example demonstrates how to use the Suggest API to look up a misspelled point of interest.

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

```
{
  "QueryText": "Effel tow",
  "Filter": {
    "Circle": {
      "Radius": 10000,
      "Center": [
        2.3431932014695382, 48.858844492141145
      ]
    },
    "IncludeCountries": [
      "FRA"
    ]
  },
  "AdditionalFeatures": [
    "Core"
  ]
}
```

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

```
{
    "ResultItems": [
        {
            "Title": "Tour Eiffel (Eiffel Tower)",
            "SuggestResultItemType": "Place",
            "Place": {
                "PlaceId": "<Redacted>",
                "PlaceType": "PointOfInterest",
                "Address": {
                    "Label": "Tour Eiffel, * Avenue Anatole France, ***** Paris, France",
                    "Country": {
                        "Code2": "FR",
                        "Code3": "FRA",
                        "Name": "France"
                    },
                    "Region": {
                        "Code": "IDF",
                        "Name": "Île-de-France"
                    },
                    "SubRegion": {
                        "Name": "Paris"
                    },
                    "Locality": "Paris",
                    "District": "*e Arrondissement",
                    "PostalCode": "*****",
                    "Street": "Avenue Anatole France",
                    "StreetComponents": [
                        {
                            "BaseName": "Anatole France",
                            "Type": "Avenue",
                            "TypePlacement": "BeforeBaseName",
                            "TypeSeparator": " ",
                            "Language": "fr"
                        }
                    ],
                    "AddressNumber": "5"
                },
                "Position": [
                    2.2945,
                    48.85824
                ],
                "Distance": 3563,
                "Categories": [
                    {
                        "Id": "historical_monument",
                        "Name": "Historical Monument",
                        "LocalizedName": "Monument historique",
                        "Primary": true
                    },
                    {
                        "Id": "landmark-attraction",
                        "Name": "Landmark-Attraction",
                        "LocalizedName": "Lieu d'intérêt/Attraction",
                        "Primary": false
                    },
                    {
                        "Id": "tourist_attraction",
                        "Name": "Tourist Attraction",
                        "LocalizedName": "Attraction touristique",
                        "Primary": false
                    },
                    {
                        "Id": "sports_complex-stadium",
                        "Name": "Sports Complex-Stadium",
                        "LocalizedName": "Stade ou complexe sportif",
                        "Primary": false
                    }
                ]
            },
            "Highlights": {
                "Title": [
                    {
                        "StartIndex": 13,
                        "EndIndex": 23,
                        "Value": "Eiffel Tow"
                    }
                ],
                "Address": {}
            }
        }
    ],
    "QueryRefinements": []
}
```

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

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
  "QueryText": "Effel tow",
  "Filter": {
    "Circle": {
      "Radius": 10000,
      "Center": [
        2.3431932014695382, 48.858844492141145
      ]
    },
    "IncludeCountries": [
      "FRA"
    ]
  },
  "AdditionalFeatures": [
    "Core"
  ]
}'
```

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

```
aws geo-places suggest --key ${YourKey} \
--query-text "Effel tow" \
--filter '{"Circle": {"Radius": 10000, "Center": [2.3431932014695382, 48.858844492141145]}, "IncludeCountries": ["FRA"]}' \
--additional-features "Core"
```

------

## Developer tips
<a name="suggest-highlight-developer-tips"></a>

Display search results using the `Title` response field to provide users with concise, recognizable entries. For results that might look similar, use the `Place.Address.Label` field to show additional address details that help users distinguish between them. For more information, see [How to help users disambiguate between similar resultsDisambiguate the results with the Suggest API](suggest-disambiguate-results.md).

# Use Suggest and the ability to filter for a region or country
<a name="suggest-filter-region-country"></a>

The Suggest API enables completing queries for places or categories of results. The results are sorted for most likely to less likely matches. Additionally, you can further filter results to specific regions or countries.

## Potential use cases
<a name="suggest-filter-region-country-potential-use"></a>
+ **Filter the results: **When performing a search, you can filter by country or only the region in which your business operates.

## Examples
<a name="suggest-filter-region-country-examples"></a>

Adding a filter by country ensures you only receive the most relevant results. Use Filter.IncludeCountries for this.

### Enable users to filter by country
<a name="suggest-filter-region-country-examples"></a>

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

```
{
  "QueryText": "hote",
  "BiasPosition": [
    2.2982750966095398, 48.856078089325294
  ],
  "Filter": {
    "IncludeCountries": [
      "FRA"
    ]
  },
  "AdditionalFeatures": [
    "Core"
  ]
}
```

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

```
{
    "ResultItems": [
        {
            "Title": "Hôtel de Matignon (Hôtel Matignon)",
            "SuggestResultItemType": "Place",
            "Place": {
                "PlaceId": "Redacted",
                "PlaceType": "PointOfInterest",
                "Address": {
                    "Label": "Hôtel de Matignon, 57 Rue de Varenne, 75007 Paris, France",
                    "Country": {
                        "Code2": "FR",
                        "Code3": "FRA",
                        "Name": "France"
                    },
                    "Region": {
                        "Code": "IDF",
                        "Name": "Île-de-France"
                    },
                    "SubRegion": {
                        "Name": "Paris"
                    },
                    "Locality": "Paris",
                    "District": "7e Arrondissement",
                    "PostalCode": "75007",
                    "Street": "Rue de Varenne",
                    "StreetComponents": [
                        {
                            "BaseName": "Varenne",
                            "Type": "Rue de",
                            "TypePlacement": "BeforeBaseName",
                            "TypeSeparator": " ",
                            "Language": "fr"
                        }
                    ],
                    "AddressNumber": "57"
                },
                "Position": [
                    2.32072,
                    48.85471
                ],
                "Distance": 1650,
                "Categories": [
                    {
                        "Id": "tourist_attraction",
                        "Name": "Tourist Attraction",
                        "LocalizedName": "Attraction touristique",
                        "Primary": true
                    },
                    {
                        "Id": "landmark-attraction",
                        "Name": "Landmark-Attraction",
                        "LocalizedName": "Lieu d'intérêt/Attraction",
                        "Primary": false
                    },
                    {
                        "Id": "historical_monument",
                        "Name": "Historical Monument",
                        "LocalizedName": "Monument historique",
                        "Primary": false
                    },
                    {
                        "Id": "residential_area-building",
                        "Name": "Residential Area-Building",
                        "LocalizedName": "Bâtiment résidentiel",
                        "Primary": false
                    }
                ]
            },
            "Highlights": {
                "Title": [
                    {
                        "StartIndex": 0,
                        "EndIndex": 4,
                        "Value": "Hôt"
                    },
                    {
                        "StartIndex": 19,
                        "EndIndex": 23,
                        "Value": "(Hô"
                    }
                ],
                "Address": {
                    "Label": [
                        {
                            "StartIndex": 0,
                            "EndIndex": 4,
                            "Value": "Hôt"
                        }
                    ]
                }
            }
        },
        ...
        {
            "Title": "Hotel",
            "SuggestResultItemType": "Query",
            "Query": {
                "QueryId": "Redacted",
                "QueryType": "Category"
            },
            "Highlights": {
                "Title": [
                    {
                        "StartIndex": 0,
                        "EndIndex": 4,
                        "Value": "Hote"
                    }
                ]
            }
        },
        ...
    ],
    "QueryRefinements": []
}
```

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

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
  "QueryText": "hote",
  "BiasPosition": [
    2.2982750966095398, 48.856078089325294
  ],
  "Filter": {
    "IncludeCountries": [
      "FRA"
    ]
  },
  "AdditionalFeatures": [
    "Core"
  ]
}'
```

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

```
aws geo-places suggest --key ${YourKey} \
--query-text "hote" \
--bias-position 2.2982750966095398 48.856078089325294 \
--filter '{"IncludeCountries": ["FRA"]}' \
--additional-features "Core"
```

------

Adding a filter-by-region option for a search limits results to only those which fit within the provided region. This is used to limit the scope of the search to the region that concerns your business. The following example shows a misspelled search for Marriott hotels near the Boston area being completed with some hotel results and a follow-up query.

## Enable users to filter by region
<a name="suggest-filter-region-examples"></a>

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

```
{
  "QueryText": "Mariot",
  "Filter": {
    "IncludeCountries": [
      "USA"
    ],
    "BoundingBox": [
      -71.15693983012913,42.261623506672635,
      -70.97249727163558,42.37584075627763
    ]
  },
  "AdditionalFeatures": [
    "Core"
  ]
}
```

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

```
{
    "ResultItems": [
        {
            "Title": "Boston Marriott Copley Place",
            "SuggestResultItemType": "Place",
            "Place": {
                "PlaceId": "Redacted",
                "PlaceType": "PointOfInterest",
                "Address": {
                    "Label": "Boston Marriott Copley Place, 110 Huntington Ave, Boston, MA 02116, United States",
                    "Country": {
                        "Code2": "US",
                        "Code3": "USA",
                        "Name": "United States"
                    },
                    "Region": {
                        "Code": "MA",
                        "Name": "Massachusetts"
                    },
                    "SubRegion": {
                        "Name": "Suffolk"
                    },
                    "Locality": "Boston",
                    "District": "Back Bay",
                    "PostalCode": "02116",
                    "Street": "Huntington Ave",
                    "StreetComponents": [
                        {
                            "BaseName": "Huntington",
                            "Type": "Ave",
                            "TypePlacement": "AfterBaseName",
                            "TypeSeparator": " ",
                            "Language": "en"
                        }
                    ],
                    "AddressNumber": "110"
                },
                "Position": [
                    -71.07769,
                    42.34726
                ],
                "Distance": 3347,
                "Categories": [
                    {
                        "Id": "hotel",
                        "Name": "Hotel",
                        "LocalizedName": "Hotel",
                        "Primary": true
                    }
                ],
                "BusinessChains": [
                    {
                        "Name": "Marriott",
                        "Id": "Marriott"
                    }
                ],
                "AccessPoints": [
                    {
                        "Position": [
                            -71.07922,
                            42.34665
                        ]
                    }
                ]
            },
            "Highlights": {
                "Title": [
                    {
                        "StartIndex": 7,
                        "EndIndex": 14,
                        "Value": "Marriot"
                    }
                ],
                "Address": {
                    "Label": [
                        {
                            "StartIndex": 7,
                            "EndIndex": 14,
                            "Value": "Marriot"
                        }
                    ]
                }
            }
        },
        ...
        {
            "Title": "Marriott",
            "SuggestResultItemType": "Query",
            "Query": {
                "QueryId": "Redacted",
                "QueryType": "BusinessChain"
            },
            "Highlights": {
                "Title": [
                    {
                        "StartIndex": 0,
                        "EndIndex": 8,
                        "Value": "Marriott"
                    }
                ]
            }
        },
        ...
    ],
    "QueryRefinements": []
}
```

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

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
  "QueryText": "Mariot",
  "Filter": {
    "IncludeCountries": [
      "USA"
    ],
    "BoundingBox": [
      -71.15693983012913,42.261623506672635,
      -70.97249727163558,42.37584075627763
    ]
  },
  "AdditionalFeatures": [
    "Core"
  ]
}'
```

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

```
aws geo-places suggest --key ${YourKey} \
--query-text "hote" \
--filter '{"IncludeCountries": ["FRA"], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763]}' \
--additional-features "Core"
```

------

## Developer tips
<a name="suggest-filter-region-developer-tips"></a>

Display search results using the `Title` response field to provide users with concise, recognizable entries. For results that might look similar, use the `Place.Address.Label` field to show additional address details that help users distinguish between them. For more information, see [How to help users disambiguate between similar resultsDisambiguate the results with the Suggest API](suggest-disambiguate-results.md).

# How to help users disambiguate between similar results
<a name="suggest-disambiguate-results"></a>

The Suggest API enables you to create queries for places or categories of results. The results are sorted for more likely to less likely matches. Information is provided for each result which helps you quickly identify the correct match, particularly with regard to the Title and Label fields.

## Potential use cases
<a name="suggest-disambiguate-results-potential-use"></a>
+ **Display the result options: **You can select the option that best suits your needs.

## Examples
<a name="suggest-disambiguate-results-examples"></a>

The Title field is usually enough information for you to understand when the result is what was intended. For cases where the title doesn't provide enough information, the Label field is used to add address information context to the result. The Label field can be provided as a second line of information which is de-emphasized from the main text when the results are rendered for you. In the example below, two similar results are provided and the address of the hotel can help you select the one that is more applicable to your needs. Additionally, position is provided so the results can be rendered on a map as an alternate way for you to select between results.

### Disambiguate the results with the Suggest API
<a name="suggest-disambiguate-results-examples"></a>

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

```
{
  "QueryText": "Marriott",
  "Filter": {
    "IncludeCountries": [
      "USA"
    ],
    "BoundingBox": [
      -71.15693983012913,42.261623506672635,
      -70.97249727163558,42.37584075627763
    ]
  },
  "AdditionalFeatures": [
    "Core"
  ]
}
```

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

```
{
    "ResultItems": [
        {
            "Title": "Marriott-Boston Cambridge",
            "SuggestResultItemType": "Place",
            "Place": {
                "PlaceId": "Redacted",
                "PlaceType": "PointOfInterest",
                "Address": {
                    "Label": "Marriott-Boston Cambridge, 50 Broadway, Cambridge, MA 02138-4137, United States",
                    "Country": {
                        "Code2": "US",
                        "Code3": "USA",
                        "Name": "United States"
                    },
                    "Region": {
                        "Code": "MA",
                        "Name": "Massachusetts"
                    },
                    "SubRegion": {
                        "Name": "Middlesex"
                    },
                    "Locality": "Cambridge",
                    "District": "MIT",
                    "PostalCode": "02138-4137",
                    "Street": "Broadway",
                    "StreetComponents": [
                        {
                            "BaseName": "Broadway",
                            "Language": "en"
                        }
                    ],
                    "AddressNumber": "50"
                },
                "Position": [
                    -71.0858,
                    42.36294
                ],
                "Distance": 5212,
            ...
        },
        {
            "Title": "Marriott-Boston Copley Place",
            "SuggestResultItemType": "Place",
            "Place": {
                "PlaceId": "Redacted",
                "PlaceType": "PointOfInterest",
                "Address": {
                    "Label": "Marriott-Boston Copley Place, 110 Huntington Ave, Boston, MA 02116-5706, United States",
                    "Country": {
                        "Code2": "US",
                        "Code3": "USA",
                        "Name": "United States"
                    },
                    "Region": {
                        "Code": "MA",
                        "Name": "Massachusetts"
                    },
                    "SubRegion": {
                        "Name": "Suffolk"
                    },
                    "Locality": "Boston",
                    "District": "Back Bay",
                    "PostalCode": "02116-5706",
                    "Street": "Huntington Ave",
                    "StreetComponents": [
                        {
                            "BaseName": "Huntington",
                            "Type": "Ave",
                            "TypePlacement": "AfterBaseName",
                            "TypeSeparator": " ",
                            "Language": "en"
                        }
                    ],
                    "AddressNumber": "110"
                },
                "Position": [
                    -71.0792,
                    42.34701
                ],
                "Distance": 3362,
            ...
        },
        ...
    ],
    "QueryRefinements": []
}
```

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

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
  "QueryText": "Marriott",
  "Filter": {
    "IncludeCountries": [
      "USA"
    ],
    "BoundingBox": [
      -71.15693983012913,42.261623506672635,
      -70.97249727163558,42.37584075627763
    ]
  },
  "AdditionalFeatures": [
    "Core"
  ]
}'
```

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

```
aws geo-places suggest --key ${YourKey} \
--query-text "Marriott" \
--filter '{"IncludeCountries": ["USA"], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763]}' \
--additional-features "Core"
```

------