Nous mettons à jour l'API Data pour qu'elle corresponde à la façon dont YouTube comptabilise les vues des Shorts.
En savoir plus
ChannelBanners
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Une ressource channelBanner
contient l'URL que vous utiliserez pour définir une image nouvellement importée comme bannière d'une chaîne.
Méthodes
L'API prend en charge les méthodes suivantes pour les ressources channelBanners
:
- insérer
- Met en ligne une image de bannière de chaîne sur YouTube. Cette méthode représente les deux premières étapes d'un processus en trois étapes pour modifier l'image de la bannière d'une chaîne:
- Appelez la méthode
channelBanners.insert
pour mettre en ligne les données d'image binaires sur YouTube. L'image doit être au format 16:9 et mesurer au moins 2 048 x 1 152 pixels. Nous vous recommandons d'importer une image de 2 560 x 1 440 pixels. - Extrayez la valeur de la propriété
url
de la réponse renvoyée par l'API pour l'étape 1. - Appelez la méthode
channels.update
pour mettre à jour les paramètres de branding de la chaîne. Définissez la valeur de la propriété brandingSettings.image.bannerExternalUrl
sur l'URL obtenue à l'étape 2.
Représentation de la ressource
La structure JSON suivante montre le format d'une ressource channelBanners
:
{
"kind": "youtube#channelBannerResource",
"etag": etag,
"url": string
}
Propriétés
Le tableau suivant définit les propriétés qui apparaissent dans cette ressource:
Propriétés |
kind |
string
Identifie le type de la ressource API. La valeur sera youtube#channelBannerResource . |
etag |
etag
Etag de cette ressource. |
url |
string
URL de l'image de la bannière. Après avoir appelé la méthode channelBanners.insert , extrayez cette valeur de la réponse de l'API. Appelez ensuite la méthode channels.update et définissez l'URL comme valeur de la propriété brandingSettings.image.bannerExternalUrl pour définir l'image de bannière d'une chaîne. |
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/08/21 (UTC).
[null,null,["Dernière mise à jour le 2025/08/21 (UTC)."],[[["\u003cp\u003eThe \u003ccode\u003echannelBanner\u003c/code\u003e resource provides the URL needed to set a newly uploaded image as a channel's banner image.\u003c/p\u003e\n"],["\u003cp\u003eUpdating a channel banner image involves a three-step process, starting with uploading the image using the \u003ccode\u003echannelBanners.insert\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThe uploaded banner image must have a 16:9 aspect ratio and be at least 2048x1152 pixels, with 2560x1440 recommended.\u003c/p\u003e\n"],["\u003cp\u003eAfter uploading, the \u003ccode\u003eurl\u003c/code\u003e property from the API response is extracted, and then used in the \u003ccode\u003echannels.update\u003c/code\u003e method, specifically in the \u003ccode\u003ebrandingSettings.image.bannerExternalUrl\u003c/code\u003e property, to set the banner image.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003echannelBanners\u003c/code\u003e resource contains \u003ccode\u003ekind\u003c/code\u003e, \u003ccode\u003eetag\u003c/code\u003e, and \u003ccode\u003eurl\u003c/code\u003e properties, with the \u003ccode\u003eurl\u003c/code\u003e property holding the banner image's URL.\u003c/p\u003e\n"]]],["The `channelBanner` resource provides a URL for setting a channel's banner image. Updating a banner involves three steps: first, use `channelBanners.insert` to upload an image (16:9 aspect ratio, at least 2048x1152 pixels). Second, extract the `url` from the response. Third, use `channels.update`, setting `brandingSettings.image.bannerExternalUrl` to the extracted URL. The resource includes `kind` (`youtube#channelBannerResource`), `etag`, and the banner image's `url`.\n"],null,["# ChannelBanners\n\nA `channelBanner` resource contains the URL that you would use to set a newly uploaded image as the banner image for a channel.\n\nMethods\n-------\n\nThe API supports the following methods for `channelBanners` resources:\n\n[insert](/youtube/v3/docs/channelBanners/insert)\n: Uploads a channel banner image to YouTube. This method represents the first two steps in a three-step process to update the banner image for a channel:\n\n 1. Call the [channelBanners.insert](/youtube/v3/docs/channelBanners/insert) method to upload the binary image data to YouTube. The image must have a 16:9 aspect ratio and be at least 2048x1152 pixels. We recommend uploading a 2560px by 1440px image.\n 2. Extract the `url` property's value from the response that the API returns for step 1.\n 3. Call the [channels.update](/youtube/v3/docs/channels/update) method to update the channel's branding settings. Set the [brandingSettings.image.bannerExternalUrl](/youtube/v3/docs/channels#brandingSettings.image.bannerExternalUrl) property's value to the URL obtained in step 2.\n\nResource representation\n-----------------------\n\nThe following JSON structure shows the format of a `channelBanners` resource: \n\n```text\n{\n \"kind\": \"youtube#channelBannerResource\",\n \"etag\": etag,\n \"url\": string\n}\n```\n\n### Properties\n\nThe following table defines the properties that appear in this resource:\n\n| Properties ||\n|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Identifies the API resource's type. The value will be `youtube#channelBannerResource`. |\n| `etag` | `etag` The Etag of this resource. |\n| `url` | `string` The banner image's URL. After calling the [channelBanners.insert](/youtube/v3/docs/channelBanners/insert) method, extract this value from the API response. Then call the [channels.update](/youtube/v3/docs/channels/update) method, and set the URL as the value of the [brandingSettings.image.bannerExternalUrl](/youtube/v3/docs/channels#brandingSettings.image.bannerExternalUrl) property to set the banner image for a channel. |"]]