# REST Resource: mediaItems

- [Resource: PickedMediaItem](https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#PickedMediaItem)
  - [JSON representation](https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#PickedMediaItem.SCHEMA_REPRESENTATION)
- [Type](https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#Type)
- [MediaFile](https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#MediaFile)
  - [JSON representation](https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#MediaFile.SCHEMA_REPRESENTATION)
- [MediaFileMetadata](https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#MediaFileMetadata)
  - [JSON representation](https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#MediaFileMetadata.SCHEMA_REPRESENTATION)
- [PhotoMetadata](https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#PhotoMetadata)
  - [JSON representation](https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#PhotoMetadata.SCHEMA_REPRESENTATION)
- [VideoMetadata](https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#VideoMetadata)
  - [JSON representation](https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#VideoMetadata.SCHEMA_REPRESENTATION)
- [VideoProcessingStatus](https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#VideoProcessingStatus)
- [Methods](https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#METHODS_SUMMARY)

## Resource: PickedMediaItem

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

| JSON representation |
|---|
| ``` { "id": string, "createTime": string, "type": enum (`https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#Type`), "mediaFile": { object (`https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#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 (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Time when the media item was created (not when it was uploaded to Google Photos). Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `type` | ``enum (`https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#Type`)`` The type of this media item. |
| `mediaFile` | ``object (`https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#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 (`https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#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.](https://developers.google.com/photos/library/guides/access-media-items#base-urls) [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.](https://developers.google.com/photos/library/guides/access-media-items#base-urls) [](https://developers.google.com/photos/library/guides/access-media-items#base-urls) |
| `mimeType` | `string` MIME type of the media file. For example, `image/jpeg`. |
| `filename` | `string` Filename of the media file. |
| `mediaFileMetadata` | ``object (`https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#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 (`https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#PhotoMetadata`) }, "videoMetadata": { object (`https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#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 (`https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#PhotoMetadata`)`` Metadata for a photo media type. |
| `videoMetadata` | ``object (`https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#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 (`https://protobuf.dev/reference/protobuf/google.protobuf#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 (`https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#VideoProcessingStatus`) } ``` |

| Fields ||
|---|---|
| `fps` | `number` Frame rate of the video. |
| `processingStatus` | ``enum (`https://developers.google.com/photos/picker/reference/rest/v1/mediaItems#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 ||
|---|---|
| ### `https://developers.google.com/photos/picker/reference/rest/v1/mediaItems/list` | Returns a list of media items picked by the user during the specified session. |