

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

# Come cercare un luogo, un POI o un'attività commerciale utilizzando un nome
<a name="how-to-search-for-place-poi-business"></a>

L' SearchText API consente agli utenti di cercare un luogo, un POI o un'attività commerciale per nome, utilizzando l'immissione di testo libero. I risultati possono essere perfezionati impostando una posizione di polarizzazione, che può essere basata sulla posizione del dispositivo, sulla posizione IP o sul centro di visualizzazione della mappa. In alternativa, gli utenti possono fornire una città o un luogo specifici, con risultati distorti in base alle coordinate geografiche fornite.

## Casi d'uso potenziali
<a name="potential-use"></a>
+ **Individua un luogo per nome:** recupera le posizioni in base ai nomi dei luoghi, ad esempio «Gas Town».
+ **Trova punti di interesse (POIs):** cerca i luoghi di interesse per nome, ad esempio «Stanley Park».
+ **Ricerca per nome dell'attività:** individua le attività commerciali per nome, ad esempio «Starbucks».

## Esempi
<a name="search-text-examples"></a>

### Ricerca per nome del luogo
<a name="search-by-place-name"></a>

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

```
{
    "QueryText": "Gas Town",
    "BiasPosition": [
        -123.11336,
        49.26038
    ]
}
```

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

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "District",
            "Title": "Gastown, Vancouver, BC, Canada",
            "Address": {
                "Label": "Gastown, Vancouver, BC, Canada",
                "Country": {
                    "Code2": "CA",
                    "Code3": "CAN",
                    "Name": "Canada"
                },
                "Region": {
                    "Code": "BC",
                    "Name": "British Columbia"
                },
                "SubRegion": {
                    "Name": "Metro Vancouver"
                },
                "Locality": "Vancouver",
                "District": "Gastown",
                "PostalCode": "V6B"
            },
            "Position": [
                -123.10647,
                49.28363
            ],
            "Distance": 2633,
            "MapView": [
                -123.11193,
                49.28141,
                -123.10217,
                49.28648
            ]
        }
    ]
}
```

------
#### [ 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 '{
    "QueryText": "Gas Town",
    "BiasPosition": [
        -123.11336,
        49.26038
    ]
}'
```

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

```
aws geo-places search-text --key ${YourKey} --query-text "Gas Town" --bias-position -123.11336 49.26038
```

------

### Ricerca per nome POI
<a name="search-by-poi-name"></a>

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

```
{
    "QueryText": "Stanley Park",
    "BiasPosition": [
        -123.11336,
        49.26038
    ]
}
```

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

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "PointOfInterest",
            "Title": "Stanley Park",
            "Address": {
                "Label": "Stanley Park, Stanley Park Dr, Vancouver, BC V6G, Canada",
                "Country": {
                    "Code2": "CA",
                    "Code3": "CAN",
                    "Name": "Canada"
                },
                "Region": {
                    "Code": "BC",
                    "Name": "British Columbia"
                },
                "SubRegion": {
                    "Name": "Metro Vancouver"
                },
                "Locality": "Vancouver",
                "District": "Stanley Park",
                "PostalCode": "V6G",
                "Street": "Stanley Park Dr",
                "StreetComponents": [
                    {
                        "BaseName": "Stanley Park",
                        "Type": "Dr",
                        "TypePlacement": "AfterBaseName",
                        "TypeSeparator": " ",
                        "Language": "en"
                    }
                ]
            },
            "Position": [
                -123.13593,
                49.29716
            ],
            "Distance": 4405,
            "Categories": [
                {
                    "Id": "park-recreation_area",
                    "Name": "Park-Recreation Area",
                    "LocalizedName": "Park-Recreation Area",
                    "Primary": true
                },
                {
                    "Id": "tourist_attraction",
                    "Name": "Tourist Attraction",
                    "LocalizedName": "Tourist Attraction",
                    "Primary": false
                }
            ]
        }
    ]
}
```

------
#### [ 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 '{
    "QueryText": "Stanley Park",
    "BiasPosition": [
        -123.11336,
        49.26038
    ]
}'
```

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

```
aws geo-places search-text --key ${YourKey} --query-text "Stanley Park" --bias-position -123.11336 49.26038
```

------

### Ricerca per nome dell'azienda
<a name="search-by-business-name"></a>

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

```
{
    "QueryText": "Amazon YVR11",
    "BiasPosition": [
        -123.11336,
        49.26038
    ]
}
```

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

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "PointOfInterest",
            "Title": "Amazon YVR11",
            "Address": {
                "Label": "Amazon YVR11, 510 W Georgia St, Vancouver, BC V6B 0M3, Canada",
                "Country": {
                    "Code2": "CA",
                    "Code3": "CAN",
                    "Name": "Canada"
                },
                "Region": {
                    "Code": "BC",
                    "Name": "British Columbia"
                },
                "SubRegion": {
                    "Name": "Metro Vancouver"
                },
                "Locality": "Vancouver",
                "District": "Downtown Vancouver",
                "PostalCode": "V6B 0M3",
                "Street": "W Georgia St",
                "StreetComponents": [
                    {
                        "BaseName": "Georgia",
                        "Type": "St",
                        "TypePlacement": "AfterBaseName",
                        "TypeSeparator": " ",
                        "Prefix": "W",
                        "Language": "en"
                    }
                ],
                "AddressNumber": "510"
            },
            "Position": [
                -123.11694,
                49.28126
            ],
            "Distance": 2336,
            "Categories": [
                {
                    "Id": "business_facility",
                    "Name": "Business Facility",
                    "LocalizedName": "Business Facility",
                    "Primary": true
                }
            ],
            "AccessPoints": [
                {
                    "Position": [
                        -123.11656,
                        49.28151
                    ]
                }
            ]
        }
    ]
}
```

------
#### [ 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 '{
    "QueryText": "Amazon YVR11",
    "BiasPosition": [
        -123.11336,
        49.26038
    ]
}'
```

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

```
aws geo-places search-text --key ${YourKey} --query-text "Amazon YVR11" --bias-position -123.11336 49.26038
```

------