Method: mediaItems.list

  • Lists all media items from a user's Google Photos library using the listMediaItems method.

  • Allows pagination with pageSize and pageToken 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 or photoslibrary.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

integer

Maximum number of media items to return in the response. Fewer media items might be returned than the specified number. The default pageSize is 25, the maximum is 100.

pageToken

string

A continuation token to get the next page of the results. Adding this to the request returns the rows after the pageToken. The pageToken should be the value returned in the nextPageToken parameter in the response to the listMediaItems request.

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 (MediaItem)
    }
  ],
  "nextPageToken": string
}
Fields
mediaItems[]

object (MediaItem)

Output only. List of media items in the user's library.

nextPageToken

string

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