REST Resource: mediaItems

Resource: PickedMediaItem

Representation of a photo or video that was picked by the user.

JSON representation
{
  "id": string,
  "createTime": string,
  "type": enum (Type),
  "mediaFile": {
    object (MediaFile)
  }
}
Fields
id

string

Identifier for the media item.

This is a persistent identifier that can be used between sessions to identify this media item.

createTime

string (Timestamp format)

Time when the media item was created (not when it was uploaded to Google Photos).

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

type

enum (Type)

The type of this media item.

mediaFile

object (MediaFile)

The media file that constitutes this media item.

Type

The type of a media item.

Enums
TYPE_UNSPECIFIED The type is not specified.
PHOTO The media item represents a photo.
VIDEO The media item represents a video.

MediaFile

Representation of a media file.

JSON representation
{
  "baseUrl": string,
  "mimeType": string,
  "filename": string,
  "mediaFileMetadata": {
    object (MediaFileMetadata)
  }
}
Fields
baseUrl

string

A URL to fetch the media file's bytes.

To download a media file, the API client must add the parameters specified in the developer documentation to this URL.

For example, '=w2048-h1024' will set the dimensions of a media item of type photo to have a width of 2048 px and height of 1024 px.

mimeType

string

MIME type of the media file. For example, image/jpeg.

filename

string

Filename of the media file.

mediaFileMetadata

object (MediaFileMetadata)

Metadata related to the media file, such as height and width.

MediaFileMetadata

Metadata about a media file.

JSON representation
{
  "width": integer,
  "height": integer,
  "cameraMake": string,
  "cameraModel": string,

  // Union field metadata can be only one of the following:
  "photoMetadata": {
    object (PhotoMetadata)
  },
  "videoMetadata": {
    object (VideoMetadata)
  }
  // End of list of possible types for union field metadata.
}
Fields
width

integer

Original width (in pixels) of the media file.

height

integer

Original height (in pixels) of the media file.

cameraMake

string

Brand of the camera with which the media was captured.

cameraModel

string

Model of the camera with which the media was captured.

Union field metadata. Metadata for the media file specific to its media type. metadata can be only one of the following:
photoMetadata

object (PhotoMetadata)

Metadata for a photo media type.

videoMetadata

object (VideoMetadata)

Metadata for a video media type.

PhotoMetadata

Metadata that is specific to a photo, such as, ISO, focal length, and exposure time.

Some of these fields may not be set.

JSON representation
{
  "focalLength": number,
  "apertureFNumber": number,
  "isoEquivalent": integer,
  "exposureTime": string
}
Fields
focalLength

number

Focal length of the camera lens with which the photo was taken.

apertureFNumber

number

Aperture f number of the camera lens with which the photo was taken.

isoEquivalent

integer

ISO of the camera with which the photo was taken.

exposureTime

string (Duration format)

Exposure time of the camera aperture when the photo was taken.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

VideoMetadata

Metadata that is specific to a video. For example, fps.

JSON representation
{
  "fps": number,
  "processingStatus": enum (VideoProcessingStatus)
}
Fields
fps

number

Frame rate of the video.

processingStatus

enum (VideoProcessingStatus)

Processing status of the video.

VideoProcessingStatus

Processing status of a video stored in Google Photos.

Enums
UNSPECIFIED Video processing status is not specified.
PROCESSING

Video is being processed.

The user sees an icon for this video in the Google Photos app; however, it isn't playable yet.

READY

Video processing is complete and this video is now ready for viewing.

Attempting to download a video not in the READY state may fail.

FAILED Something has gone wrong and the video has failed to process.

Methods

list

Returns a list of media items picked by the user during the specified session.