You can use Place Photos API. The Place Photo service, part of the Places API, is a read- only API that allows you to add high quality photographic content to your application. This gives you access to the millions of photos stored in the Places database.
To use, you just have to send Place Photo request is an HTTP URL of the following form:
I use the photo in the fields parameter to get the address' photo reference: link
As you can see from the Place Details API response, there are multiple photo references for this address.
To get the photo, we'll just use a photo reference from the Place Details API response, and put it in the photo_reference parameter of the Place Photo API request. Here's an example:
发布评论
评论(1)
您可以使用地点照片 API。地点照片服务是 Places API 的一部分,是一个只读 API,允许您向应用程序添加高质量的照片内容。这使您可以访问存储在地点数据库中的数百万张照片。
要使用它,您只需发送以下形式的 HTTP URL 的“放置照片”请求:
示例如下:
如您所见,有一个
photo_reference
参数。这可以在对查找地点 API 的响应中找到, 附近搜索 API, <一个href="https://developers.google.com/maps/documentation/places/web-service/search-text" rel="nofollow noreferrer">文本搜索 API,或 地点详情 API 网络请求。以下是地点详细信息 API Web 请求的示例,用于获取地址
48 Pirrama Rd, Pyrmont NSW 2009, Australia
的照片参考:我在
中使用
参数来获取地址的照片参考:链接photo
>fields正如您从地点详细信息 API 响应中看到的,该地址有多个照片引用。
要获取照片,我们只需使用 Place Details API 响应中的照片引用,并将其放入 Place Photo API 请求的
photo_reference
参数中。这是一个例子:You can use Place Photos API. The Place Photo service, part of the Places API, is a read- only API that allows you to add high quality photographic content to your application. This gives you access to the millions of photos stored in the Places database.
To use, you just have to send Place Photo request is an HTTP URL of the following form:
An example of it is:
As you can see, there is a
photo_reference
parameter. This can be found in the response to a Find Place API, Nearby Search API, Text Search API, or Place Details API web request.Here is an example of Place Details API web request to get the photo reference of the address
48 Pirrama Rd, Pyrmont NSW 2009, Australia
:I use the
photo
in thefields
parameter to get the address' photo reference: linkAs you can see from the Place Details API response, there are multiple photo references for this address.
To get the photo, we'll just use a photo reference from the Place Details API response, and put it in the
photo_reference
parameter of the Place Photo API request. Here's an example: