REST Resource: accounts.videos

Resource: Video

Represents a video object.

JSON representation
{
  "name": string,
  "videoUri": {
    object (VideoUri)
  },
  "generationSource": enum (GenerationSource),
  "generationTime": string,
  "expirationTime": string,
  "videoInput": {
    object (VideoInput)
  },
  "videoStatus": {
    object (VideoStatus)
  }
}
Fields
name

string

Output only. Identifier. The unique key for the video using the format of accounts/{account}/videos/{videoId}.

videoUri

object (VideoUri)

Output only. The uri of the generated video. This is a temporary url and will expire after 6 months. A url may not be populated immediately after generation. Use get or list api using videoId to get the url.

generationSource

enum (GenerationSource)

Output only. The source of the video.

generationTime

string (Timestamp format)

Output only. The timestamp when the video was generated.

expirationTime

string (Timestamp format)

Output only. The timestamp when the video expires.

videoInput

object (VideoInput)

Required. The original input request used to generate the video.

videoStatus

object (VideoStatus)

Output only. The status of the video generation.

VideoUri

Represents different types of video urls.

JSON representation
{
  "playableUri": string,
  "downloadableUri": string,
  "thumbnailUri": string,
  "previewUri": string
}
Fields
playableUri

string

The playable uri for the video.

downloadableUri

string

The downloadable uri for the video.

thumbnailUri

string

The static thumbnail uri for the video.

previewUri

string

A 6s preview of the video. This is a playable url.

GenerationSource

The source of the video.

Enums
GENERATION_SOURCE_UNSPECIFIED Unspecified generation source.
MERCHANT_GENERATED The video was generated by the merchant.
GENERATED_FOR_YOU The video was generated by Google.

VideoInput

The input request to generate video.

JSON representation
{
  "videoConfig": {
    object (VideoConfig)
  },

  // Union field video_template can be only one of the following:
  "compositeTemplate": {
    object (CompositeTemplate)
  },
  "genAiTemplate": {
    object (GenAiTemplate)
  }
  // End of list of possible types for union field video_template.
  "regionCode": string
}
Fields
videoConfig

object (VideoConfig)

Required. The configuration for the video to use for generation. These are the parameters that merchant can set to customize the video generation.

Union field video_template. The video template to use for generation. video_template can be only one of the following:
compositeTemplate

object (CompositeTemplate)

Multiple asset/data types stitched together using specific, predefined templates. Images, text, logos are pulled automatically into pre-defined slots in the template to output a video.

genAiTemplate

object (GenAiTemplate)

Leverage AI to create short (~6s) video animations from still images for a single product. This can only be used for a single product. Generated clips can be stitched together for longer outputs using CompositeTemplate, for example product showcase from multiple animated movements.

regionCode

string

CLDR country code (For example "US"). The region code is used to run eligibility checks for the underlying products and images used in the video generation.

CompositeTemplate

Represents a composite video template for generating videos with multiple assets (for example images, texts) stitched together using specific, predefined templates.

JSON representation
{
  "theme": enum (VideoTheme),
  "videoType": enum (VideoType),
  "products": [
    string
  ],
  "headlines": [
    string
  ],
  "images": [
    {
      object (InputImage)
    }
  ]
}
Fields
theme

enum (VideoTheme)

Required. The theme of the video to generate.

videoType

enum (VideoType)

Required. The type of video to generate, for example product, brand, deal, categorical.

products[]

string

Optional. The name of the product to generate the video for. Format: accounts/{account}/products/{product} where the last section product consists of 4 parts: channel~contentLanguage~feedLabel~offerId example for product name is accounts/123/products/online~en~US~sku123

headlines[]

string

Optional. Short descriptions/titles for the video. for example Summer sale on all Nike hoodies. If not provided, the headlines will be fetched from the product and auto-generated.

images[]

object (InputImage)

Optional. The images to use for video generation. If not provided, the images will be fetched from the product.

VideoTheme

List of video transitions.

