2025 年 4 月 1 日,我们移除了 Library API 中的部分镜重。
点击此处了解详情。
Photos Library API
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
管理您的应用在 Google 相册中创建的照片、视频和影集
服务:photoslibrary.googleapis.com
服务端点
服务端点是指定 API 服务的网络地址的基本网址。一项服务可能有多个服务端点。此服务具有以下服务端点,下面的所有 URI 都与此服务端点相关:
https://photoslibrary.googleapis.com
方法 |
addEnrichment |
POST /v1/albums/{albumId}:addEnrichment 在应用创建的影集中的指定位置添加丰富内容。 |
batchAddMediaItems |
POST /v1/albums/{albumId}:batchAddMediaItems
将用户 Google 相册媒体库中由应用创建的一项或多项媒体内容添加到由应用创建的影集。 |
batchRemoveMediaItems |
POST /v1/albums/{albumId}:batchRemoveMediaItems
从指定的应用创建的影集中移除一项或多项应用创建的媒体内容。 |
create |
POST /v1/albums
在用户的 Google 相册媒体库中创建影集。 |
get |
GET /v1/albums/{albumId}
根据指定的 albumId 返回应用创建的影集。 |
list |
GET /v1/albums
列出应用创建的所有影集。 |
patch |
PATCH /v1/albums/{album.id}
使用指定的 id 更新应用创建的相册。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eThe Google Photos Library API allows you to manage photos, videos, and albums programmatically through REST resources.\u003c/p\u003e\n"],["\u003cp\u003eThe API provides methods to interact with albums, including creating, adding enrichments, managing media items, and sharing (although sharing functionality will be deprecated on March 31, 2025).\u003c/p\u003e\n"],["\u003cp\u003eYou can also access and manipulate individual media items, such as retrieving details, updating properties, and performing searches.\u003c/p\u003e\n"],["\u003cp\u003eShared albums can be accessed, joined, and left, but these features are also scheduled for deprecation on March 31, 2025.\u003c/p\u003e\n"],["\u003cp\u003eAll interactions with the API are performed through the service endpoint \u003ccode\u003ehttps://photoslibrary.googleapis.com\u003c/code\u003e.\u003c/p\u003e\n"]]],["This API allows management of photos, videos, and albums in Google Photos via `photoslibrary.googleapis.com`. Key actions include creating, getting, listing, patching, adding, and removing media items within albums. It supports batch operations for media items and enrichment. Albums can be shared or unshared. Shared albums can be joined, left, retrieved, and listed. Several methods will no longer function after March 31, 2025 and other have some scope changes.\n"],null,["# Photos Library API\n\nManage photos, videos, and albums created by your app in Google Photos\n\n- [REST Resource: v1.albums](#v1.albums)\n- [REST Resource: v1.mediaItems](#v1.mediaItems)\n\nService: photoslibrary.googleapis.com\n-------------------------------------\n\n### Service endpoint\n\nA [service endpoint](https://cloud.google.com/apis/design/glossary#api_service_endpoint) is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:\n\n- `https://photoslibrary.googleapis.com`\n\nREST Resource: [v1.albums](/photos/library/reference/rest/v1/albums)\n--------------------------------------------------------------------\n\n| Methods ||\n|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| [addEnrichment](/photos/library/reference/rest/v1/albums/addEnrichment) | `POST /v1/albums/{albumId}:addEnrichment` Adds an enrichment at a specified position in an app created created album. |\n| [batchAddMediaItems](/photos/library/reference/rest/v1/albums/batchAddMediaItems) | `POST /v1/albums/{albumId}:batchAddMediaItems` Adds one or more app created media items in a user's Google Photos library to an app created album. |\n| [batchRemoveMediaItems](/photos/library/reference/rest/v1/albums/batchRemoveMediaItems) | `POST /v1/albums/{albumId}:batchRemoveMediaItems` Removes one or more app created media items from a specified app created album. |\n| [create](/photos/library/reference/rest/v1/albums/create) | `POST /v1/albums` Creates an album in a user's Google Photos library. |\n| [get](/photos/library/reference/rest/v1/albums/get) | `GET /v1/albums/{albumId}` Returns the app created album based on the specified `albumId`. |\n| [list](/photos/library/reference/rest/v1/albums/list) | `GET /v1/albums` Lists all albums created by your app. |\n| [patch](/photos/library/reference/rest/v1/albums/patch) | `PATCH /v1/albums/{album.id}` Update the app created album with the specified `id`. |\n\nREST Resource: [v1.mediaItems](/photos/library/reference/rest/v1/mediaItems)\n----------------------------------------------------------------------------\n\n| Methods ||\n|-------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|\n| [batchCreate](/photos/library/reference/rest/v1/mediaItems/batchCreate) | `POST /v1/mediaItems:batchCreate` Creates one or more media items in a user's Google Photos library. |\n| [batchGet](/photos/library/reference/rest/v1/mediaItems/batchGet) | `GET /v1/mediaItems:batchGet` Returns the list of app created media items for the specified media item identifiers. |\n| [get](/photos/library/reference/rest/v1/mediaItems/get) | `GET /v1/mediaItems/{mediaItemId}` Returns the app created media item for the specified media item identifier. |\n| [list](/photos/library/reference/rest/v1/mediaItems/list) | `GET /v1/mediaItems` List all media items created by your app from a user's Google Photos library. |\n| [patch](/photos/library/reference/rest/v1/mediaItems/patch) | `PATCH /v1/mediaItems/{mediaItem.id}` Update the app created media item with the specified `id`. |\n| [search](/photos/library/reference/rest/v1/mediaItems/search) | `POST /v1/mediaItems:search` Searches for app created media items in a user's Google Photos library. |"]]