[null,null,["上次更新時間:2025-08-29 (世界標準時間)。"],[[["\u003cp\u003eThe Places API now returns Google Maps links within its responses, allowing users to easily access detailed place information, directions, reviews, and photos directly on Google Maps.\u003c/p\u003e\n"],["\u003cp\u003eThese links are provided in the \u003ccode\u003egoogleMapsLinks\u003c/code\u003e field for places and \u003ccode\u003egoogleMapsUri\u003c/code\u003e for reviews and photos, and developers can control which links are included in the response using field masks.\u003c/p\u003e\n"],["\u003cp\u003eWhile currently in preview and free to use, the feature enables seamless integration with Google Maps for enhanced user experiences, offering direct access to place details, directions, reviews, and photos.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Maps directions links in responses are currently calculated from the user's current location to the place, and links for reviews and photos are only supported on the web version of Google Maps.\u003c/p\u003e\n"]]],["The Places API now includes Google Maps links in its responses for Text Search, Nearby Search, and Place Details. These links, accessible via the `googleMapsLinks` field, allow users to directly view places, directions, reviews, and photos in Google Maps. The `Reviews` and `Photos` objects also include a `googleMapsUri` for individual items. You can customize which links to include by using the field mask in your request. Currently, the feature is in pre-GA Preview with no billing, and some links are only supported on the web version of Google Maps.\n"],null,["# Link to Google Maps\n\nThe Places API (New) accepts requests for place data through a variety of\nmethods. The Places API (New) response contains data about a place, including\nlocation data and imagery, geographic locations, and prominent points of\ninterest.\n\nThe response from Text Search (New), Nearby Search (New), and\nPlace Details (New) can also contain links to Google Maps.\nYour users can browse to these Google Maps links to see additional\ninformation about a place in the response.\n\nFor example, you search for airports in San Francisco, California. The response\nthen includes San Francisco International Airport (SFO) in the list of places.\nThe [`Place`](/maps/documentation/places/web-service/reference/rest/v1/places)\nobject for SFO in the response adds the `googleMapsUri` field containing\nGoogle Maps links to open Google Maps to the place,\ndirections to the place, reviews of the place, and place photos.\n\nAlong with the links added to the `Place` object, the `googleMapsUri` field is\nalso added to the\n[`Reviews`](/maps/documentation/places/web-service/reference/rest/v1/places#review)\nand\n[`Photos`](/maps/documentation/places/web-service/reference/rest/v1/places#photo)\nobjects in the response:\n\n- `Reviews.googleMapsUri`: Contains a Google Maps link to the\n review so you can view it in a browser.\n\n | **Note:** For a given place, the `ReviewSummary.reviewsUri` field in the [`ReviewSummary`](/maps/documentation/places/web-service/reference/rest/v1/places#reviewsummary) object contains the same link as the `Reviews.googleMapsUri` field.\n- `Photos.googleMapsUri`: Contains a Google Maps link to the photo\n so you can view it in a browser.\n\nThe API Explorer lets you make live requests so that you can get familiar with\nthese new options:\n\n[Try it!](#try-it)\n\nSupported Google Maps links for a place\n---------------------------------------\n\nThe following table shows the Google Maps links that you can include\nin the response:\n\n| Google Maps link | Description | Field name |\n|------------------|------------------------------------------------------|-----------------------------------|\n| Place | Link to open Google Maps to the place. | `googleMapsLinks.placeUri` |\n| Directions | Link to open directions to the place in Google Maps. | `googleMapsLinks.directionsUri` |\n| Write review | Link to write a review for the place in Google Maps. | `googleMapsLinks.writeAReviewUri` |\n| Read reviews | Link to show Google Maps reviews of the place. | `googleMapsLinks.reviewsUri` |\n| Photos | Link to show photos of the place in Google Maps. | `googleMapsLinks.photosUri` |\n\n| **Note:** In this release, the links to read or write a review and to view a place photo are only supported on the web version of Google Maps. They are not supported on Google Maps Mobile.\n\nInclude all links in the Places response\n----------------------------------------\n\nThe links in the places response are contained in the\n[`googleMapsLinks`](/maps/documentation/places/web-service/reference/rest/v1/places#Place.FIELDS.google_maps_links)\nfield. Make sure to include the `googleMapsLinks` field in the field mask of the\nrequest if you want them to appear in the response.\n\nFor example, the following Text Search (New) includes all Maps links in\nthe response: \n\n```\ncurl -X POST -d '{\n \"textQuery\" : \"San Francisco International Airport\"\n}' \\\n-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: API_KEY' \\\n-H 'X-Goog-FieldMask: places.displayName,places.formattedAddress,places.priceLevel,places.googleMapsLinks' \\\n'https://places.googleapis.com/v1/places:searchText'\n```\n\nThe response is in the form: \n\n```text\n{\n \"places\": [\n {\n \"formattedAddress\": \"San Francisco, CA 94128, USA\",\n \"displayName\": {\n \"text\": \"San Francisco International Airport\",\n \"languageCode\": \"en\"\n },\n \"googleMapsLinks\": {\n \"placeUri\": \"https://maps.google.com/?cid=11885663895765773631\",\n \"directionsUri\": \"https://www.google.com/maps/dir//''/data=!4m7!4m6!1m1!4e2!1m2!1m1!1s0x808f778c55555555:0xa4f25c571acded3f!3e0\",\n \"writeAReviewUri\": \"https://www.google.com/maps/place//data=!4m3!3m2!1s0x808f778c55555555:0xa4f25c571acded3f!12e1\",\n \"reviewsUri\": \"https://www.google.com/maps/place//data=!4m4!3m3!1s0x808f778c55555555:0xa4f25c571acded3f!9m1!1b1\",\n \"photosUri\": \"https://www.google.com/maps/place//data=!4m3!3m2!1s0x808f778c55555555:0xa4f25c571acded3f!10e5\"\n }\n }\n ]\n}\n```\n| **Note:** Previously, the [`Place`](/maps/documentation/places/web-service/reference/rest/v1/places) 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`.\n\nInclude a specific link in the response\n---------------------------------------\n\nYou don't have to return all links in the response. For example, if you only\nwant the photos link in the response, modify the field mask as shown below to\nonly include the `photosUri` field: \n\n```\ncurl -X POST -d '{\n \"textQuery\" : \"San Francisco International Airport\"\n}' \\\n-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: API_KEY' \\\n-H 'X-Goog-FieldMask: places.displayName,places.formattedAddress,places.priceLevel,places.googleMapsLinks.photosURI' \\\n'https://places.googleapis.com/v1/places:searchText'\n```\n\nInclude directions in the response\n----------------------------------\n\nAll Places methods support the generation of the directions link in the\nresponse. The current location is used as the origin, the place location is used\nas the destination, and the travel mode is drive.\n\nThe next example uses Nearby Search (New) to include the maps directions\nlink in the response in the `directionsUri` field: \n\n```\ncurl -X POST -d '{\n \"includedTypes\": [\"restaurant\"],\n \"maxResultCount\": 10,\n \"locationRestriction\": {\n \"circle\": {\n \"center\": {\n \"latitude\": -33.8688,\n \"longitude\": 151.1957362},\n \"radius\": 500.0\n }\n }\n}' \\\n-H 'Content-Type: application/json' -H 'X-Goog-Api-Key:API_KEY' \\\n-H 'X-Goog-FieldMask: places.displayName,places.googleMapsLinks.directionsUri' \\\nhttps://places.googleapis.com/v1/places:searchNearby\n```\n| **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\n| route](/maps/documentation/places/web-service/sar-overview) in the response, the Google Maps directions are always calculated from the current location.\n\nInclude reviews and photos links\n--------------------------------\n\nThis release adds the `googleMapsUri` field to the\n[`Reviews`](/maps/documentation/places/web-service/reference/rest/v1/places#review)\nand\n[`Photos`](/maps/documentation/places/web-service/reference/rest/v1/places#photo)\nobjects in the response. Browsing to these links opens the review or photo in\nGoogle Maps.\n\nFor example, the following Text Search (New) includes reviews and photos\nfor each place in the response: \n\n```\ncurl -X POST -d '{\n \"textQuery\" : \"Spicy Vegetarian Food in Sydney, Australia\"\n}' \\\n-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: API_KEY' \\\n-H 'X-Goog-FieldMask: places.displayName,places.reviews,places.photos' \\\n'https://places.googleapis.com/v1/places:searchText'\n```\n\nIn the response, each element of the reviews and photos array contains the\n`googleMapsUri` field to open the review or photo in a browser.\n\nTry it!\n-------\n\nThe API Explorer lets you make sample requests so that you can get familiar with\nthe API and the API options.\n\n1. Select the api API icon on the right\n side of the page.\n\n2. Optionally expand **Show standard parameters** and set **the `fields`\n parameter** to the [field\n mask](/maps/documentation/places/web-service/choose-fields).\n\n3. Optionally edit the **Request body**.\n\n4. Select **Execute** button. In the dialog, choose the account that you want\n to use to make the request.\n\n5. In the API Explorer panel, select fullscreen\n\n **Fullscreen** to expand the API Explorer window.\n\n \u003cbr /\u003e"]]