Method: mediaItems.batchGet

Returns the list of media items for the specified media item identifiers. Items are returned in the same order as the supplied identifiers.

HTTP request

GET https://photoslibrary.googleapis.com/v1/mediaItems:batchGet

The URL uses gRPC Transcoding syntax.

Query parameters

Parameters
mediaItemIds

string

Identifiers of the media items to be requested. Must not contain repeated identifiers and cannot be empty. The maximum number of media items that can be retrieved in one call is 50.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

Response to retrieve a list of media items.

JSON representation
{
  "mediaItemResults": [
    {
      object (MediaItemResult)
    }
  ]
}
Fields
mediaItemResults[]

object (MediaItemResult)

Output only. List of media items retrieved. Note that even if the call to mediaItems.batchGet succeeds, there may have been failures for some media items in the batch. These failures are indicated in each MediaItemResult.status.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/photoslibrary
  • https://www.googleapis.com/auth/photoslibrary.readonly
  • https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata

MediaItemResult

Result of retrieving a media item.

JSON representation
{
  "status": {
    object (Status)
  },
  "mediaItem": {
    object (MediaItem)
  }
}
Fields
status

object (Status)

If an error occurred while accessing this media item, this field is populated with information related to the error. For details regarding this field, see Status.

mediaItem

object (MediaItem)

Media item retrieved from the user's library. It's populated if no errors occurred and the media item was fetched successfully.

Try it!