Method: photos.list
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
列出属于相应用户的所有 Photos
。
注意: 响应中不会返回最近创建但仍在编入索引的照片。
HTTP 请求
GET https://streetviewpublish.googleapis.com/v1/photos
网址采用 gRPC 转码语法。
查询参数
参数 |
view |
enum (PhotoView )
必需。指定是否应在相册响应中返回照片字节的下载网址。
|
pageSize |
integer
可选。要返回的照片数量上限。“pageSize ”必须是非负数。如果 pageSize 为零或未提供,则使用默认页面大小 100。如果属于用户的照片数量少于 pageSize ,响应中返回的照片数量可能会少于 pageSize 。
|
pageToken |
string
可选。从上一个 photos.list 请求返回的 nextPageToken 值(如果有)。
|
filter |
string
可选。过滤表达式。例如:placeId=ChIJj61dQgK6j4AR4GeTYWZsKWw 。 支持的过滤条件包括:placeId 、min_latitude 、max_latitude 、min_longitude 、max_longitude 。如需了解详情,请参阅 https://google.aip.dev/160。
|
languageCode |
string
可选。BCP-47 语言代码,例如“en-US”或“sr-Latn”。如需了解详情,请参阅 http://www.unicode.org/reports/tr35/#Unicode_locale_identifier。如果未指定 languageCode,系统会使用用户的 Google 服务语言偏好设置。
|
响应正文
列出属于某个用户的所有照片的响应。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"photos": [
{
object (Photo )
}
],
"nextPageToken": string
} |
字段 |
photos[] |
object (Photo )
照片列表。请求中的 pageSize 字段决定了返回的项数。
|
nextPageToken |
string
用于检索下一页结果的令牌。如果列表中没有更多结果,则为空。
|
授权范围
需要以下 OAuth 范围:
https://www.googleapis.com/auth/streetviewpublish
如需了解详情,请参阅 OAuth 2.0 概览。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eLists all photos belonging to a user, although recently created, unindexed photos may not be included.\u003c/p\u003e\n"],["\u003cp\u003eAllows filtering by place ID, latitude, and longitude, and lets you specify the view and page size.\u003c/p\u003e\n"],["\u003cp\u003eResponses include a list of photos and a token for retrieving subsequent pages if available.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/streetviewpublish\u003c/code\u003e scope.\u003c/p\u003e\n"]]],["This document details how to retrieve a user's photos using the Street View Publish API. A `GET` request to `https://streetviewpublish.googleapis.com/v1/photos` is used. Key parameters include `view`, `pageSize`, `pageToken`, `filter`, and `languageCode`. The request body is empty. A successful response returns a JSON object containing a list of `photos`, and a `nextPageToken` for pagination. Access requires the `https://www.googleapis.com/auth/streetviewpublish` authorization scope.\n"],null,["# Method: photos.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListPhotosResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nLists all the [Photos](/streetview/publish/reference/rest/v1/photo#Photo) that belong to the user.\n\u003e Note: Recently created photos that are still being indexed are not returned in the response.\n\n### HTTP request\n\n`GET https://streetviewpublish.googleapis.com/v1/photos`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `view` | `enum (`[PhotoView](/streetview/publish/reference/rest/v1/PhotoView)`)` Required. Specifies if a download URL for the photos bytes should be returned in the Photos response. |\n| `pageSize` | `integer` Optional. The maximum number of photos to return. `pageSize` must be non-negative. If `pageSize` is zero or is not provided, the default page size of 100 is used. The number of photos returned in the response may be less than `pageSize` if the number of photos that belong to the user is less than `pageSize`. |\n| `pageToken` | `string` Optional. The [nextPageToken](/streetview/publish/reference/rest/v1/photos/list#body.ListPhotosResponse.FIELDS.next_page_token) value returned from a previous [photos.list](/streetview/publish/reference/rest/v1/photos/list#google.streetview.publish.v1.StreetViewPublishService.ListPhotos) request, if any. |\n| `filter` | `string` Optional. The filter expression. For example: `placeId=ChIJj61dQgK6j4AR4GeTYWZsKWw`. The filters supported are: `placeId`, `min_latitude`, `max_latitude`, `min_longitude`, `max_longitude`. See \u003chttps://google.aip.dev/160\u003e for more information. |\n| `languageCode` | `string` Optional. The BCP-47 language code, such as \"en-US\" or \"sr-Latn\". For more information, see \u003chttp://www.unicode.org/reports/tr35/#Unicode_locale_identifier\u003e. If languageCode is unspecified, the user's language preference for Google services is used. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nResponse to list all photos that belong to a user.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------|\n| ``` { \"photos\": [ { object (/streetview/publish/reference/rest/v1/photo#Photo) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `photos[]` | `object (`[Photo](/streetview/publish/reference/rest/v1/photo#Photo)`)` List of photos. The [pageSize](/streetview/publish/reference/rest/v1/photos/list#body.QUERY_PARAMETERS.page_size) field in the request determines the number of items returned. |\n| `nextPageToken` | `string` Token to retrieve the next page of results, or empty if there are no more results in the list. |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/streetviewpublish`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]