AI-generated Key Takeaways
-
Lists all media items from a user's Google Photos library using the
listMediaItems
method. -
Allows pagination with
pageSize
andpageToken
parameters to retrieve large sets of media items. -
Returns an array of
MediaItem
objects containing information about each media item. -
Requires specific OAuth scopes like
photoslibrary
orphotoslibrary.readonly
for authorization. -
Functionality for interacting with media items not created by the app will be limited after March 31, 2025.
List all media items created by your app from a user's Google Photos library.
HTTP request
GET https://photoslibrary.googleapis.com/v1/mediaItems
The URL uses gRPC Transcoding syntax.
Query parameters
Parameters | |
---|---|
pageSize |
Maximum number of media items to return in the response. Fewer media items might be returned than the specified number. The default |
pageToken |
A continuation token to get the next page of the results. Adding this to the request returns the rows after the |
Request body
The request body must be empty.
Response body
List of all media items from the user's Google Photos library.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{
"mediaItems": [
{
object ( |
Fields | |
---|---|
mediaItems[] |
Output only. List of media items in the user's library. |
nextPageToken |
Output only. Token to use to get the next set of media items. Its presence is the only reliable indicator of more media items being available in the next request. |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata