Actualizaremos la API de datos para que coincida con la forma en que YouTube cuenta las vistas de Shorts.
Más información
Thumbnails
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Un recurso thumbnail
identifica los diferentes tamaños de imágenes en miniatura asociados a un recurso. Ten en cuenta las siguientes características de las imágenes en miniatura:
- La propiedad
snippet.thumbnails
de un recurso es un objeto que identifica las imágenes en miniatura disponibles para ese recurso. - Un recurso
thumbnail
contiene una serie de objetos. El nombre de cada objeto (default
, medium
, high
, etcétera) hace referencia al tamaño de la imagen en miniatura. - Los diferentes tipos de recursos pueden soportar diferentes tamaños de imágenes en miniatura.
- Los diferentes tipos de recursos pueden definir distintos tamaños de imágenes en miniatura con el mismo nombre. Por ejemplo, la imagen en miniatura
default
de un recurso video
suele ser de 120 px por 90 px, y la imagen en miniatura default
de un recurso channel
suele ser de 88 px por 88 px. - Es posible que los recursos del mismo tipo aún tengan tamaños de imágenes en miniatura diferentes para ciertas imágenes en función de la resolución de la imagen original o el contenido subido a YouTube. Por ejemplo, un video de alta definición puede admitir miniaturas de mayor resolución que los videos que no son de alta definición.
- Cada objeto que contiene información sobre el tamaño de una imagen en miniatura tiene una propiedad
width
y una propiedad height
. Sin embargo, es posible que las propiedades de anchura y altura no se muestren para esa imagen. - Si una imagen en miniatura cargada no coincide con las dimensiones requeridas, la imagen cambia de tamaño para que coincida con el tamaño correcto, sin cambiar la proporción. La imagen no se recorta, pero puede incluir barras de color negro para que el tamaño sea el correcto.
Métodos
La API admite los siguientes métodos para los recursos thumbnails
:
- set
- Sube una miniatura de video personalizada a YouTube y la configura para un video.
Representación de recursos
En la siguiente estructura JSON, se muestra el formato de un recurso thumbnails
:
{
"default": {
"url": string,
"width": unsigned integer,
"height": unsigned integer
},
"medium": {
"url": string,
"width": unsigned integer,
"height": unsigned integer
},
"high": {
"url": string,
"width": unsigned integer,
"height": unsigned integer
},
"standard": {
"url": string,
"width": unsigned integer,
"height": unsigned integer
},
"maxres": {
"url": string,
"width": unsigned integer,
"height": unsigned integer
}
}
Propiedades
La siguiente tabla define las propiedades que aparecen en este recurso:
Propiedades |
default |
object
Es la imagen en miniatura predeterminada. La viñeta predeterminada de un video, o de un recurso que se refiere a un video, como un elemento de una lista de reproducción o el resultado de una búsqueda, es de 120 píxeles de ancho y 90 píxeles de alto. La viñeta predeterminada para un canal es de 88 píxeles de ancho y 88 píxeles de alto. |
default.url |
string
Es la URL de la imagen. |
default.width |
unsigned integer
Ancho de la imagen. |
default.height |
unsigned integer
Altura de la imagen. |
medium |
object
Es una versión de mayor resolución de la imagen en miniatura. Para un video (o un recurso que hace referencia a un video), esta imagen es de 320 píxeles de ancho y 180 píxeles de alto. Para un canal, esta imagen es de 240 píxeles de ancho y 240 píxeles de alto. |
medium.url |
string
Es la URL de la imagen. |
medium.width |
unsigned integer
Ancho de la imagen. |
medium.height |
unsigned integer
Altura de la imagen. |
high |
object
Es una versión de alta resolución de la imagen en miniatura. Para un video (o un recurso que hace referencia a un video), esta imagen es de 480 píxeles de ancho y 360 píxeles de alto. Para un canal, esta imagen es de 800 píxeles de ancho y 800 píxeles de alto. |
high.url |
string
Es la URL de la imagen. |
high.width |
unsigned integer
Ancho de la imagen. |
high.height |
unsigned integer
Altura de la imagen. |
standard |
object
Es una versión de la imagen en miniatura con una resolución aún mayor que la de la imagen en resolución high . Esta imagen está disponible para algunos videos y otros recursos que hacen referencia a videos, como los elementos de playlists o los resultados de la búsqueda. Esta imagen tiene 640 px de ancho y 480 px de alto. |
standard.url |
string
Es la URL de la imagen. |
standard.width |
unsigned integer
Ancho de la imagen. |
standard.height |
unsigned integer
Altura de la imagen. |
maxres |
object
Es la versión de mayor resolución de la imagen en miniatura. Este tamaño de imagen está disponible para algunos videos y otros recursos que hacen referencia a videos, como elementos de playlists o resultados de búsqueda. Esta imagen tiene 1,280 px de ancho y 720 px de alto. |
maxres.url |
string
Es la URL de la imagen. |
maxres.width |
unsigned integer
Ancho de la imagen. |
maxres.height |
unsigned integer
Altura de la imagen. |
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-08-21 (UTC)
[null,null,["Última actualización: 2025-08-21 (UTC)"],[[["\u003cp\u003eA resource's \u003ccode\u003esnippet.thumbnails\u003c/code\u003e property contains an object, and each of these objects has properties such as \u003ccode\u003edefault\u003c/code\u003e, \u003ccode\u003emedium\u003c/code\u003e, and \u003ccode\u003ehigh\u003c/code\u003e, which identify the different available thumbnail image sizes for that specific resource.\u003c/p\u003e\n"],["\u003cp\u003eThumbnail image sizes can vary significantly between different resource types (e.g., videos vs. channels), and even among resources of the same type, based on the resolution of the original uploaded content.\u003c/p\u003e\n"],["\u003cp\u003eEach thumbnail image size object contains a \u003ccode\u003eurl\u003c/code\u003e, \u003ccode\u003ewidth\u003c/code\u003e, and \u003ccode\u003eheight\u003c/code\u003e property, but the width and height may not always be returned.\u003c/p\u003e\n"],["\u003cp\u003eWhen a custom thumbnail image is uploaded, it's resized to match the required dimensions without changing its aspect ratio, which may result in black bars being added.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ethumbnails\u003c/code\u003e resource offers various image size options, such as \u003ccode\u003edefault\u003c/code\u003e, \u003ccode\u003emedium\u003c/code\u003e, \u003ccode\u003ehigh\u003c/code\u003e, \u003ccode\u003estandard\u003c/code\u003e, and \u003ccode\u003emaxres\u003c/code\u003e, each with distinct resolutions to accommodate different display needs.\u003c/p\u003e\n"]]],["Thumbnail resources define various image sizes (`default`, `medium`, `high`, etc.) for different resource types. Image dimensions vary by resource type and resolution. The `thumbnails` resource is an object within `snippet.thumbnails` that holds size-specific objects, each with `url`, `width`, and `height` properties. The `set` method allows uploading a custom video thumbnail. When the dimensions don't match, the image is resized, maintaining its aspect ratio, with possible added black bars.\n"],null,["# Thumbnails\n\nA **thumbnail** resource identifies different thumbnail image sizes associated with a resource. Please note the following characteristics of thumbnail images:\n\n- A resource's `snippet.thumbnails` property is an object that identifies the thumbnail images available for that resource.\n- A `thumbnail` resource contains a series of objects. The name of each object (`default`, `medium`, `high`, etc.) refers to the thumbnail image size.\n- Different types of resources may support different thumbnail image sizes.\n- Different types of resources may define different sizes for thumbnail images with the same name. For example, the `default` thumbnail image for a `video` resource is typically 120px by 90px, and the `default` thumbnail image for a `channel` resource is typically 88px by 88px.\n- Resources of the same type may still have different thumbnail image sizes for certain images depending on the resolution of the original image or content uploaded to YouTube. For example, an HD video may support higher resolution thumbnails than non-HD videos.\n- Each object that contains information about a thumbnail image size has a `width` property and a `height` property. However, the width and height properties may not be returned for that image.\n- If an uploaded thumbnail image does not match the required dimensions, the image is resized to match the correct size without changing its aspect ratio. The image is not cropped, but may include black bars so that the size is correct.\n\n\u003cbr /\u003e\n\nMethods\n-------\n\nThe API supports the following methods for `thumbnails` resources:\n\n[set](/youtube/v3/docs/thumbnails/set)\n: Uploads a custom video thumbnail to YouTube and sets it for a video.\n\nResource representation\n-----------------------\n\nThe following JSON structure shows the format of a `thumbnails` resource: \n\n```text\n{\n \"default\": {\n \"url\": string,\n \"width\": unsigned integer,\n \"height\": unsigned integer\n },\n \"medium\": {\n \"url\": string,\n \"width\": unsigned integer,\n \"height\": unsigned integer\n },\n \"high\": {\n \"url\": string,\n \"width\": unsigned integer,\n \"height\": unsigned integer\n },\n \"standard\": {\n \"url\": string,\n \"width\": unsigned integer,\n \"height\": unsigned integer\n },\n \"maxres\": {\n \"url\": string,\n \"width\": unsigned integer,\n \"height\": unsigned integer\n }\n}\n```\n\n### Properties\n\nThe following table defines the properties that appear in this resource:\n\n| Properties ||\n|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `default` | `object` The default thumbnail image. The default thumbnail for a video -- or a resource that refers to a video, such as a playlist item or search result -- is 120px wide and 90px tall. The default thumbnail for a channel is 88px wide and 88px tall. |\n| default.`url` | `string` The image's URL. |\n| default.`width` | `unsigned integer` The image's width. |\n| default.`height` | `unsigned integer` The image's height. |\n| `medium` | `object` A higher resolution version of the thumbnail image. For a video (or a resource that refers to a video), this image is 320px wide and 180px tall. For a channel, this image is 240px wide and 240px tall. |\n| medium.`url` | `string` The image's URL. |\n| medium.`width` | `unsigned integer` The image's width. |\n| medium.`height` | `unsigned integer` The image's height. |\n| `high` | `object` A high resolution version of the thumbnail image. For a video (or a resource that refers to a video), this image is 480px wide and 360px tall. For a channel, this image is 800px wide and 800px tall. |\n| high.`url` | `string` The image's URL. |\n| high.`width` | `unsigned integer` The image's width. |\n| high.`height` | `unsigned integer` The image's height. |\n| `standard` | `object` An even higher resolution version of the thumbnail image than the `high` resolution image. This image is available for some videos and other resources that refer to videos, like playlist items or search results. This image is 640px wide and 480px tall. |\n| standard.`url` | `string` The image's URL. |\n| standard.`width` | `unsigned integer` The image's width. |\n| standard.`height` | `unsigned integer` The image's height. |\n| `maxres` | `object` The highest resolution version of the thumbnail image. This image size is available for some videos and other resources that refer to videos, like playlist items or search results. This image is 1280px wide and 720px tall. |\n| maxres.`url` | `string` The image's URL. |\n| maxres.`width` | `unsigned integer` The image's width. |\n| maxres.`height` | `unsigned integer` The image's height. |"]]