# REST Resource: mediaItems

- [Resource: AmbientMediaItem](https://developers.google.com/photos/ambient/reference/rest/v1/mediaItems#AmbientMediaItem)
  - [JSON representation](https://developers.google.com/photos/ambient/reference/rest/v1/mediaItems#AmbientMediaItem.SCHEMA_REPRESENTATION)
- [MediaFile](https://developers.google.com/photos/ambient/reference/rest/v1/mediaItems#MediaFile)
  - [JSON representation](https://developers.google.com/photos/ambient/reference/rest/v1/mediaItems#MediaFile.SCHEMA_REPRESENTATION)
- [MediaFileMetadata](https://developers.google.com/photos/ambient/reference/rest/v1/mediaItems#MediaFileMetadata)
  - [JSON representation](https://developers.google.com/photos/ambient/reference/rest/v1/mediaItems#MediaFileMetadata.SCHEMA_REPRESENTATION)
- [Methods](https://developers.google.com/photos/ambient/reference/rest/v1/mediaItems#METHODS_SUMMARY)

## Resource: AmbientMediaItem

Representation of a photo in Google Photos being used for ambient display.

| JSON representation |
|---|
| ``` { "id": string, "createTime": string, "mediaFile": { object (`https://developers.google.com/photos/ambient/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 uses 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"`. |
| `mediaFile` | ``object (`https://developers.google.com/photos/ambient/reference/rest/v1/mediaItems#MediaFile`)`` The media file that constitutes this media item. |

## MediaFile

Representation of an individual file of media bytes.

| JSON representation |
|---|
| ``` { "baseUrl": string, "mimeType": string, "mediaFileMetadata": { object (`https://developers.google.com/photos/ambient/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](https://developers.google.com/photos/ambient/guides/media-items#base-urls) to this URL. |
| `mimeType` | `string` MIME type of the media file. For example, `image/jpeg`. |
| `mediaFileMetadata` | ``object (`https://developers.google.com/photos/ambient/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 } ``` |

| Fields ||
|---|---|
| `width` | `integer` Original width (in pixels) of the media file. |
| `height` | `integer` Original height (in pixels) of the media file. |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/photos/ambient/reference/rest/v1/mediaItems/list` | Returns a list of ambient media items from user-configured media sources for the specified device. |