The Places API (New) accepts requests for place data through a variety of
methods. The Places API (New) response contains data about a place, including
location data and imagery, geographic locations, and prominent points of
interest.

The response from Text Search (New), Nearby Search (New), and
Place Details (New) can also contain links to Google Maps.
Your users can browse to these Google Maps links to see additional
information about a place in the response.

For example, you search for airports in San Francisco, California. The response
then includes San Francisco International Airport (SFO) in the list of places.
The [`Place`](https://developers.google.com/maps/documentation/places/web-service/reference/rest/v1/places.md.txt)
object for SFO in the response adds the `googleMapsUri` field containing
Google Maps links to open Google Maps to the place,
directions to the place, reviews of the place, and place photos.

Along with the links added to the `Place` object, the `googleMapsUri` field is
also added to the
[`Reviews`](https://developers.google.com/maps/documentation/places/web-service/reference/rest/v1/places.md.txt#review)
and
[`Photos`](https://developers.google.com/maps/documentation/places/web-service/reference/rest/v1/places.md.txt#photo)
objects in the response:

- `Reviews.googleMapsUri`: Contains a Google Maps link to the
  review so you can view it in a browser.

  > [!NOTE]
  > **Note:** For a given place, the `ReviewSummary.reviewsUri` field in the [`ReviewSummary`](https://developers.google.com/maps/documentation/places/web-service/reference/rest/v1/places.md.txt#reviewsummary) object contains the same link as the `Reviews.googleMapsUri` field.

- `Photos.googleMapsUri`: Contains a Google Maps link to the photo
  so you can view it in a browser.

The API Explorer lets you make live requests so that you can get familiar with
these new options:

[Try it!](https://developers.google.com/maps/documentation/places/web-service/maps-links.md.txt#try-it)

## Supported Google Maps links for a place

The following table shows the Google Maps links that you can include
in the response:

| Google Maps link | Description | Field name |
|---|---|---|
| Place | Link to open Google Maps to the place. | `googleMapsLinks.placeUri` |
| Directions | Link to open directions to the place in Google Maps. | `googleMapsLinks.directionsUri` |
| Write review | Link to write a review for the place in Google Maps. | `googleMapsLinks.writeAReviewUri` |
| Read reviews | Link to show Google Maps reviews of the place. | `googleMapsLinks.reviewsUri` |
| Photos | Link to show photos of the place in Google Maps. | `googleMapsLinks.photosUri` |

## Include all links in the Places response

The links in the places response are contained in the
[`googleMapsLinks`](https://developers.google.com/maps/documentation/places/web-service/reference/rest/v1/places.md.txt#Place.FIELDS.google_maps_links)
field. Make sure to include the `googleMapsLinks` field in the field mask of the
request if you want them to appear in the response.

For example, the following Text Search (New) includes all Maps links in
the response:

```
curl -X POST -d '{
  "textQuery" : "San Francisco International Airport"
}' \
-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: API_KEY' \
-H 'X-Goog-FieldMask: places.displayName,places.formattedAddress,places.priceLevel,places.googleMapsLinks' \
'https://places.googleapis.com/v1/places:searchText'
```

The response is in the form:

```
{
  "places": [
    {
      "formattedAddress": "San Francisco, CA 94128, USA",
      "displayName": {
        "text": "San Francisco International Airport",
        "languageCode": "en"
      },
      "googleMapsLinks": {
        "placeUri": "https://maps.google.com/?cid=11885663895765773631",
        "directionsUri": "https://www.google.com/maps/dir//''/data=!4m7!4m6!1m1!4e2!1m2!1m1!1s0x808f778c55555555:0xa4f25c571acded3f!3e0",
        "writeAReviewUri": "https://www.google.com/maps/place//data=!4m3!3m2!1s0x808f778c55555555:0xa4f25c571acded3f!12e1",
        "reviewsUri": "https://www.google.com/maps/place//data=!4m4!3m3!1s0x808f778c55555555:0xa4f25c571acded3f!9m1!1b1",
        "photosUri": "https://www.google.com/maps/place//data=!4m3!3m2!1s0x808f778c55555555:0xa4f25c571acded3f!10e5"
      }
    }
  ]
}
```

> [!NOTE]
> **Note:** Previously, the [`Place`](https://developers.google.com/maps/documentation/places/web-service/reference/rest/v1/places.md.txt) object in the response included the `place.googleMapsURI` field containing a Google Maps link to the place. The new `place.googleMapsLinks.placeURI` field in the response contains the same value as `place.googleMapsURI`.

## Include a specific link in the response

You don't have to return all links in the response. For example, if you only
want the photos link in the response, modify the field mask as shown below to
only include the `photosUri` field:

```
curl -X POST -d '{
  "textQuery" : "San Francisco International Airport"
}' \
-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: API_KEY' \
-H 'X-Goog-FieldMask: places.displayName,places.formattedAddress,places.priceLevel,places.googleMapsLinks.photosURI' \
'https://places.googleapis.com/v1/places:searchText'
```

## Include directions in the response

All Places methods support the generation of the directions link in the
response. The current location is used as the origin, the place location is used
as the destination, and the travel mode is drive.

The next example uses Nearby Search (New) to include the maps directions
link in the response in the `directionsUri` field:

```
curl -X POST -d '{
  "includedTypes": ["restaurant"],
  "maxResultCount": 10,
  "locationRestriction": {
    "circle": {
      "center": {
        "latitude": -33.8688,
        "longitude": 151.1957362},
      "radius": 500.0
    }
  }
}' \
-H 'Content-Type: application/json' -H 'X-Goog-Api-Key:API_KEY' \
-H 'X-Goog-FieldMask: places.displayName,places.googleMapsLinks.directionsUri' \
https://places.googleapis.com/v1/places:searchNearby
```

> [!NOTE]
> **Note:** For Text Search (New) and Nearby Search (New), you can use the `routingParameters` request parameter to optionally specify an explicit origin. While that request parameter affects the [routing summaries and search along
> route](https://developers.google.com/maps/documentation/places/web-service/sar-overview) in the response, the Google Maps directions are always calculated from the current location.

## Include reviews and photos links

This release adds the `googleMapsUri` field to the
[`Reviews`](https://developers.google.com/maps/documentation/places/web-service/reference/rest/v1/places.md.txt#review)
and
[`Photos`](https://developers.google.com/maps/documentation/places/web-service/reference/rest/v1/places.md.txt#photo)
objects in the response. Browsing to these links opens the review or photo in
Google Maps.

For example, the following Text Search (New) includes reviews and photos
for each place in the response:

```
curl -X POST -d '{
  "textQuery" : "Spicy Vegetarian Food in Sydney, Australia"
}' \
-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: API_KEY' \
-H 'X-Goog-FieldMask: places.displayName,places.reviews,places.photos' \
'https://places.googleapis.com/v1/places:searchText'
```

In the response, each element of the reviews and photos array contains the
`googleMapsUri` field to open the review or photo in a browser.

## Try it!

The API Explorer lets you make sample requests so that you can get familiar with
the API and the API options.

1. Select the API icon on the right
   side of the page.

2. Optionally expand **Show standard parameters** and set **the `fields`
   parameter** to the [field
   mask](https://developers.google.com/maps/documentation/places/web-service/choose-fields).

3. Optionally edit the **Request body**.

4. Select **Execute** button. In the dialog, choose the account that you want
   to use to make the request.

5. In the API Explorer panel, select

   **Fullscreen** to expand the API Explorer window.

   <br />