Stiamo aggiornando l'API Data in modo che corrisponda al modo in cui YouTube conteggia le visualizzazioni di Shorts.
Scopri di più
Thumbnails
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Una risorsa thumbnail
identifica le diverse dimensioni delle immagini in miniatura associate a una risorsa. Tieni presente le seguenti caratteristiche delle immagini in miniatura:
- La proprietà
snippet.thumbnails
di una risorsa è un oggetto che identifica le immagini in miniatura disponibili per quella risorsa. - Una risorsa
thumbnail
contiene una serie di oggetti. Il nome di ogni oggetto (default
, medium
, high
e così via) si riferisce alle dimensioni dell'immagine in miniatura. - Diversi tipi di risorse possono supportare dimensioni diverse delle immagini in miniatura.
- Diversi tipi di risorse possono definire dimensioni diverse per le immagini in miniatura con lo stesso nome. Ad esempio, l'immagine in miniatura
default
per una risorsa video
è in genere 120 x 90 px, mentre l'immagine in miniatura default
per una risorsa channel
è in genere 88 x 88 px. - Le risorse dello stesso tipo potrebbero comunque avere dimensioni diverse delle immagini in miniatura per determinate immagini, a seconda della risoluzione dell'immagine o dei contenuti originali caricati su YouTube. Ad esempio, un video HD potrebbe supportare miniature con una risoluzione più elevata rispetto ai video non HD.
- Ogni oggetto che contiene informazioni sulle dimensioni di un'immagine in miniatura ha una proprietà
width
e una proprietà height
. Tuttavia, le proprietà di larghezza e altezza potrebbero non essere restituite per l'immagine. - Se un'immagine in miniatura caricata non corrisponde alle dimensioni richieste, viene ridimensionata in modo da corrispondere alle dimensioni corrette senza modificarne le proporzioni. L'immagine non è ritagliata, ma potrebbe includere barre nere per garantire le dimensioni corrette.
Metodi
L'API supporta i seguenti metodi per le risorse thumbnails
:
- set
- Carica una miniatura personalizzata su YouTube e la imposta per un video.
Rappresentazione delle risorse
La seguente struttura JSON mostra il formato di una risorsa 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
}
}
Proprietà
La tabella seguente definisce le proprietà visualizzate in questa risorsa:
Proprietà |
default |
object
L'immagine in miniatura predefinita. La miniatura predefinita per un video o una risorsa che fa riferimento a un video, ad esempio un elemento di una playlist o un risultato di ricerca, ha una larghezza di 120 px e un'altezza di 90 px. La miniatura predefinita per un canale è larga 88 px e alta 88 px. |
default.url |
string
L'URL dell'immagine. |
default.width |
unsigned integer
La larghezza dell'immagine. |
default.height |
unsigned integer
L'altezza dell'immagine. |
medium |
object
Una versione ad alta risoluzione dell'immagine in miniatura. Per un video (o una risorsa che fa riferimento a un video), questa immagine ha una larghezza di 320 px e un'altezza di 180 px. Per un canale, questa immagine misura 240 px di larghezza e 240 px di altezza. |
medium.url |
string
L'URL dell'immagine. |
medium.width |
unsigned integer
La larghezza dell'immagine. |
medium.height |
unsigned integer
L'altezza dell'immagine. |
high |
object
Una versione ad alta risoluzione dell'immagine in miniatura. Per un video (o una risorsa che fa riferimento a un video), questa immagine ha una larghezza di 480 px e un'altezza di 360 px. Per un canale, questa immagine ha una larghezza di 800 px e un'altezza di 800 px. |
high.url |
string
L'URL dell'immagine. |
high.width |
unsigned integer
La larghezza dell'immagine. |
high.height |
unsigned integer
L'altezza dell'immagine. |
standard |
object
Una versione dell'immagine in miniatura con una risoluzione ancora più elevata rispetto all'immagine con risoluzione high . Questa immagine è disponibile per alcuni video e altre risorse che fanno riferimento ai video, come gli elementi delle playlist o i risultati di ricerca. Questa immagine ha una larghezza di 640 px e un'altezza di 480 px. |
standard.url |
string
L'URL dell'immagine. |
standard.width |
unsigned integer
La larghezza dell'immagine. |
standard.height |
unsigned integer
L'altezza dell'immagine. |
maxres |
object
La versione con la risoluzione più alta dell'immagine in miniatura. Questa dimensione dell'immagine è disponibile per alcuni video e altre risorse che fanno riferimento ai video, come gli elementi delle playlist o i risultati di ricerca. Questa immagine ha una larghezza di 1280 px e un'altezza di 720 px. |
maxres.url |
string
L'URL dell'immagine. |
maxres.width |
unsigned integer
La larghezza dell'immagine. |
maxres.height |
unsigned integer
L'altezza dell'immagine. |
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-08-21 UTC.
[null,null,["Ultimo aggiornamento 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. |"]]