Enums
VIDEO_THEME_UNSPECIFIED Unspecified video theme.
MOVING_GRID Requires 3 images, 3 texts for example https://www.youtube.com/embed/NyBKgo5H0K4
ORIGIN_STORY Requires 4 images, 4 texts for example https://www.youtube.com/embed/wBsrEpqzhug
SCRIBBLE_REVEAL Requires 5 images, 2 texts, for example https://www.youtube.com/embed/wd7dhASYP7k
STACKING_CARDS Requires 3 images, 3 texts.
REPEATING_TEXT Requires 3 images, 1 texts, for example https://www.youtube.com/embed/uhTjA8BeST8
NEWSFEED Requires 2 images, 4 texts, for example https://www.youtube.com/embed/FC6YU6x8gdY
SLIDING_IMAGES Requires 7 images, 1 text, for example https://www.youtube.com/embed/ooKCu05A-J0
SLIDING_STRIPES Requires 3 images, 2 text, for example https://www.youtube.com/embed/VLxLN9tQM4U
PRODUCT_CARDS Requires 6 images, 14 text, for example https://www.youtube.com/embed/n3GeQWkZJwM
LIGHT_REVEAL Requires 3 image, 2 text, for example https://www.youtube.com/embed/DPJm5NQ48Ns
SNAPSHOTS Requires 7 images, 6 text, for example https://www.youtube.com/embed/2xUC6N8nSHQ
WIPING_BACKGROUND Requires 3 image, 3 text, for example https://www.youtube.com/embed/KE8TNDup0ow
BOUNCING_WHEEL Requires 3 image, 3 text, for example https://www.youtube.com/embed/HCdEg0VLaXE
CARD_TOWER_V Requires 5 image, 3 text.
FLUID_LINES_H Requires 4 image, 3 text.
PRODUCT_SCROLL_V Requires 6 image, 2 text.
SLIDER_H Requires 4 image, 4 text.
FLASH_REVEAL_V Requires 7 image, 4 text.
SLIP_AND_SLIDE_V Requires 2 image, 2 text.
SHREDDED_SLIDESHOW_H Requires 3 image, 2 text.
UNFOLDING_STORY_H Requires 7 image, 2 text.

VideoType

The type of video to generate.

Enums
VIDEO_TYPE_UNSPECIFIED Unspecified video type.
BRAND Tell the story of the brand from different perspective.
DEAL Sales event to increase merchants’ visibility online
CATEGORICAL Promote selected product collections.
PRODUCT Demonstrate single products.

InputImage

Represents an input image.

JSON representation
{

  // Union field image can be only one of the following:
  "imageUri": string,
  "imageBytes": string
  // End of list of possible types for union field image.
}
Fields
Union field image. The input image. image can be only one of the following:
imageUri

string

Public uri of the image.

imageBytes

string (bytes format)

Raw image bytes.

A base64-encoded string.

GenAiTemplate

Represents a GenAI video template for creating ~6s animations from still images and a prompt.

JSON representation
{
  "theme": enum (VideoTheme),
  "product": string,
  "image": {
    object (InputImage)
  }
}
Fields
theme

enum (VideoTheme)

Required. The theme of the video to generate.

product

string

Optional. The name of the product to generate the video for. Format: accounts/{account}/products/{product} where the last section product consists of 4 parts: channel~contentLanguage~feedLabel~offerId example for product name is accounts/123/products/online~en~US~sku123

image

object (InputImage)

Optional. The image to generate the video from. If not provided, the image will be fetched from the product automatically.

VideoTheme

List of GenAI video transitions.

Enums
VIDEO_THEME_UNSPECIFIED Unspecified video theme type.
ZOOM_IN Zoom in the image.
ZOOM_OUT Zoom out the image.
CIRCULAR_DOLLY Circular dolly zoom.

VideoConfig

Video configuration to be used for video generation. These are the parameters that merchant can set to customize the video generation.

JSON representation
{
  "imageEditingOption": enum (ImageEditingOption),
  "brandInfo": {
    object (BrandInfo)
  }
}
Fields
imageEditingOption

enum (ImageEditingOption)

Optional. The image editing option for the video. If not provided, the image will be cropped to match the exact dimensions of the image slot.

brandInfo

object (BrandInfo)

Optional. Brand information to supplement the video generation for example brand name, logo, colors, font. If not provided, the brand information available in MC will be used.

ImageEditingOption

The image editing options for the video.

Enums
IMAGE_EDITING_OPTION_UNSPECIFIED Unspecified image editing option.
ORIGINAL Preserve the image's original aspect ratio.
CROPPING Crop the image to match the exact dimensions of the image slot.
AUTO_EXPANSION_WITH_BLURRY_BACKGROUND Fit the entire image within the slot, expanding the image with a blur effect to fill any remaining space.
BACKGROUND_REMOVAL Remove the background of the image.

BrandInfo

Represents the brand information to be used in the video.

