Resource: MediaItem
Representation of a media item (such as a photo or video) in Google Photos.
JSON representation |
---|
{ "id" : string , "description" : string , "productUrl" : string , "baseUrl" : string , "mimeType" : string , "mediaMetadata" : { object ( |
Fields | |
---|---|
id
|
Identifier for the media item. This is a persistent identifier that can be used between sessions to identify this media item. |
description
|
Description of the media item. This is shown to the user in the item's info section in the Google Photos app. Must be shorter than 1000 characters. Only include text written by users. Descriptions should add context and help users understand media. Do not include any auto-generated strings such as filenames, tags, and other metadata. |
productUrl
|
Google Photos URL for the media item. This link is available to the user only if they're signed in. When retrieved from an album search, the URL points to the item inside the album. |
baseUrl
|
A URL to the media item's bytes. This shouldn't be used as is. Parameters should be appended to this URL before use. See the developer documentation
for a complete list of supported parameters. For example, |
mimeType
|
MIME type of the media item. For example, |
mediaMetadata
|
Metadata related to the media item, such as, height, width, or creation time. |
contributorInfo
|
Information about the user who added this media item. Note that this is only included when using |
filename
|
Filename of the media item. This is shown to the user in the item's info section in the Google Photos app. |
MediaMetadata
Metadata for a media item.
JSON representation |
---|
{ "creationTime" : string , "width" : string , "height" : string , // Union field |
creationTime
string (
Timestamp
format)
Time when the media item was first 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"
.
width
string ( int64
format)
Original width (in pixels) of the media item.
height
string ( int64
format)
Original height (in pixels) of the media item.
photo
object (
Photo
)
Metadata for a photo media type.
video
object (
Video
)
Metadata for a video media type.
Photo
Metadata that is specific to a photo, such as, ISO, focal length and exposure time. Some of these fields may be null or not included.
JSON representation |
---|
{ "cameraMake" : string , "cameraModel" : string , "focalLength" : number , "apertureFNumber" : number , "isoEquivalent" : integer , "exposureTime" : string } |
Fields | |
---|---|
cameraMake
|
Brand of the camera with which the photo was taken. |
cameraModel
|
Model of the camera with which the photo was taken. |
focalLength
|
Focal length of the camera lens with which the photo was taken. |
apertureFNumber
|
Aperture f number of the camera lens with which the photo was taken. |
isoEquivalent
|
ISO of the camera with which the photo was taken. |
exposureTime
|
Exposure time of the camera aperture when the photo was taken. A duration in seconds with up to nine fractional digits, ending with ' |
Video
Metadata that is specific to a video, for example, fps and processing status. Some of these fields may be null or not included.
JSON representation |
---|
{
"cameraMake"
:
string
,
"cameraModel"
:
string
,
"fps"
:
number
,
"status"
:
enum (
|
Fields | |
---|---|
cameraMake
|
Brand of the camera with which the video was taken. |
cameraModel
|
Model of the camera with which the video was taken. |
fps
|
Frame rate of the video. |
status
|
Processing status of the video. |
VideoProcessingStatus
Processing status of a video being uploaded to Google Photos.
Enums | |
---|---|
UNSPECIFIED
|
Video processing status is unknown. |
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 it is now ready for viewing. Important: attempting to download a video not in the READY state may fail. |
FAILED
|
Something has gone wrong and the video has failed to process. |
ContributorInfo
Information about the user who added the media item. Note that this information is included only if the media item is within a shared album created by your app and you have the sharing scope.
JSON representation |
---|
{ "profilePictureBaseUrl" : string , "displayName" : string } |
Fields | |
---|---|
profilePictureBaseUrl
|
URL to the profile picture of the contributor. |
displayName
|
Display name of the contributor. |
Methods |
|
---|---|
|
Creates one or more media items in a user's Google Photos library. |
|
Returns the list of app created media items for the specified media item identifiers. |
|
Returns the app created media item for the specified media item identifier. |
|
List all media items created by your app from a user's Google Photos library. |
|
Update the app created media item with the specified id
. |
|
Searches for app created media items in a user's Google Photos library. |