Actualizaremos la API de datos para que coincida con la forma en que YouTube cuenta las vistas de Shorts.
Más información
ChannelBanners
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Un recurso channelBanner
contiene la URL que usarías para establecer una imagen recién subida como la imagen del banner de un canal.
Métodos
La API admite los siguientes métodos para los recursos channelBanners
:
- insertar
- Sube una imagen de banner del canal a YouTube. Este método representa los dos primeros pasos de un proceso de tres pasos para actualizar la imagen del banner de un canal:
- Llama al método
channelBanners.insert
para subir los datos de la imagen binaria a YouTube. La imagen debe tener una relación de aspecto de 16:9 y un tamaño mínimo de 2048 x 1152 píxeles. Te recomendamos que subas una imagen de 2560 × 1440 px. - Extrae el valor de la propiedad
url
de la respuesta que muestra la API para el paso 1. - Llama al método
channels.update
para actualizar la configuración de desarrollo de la marca del canal. Establece el valor de la propiedad brandingSettings.image.bannerExternalUrl
en la URL que obtuviste en el paso 2.
Representación de recursos
En la siguiente estructura JSON, se muestra el formato de un recurso channelBanners
:
{
"kind": "youtube#channelBannerResource",
"etag": etag,
"url": string
}
Propiedades
La siguiente tabla define las propiedades que aparecen en este recurso:
Propiedades |
kind |
string
Identifica el tipo de recurso de la API. El valor será youtube#channelBannerResource . |
etag |
etag
Es la etiqueta de Etag de este recurso. |
url |
string
Es la URL de la imagen del banner. Después de llamar al método channelBanners.insert , extrae este valor de la respuesta de la API. Luego, llama al método channels.update y establece la URL como el valor de la propiedad brandingSettings.image.bannerExternalUrl para establecer la imagen del banner de un canal. |
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\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. |"]]