JSON representation
{
  "brandColors": [
    {
      object (Color)
    }
  ],
  "googleFontId": string,
  "business": string,
  "logoLink": string
}
Fields
brandColors[]

object (Color)

Optional. The colors of the brand to be used as the background of the video. If not provided, the brand colors available in MC are used.

googleFontId

string

Optional. The Google font id of the font in the video for example "Roboto". If not provided, the default font is used.

business

string

The name of the brand. Merchant name is used if this is not provided.

Color

Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to and from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of java.awt.Color in Java; it can also be trivially provided to UIColor's +colorWithRed:green:blue:alpha method in iOS; and, with just a little work, it can be easily formatted into a CSS rgba() string in JavaScript.

This reference page doesn't have information about the absolute color space that should be used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB color space.

When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5.

Example (Java):

 import com.google.type.Color;

 // ...
 public static java.awt.Color fromProto(Color protocolor) {
   float alpha = protocolor.hasAlpha()
       ? protocolor.getAlpha().getValue()
       : 1.0;

   return new java.awt.Color(
       protocolor.getRed(),
       protocolor.getGreen(),
       protocolor.getBlue(),
       alpha);
 }

 public static Color toProto(java.awt.Color color) {
   float red = (float) color.getRed();
   float green = (float) color.getGreen();
   float blue = (float) color.getBlue();
   float denominator = 255.0;
   Color.Builder resultBuilder =
       Color
           .newBuilder()
           .setRed(red / denominator)
           .setGreen(green / denominator)
           .setBlue(blue / denominator);
   int alpha = color.getAlpha();
   if (alpha != 255) {
     result.setAlpha(
         FloatValue
             .newBuilder()
             .setValue(((float) alpha) / denominator)
             .build());
   }
   return resultBuilder.build();
 }
 // ...

Example (iOS / Obj-C):

 // ...
 static UIColor* fromProto(Color* protocolor) {
    float red = [protocolor red];
    float green = [protocolor green];
    float blue = [protocolor blue];
    FloatValue* alpha_wrapper = [protocolor alpha];
    float alpha = 1.0;
    if (alpha_wrapper != nil) {
      alpha = [alpha_wrapper value];
    }
    return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
 }

 static Color* toProto(UIColor* color) {
     CGFloat red, green, blue, alpha;
     if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
       return nil;
     }
     Color* result = [[Color alloc] init];
     [result setRed:red];
     [result setGreen:green];
     [result setBlue:blue];
     if (alpha <= 0.9999) {
       [result setAlpha:floatWrapperWithValue(alpha)];
     }
     [result autorelease];
     return result;
}
// ...

Example (JavaScript):

// ...

var protoToCssColor = function(rgb_color) {
   var redFrac = rgb_color.red || 0.0;
   var greenFrac = rgb_color.green || 0.0;
   var blueFrac = rgb_color.blue || 0.0;
   var red = Math.floor(redFrac * 255);
   var green = Math.floor(greenFrac * 255);
   var blue = Math.floor(blueFrac * 255);

   if (!('alpha' in rgb_color)) {
      return rgbToCssColor(red, green, blue);
   }

   var alphaFrac = rgb_color.alpha.value || 0.0;
   var rgbParams = [red, green, blue].join(',');
   return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
};

var rgbToCssColor = function(red, green, blue) {
  var rgbNumber = new Number((red << 16) | (green << 8) | blue);
  var hexString = rgbNumber.toString(16);
  var missingZeros = 6 - hexString.length;
  var resultBuilder = ['#'];
  for (var i = 0; i < missingZeros; i++) {
     resultBuilder.push('0');
  }
  resultBuilder.push(hexString);
  return resultBuilder.join('');
};

// ...
JSON representation
{
  "red": number,
  "green": number,
  "blue": number,
  "alpha": number
}
Fields
red

number

The amount of red in the color as a value in the interval [0, 1].

green

number

The amount of green in the color as a value in the interval [0, 1].

blue

number

The amount of blue in the color as a value in the interval [0, 1].

alpha

number

The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation:

pixel color = alpha * (this color) + (1.0 - alpha) * (background color)

This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).

VideoStatus

Represents the status of the video generation.

JSON representation
{
  "status": string
}
Fields
status

string

Output only. The status of the video generation for example generating, ready, failed.

Methods

generate

Generates a video.

get

Fetch video details such as serving url for a given video resource name.

list

Lists all videos for a given account.