Thumbnails
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
thumbnail
リソースは、リソースに関連付けられたさまざまなサムネイル画像サイズを識別します。サムネイル画像には次の特性があります。
- リソースの
snippet.thumbnails
プロパティは、そのリソースで使用可能なサムネイル画像を識別するオブジェクトです。 thumbnail
リソースには一連のオブジェクトが含まれています。各オブジェクトの名前(default
、medium
、high
など)は、サムネイル画像のサイズを表します。- さまざまな種類のリソースで、さまざまなサイズのサムネイル画像をサポートできます。
- さまざまな種類のリソースで、同じ名前のサムネイル画像に対してさまざまなサイズを定義できます。たとえば、
video
リソースの default
サムネイル画像は通常 120 x 90 ピクセルで、channel
リソースの default
サムネイル画像は通常 88 x 88 ピクセルです。 - 同じ種類のリソースで、元の画像や YouTube にアップロードされたコンテンツの解像度によって、特定の画像に対してさまざまなサイズのサムネイル画像を指定できます。たとえば HD 動画は、HD 以外の動画よりも高解像度のサムネイルをサポートできます。
- サムネイル画像のサイズに関する情報を含む各オブジェクトには、
width
プロパティと height
プロパティがあります。ただし width と height のプロパティがその画像に対して返されないことがあります。 - アップロードされたサムネイル画像が必要な寸法に一致しない場合、その画像はアスペクト比を変更することなく、正しいサイズに合わせてサイズ変更されます。画像はトリミングされませんが、サイズが正しくなるように黒いバーが含まれる場合があります。
メソッド
この API は、thumbnails
リソースに対して次のメソッドをサポートしています。
- set
- YouTube にカスタム動画サムネイルをアップロードし、動画に設定します。
リソース表現
次の JSON 構造は、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
}
}
プロパティ
次の表は、このリソースで使用されているプロパティの定義を示したものです。
プロパティ |
default |
object
デフォルトのサムネイル画像。動画(または、再生リストのアイテムや検索結果など、動画を参照するリソース)のデフォルト サムネイルは幅 120px、高さ 90px です。チャンネルのデフォルト サムネイルは幅 88px、高さ 88px です。 |
default.url |
string
画像の URL。 |
default.width |
unsigned integer
画像の幅。 |
default.height |
unsigned integer
画像の高さ。 |
medium |
object
サムネイル画像の高解像度版。動画(または動画を参照するリソース)の場合、この画像は幅 320px、高さ 180px です。チャンネルの場合は、幅 240px、高さ 240px です。 |
medium.url |
string
画像の URL。 |
medium.width |
unsigned integer
画像の幅。 |
medium.height |
unsigned integer
画像の高さ。 |
high |
object
サムネイル画像の高解像度バージョン。動画(または動画を参照するリソース)の場合、この画像は幅 480px、高さ 360px です。チャンネルの場合、幅 800px、高さ 800px です。 |
high.url |
string
画像の URL。 |
high.width |
unsigned integer
画像の幅。 |
high.height |
unsigned integer
画像の高さ。 |
standard |
object
high 解像度の画像よりもさらに高い解像度のサムネイル画像。この画像は、一部の動画と、動画を参照する他のリソース(再生リスト アイテムや検索結果など)で利用できます。この画像のサイズは幅 640 ピクセル、高さ 480 ピクセルです。 |
standard.url |
string
画像の URL。 |
standard.width |
unsigned integer
画像の幅。 |
standard.height |
unsigned integer
画像の高さ。 |
maxres |
object
サムネイル画像の最高解像度バージョン。この画像サイズは、一部の動画や、動画を参照する他のリソース(再生リスト アイテムや検索結果など)で利用できます。この画像のサイズは幅 1,280 ピクセル、高さ 720 ピクセルです。 |
maxres.url |
string
画像の URL。 |
maxres.width |
unsigned integer
画像の幅。 |
maxres.height |
unsigned integer
画像の高さ。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-21 UTC。
[null,null,["最終更新日 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. |"]]