YouTube Reporting API
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
La API de YouTube Reporting permite a los desarrolladores programar trabajos de informes y, luego, descargar los informes masivos generados. La API admite un conjunto predefinido de informes, cada uno de los cuales contiene un conjunto integral de datos de YouTube Analytics para un canal o propietario del contenido.
En los siguientes pasos, se explica cómo programar trabajos de informes y recuperar informes:
- Llama al método
reportTypes.list()
para recuperar una lista de informes que puede recuperar un canal o un propietario del contenido. - Llama al método
jobs.create()
para identificar un informe que se debe generar para un canal o propietario del contenido. Posteriormente, puedes usar jobs.list()
y jobs.delete()
de la API para recuperar o cambiar la lista de informes que se generan. - Llama al método
jobs.reports.list()
para recuperar una lista de los informes que se generaron para un trabajo en particular. Cada recurso de la respuesta contiene una propiedad downloadUrl
que especifica la URL desde la que se puede descargar el informe. - Envía una solicitud
GET
autorizada para recuperar el informe de la URL de descarga.
Autorización
Todas las solicitudes a la API de YouTube Reporting deben estar autorizadas. En la guía de autorización, se explica cómo usar el protocolo de OAuth 2.0 para recuperar tokens de autorización.
Las solicitudes a la API de YouTube Reporting usan los siguientes permisos de autorización:
Permisos |
https://www.googleapis.com/auth/yt-analytics.readonly |
Permite ver informes de YouTube Analytics sobre tu contenido de YouTube. Este alcance proporciona acceso a las métricas de actividad del usuario, como el número de reproducciones y de calificaciones. |
https://www.googleapis.com/auth/yt-analytics-monetary.readonly |
Permite ver informes monetarios de YouTube Analytics sobre tu contenido de YouTube. Este alcance proporciona acceso a las métricas de actividad del usuario y a las métricas de rendimiento de los anuncios y los ingresos estimados. |
Tipos de recursos
En las siguientes secciones, se proporcionan descripciones generales de los recursos y métodos de la API. Todos los URIs de métodos que se muestran en las tablas son relativos a https://youtubereporting.googleapis.com
.
Métodos |
create |
POST /v1/jobs
Crea un trabajo de informes. Cuando creas un trabajo de informes, le indicas a YouTube que genere ese informe a diario. El informe está disponible en un plazo de 24 horas a partir del momento en que se crea el trabajo. |
delete |
DELETE /v1/jobs/{jobId}
Borra un trabajo de informes. |
get |
GET /v1/jobs/{jobId}
Recupera información sobre un trabajo de informes específico que se programó para un canal o propietario del contenido. |
list |
GET /v1/jobs
Enumera los trabajos de informes que se programaron para un canal o propietario del contenido. Cada recurso de la respuesta contiene una propiedad id , que especifica el ID que YouTube usa para identificar de forma única el trabajo. Necesitas ese ID para recuperar la lista de informes que se generaron para el trabajo o para borrar el trabajo. |
Métodos |
get |
GET /v1/jobs/{jobId}/reports/{reportId}
Recupera los metadatos de un informe específico. |
list |
GET /v1/jobs/{jobId}/reports
Enumera los informes que se generaron para el trabajo de informes especificado. |
Métodos |
list |
GET /v1/reportTypes
Devuelve una lista de los tipos de informes que puede recuperar el propietario del canal o del contenido. |
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 YouTube Reporting API allows developers to schedule and download bulk reports containing comprehensive YouTube Analytics data for channels or content owners.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use the API to retrieve a list of available reports, create jobs to generate reports, and manage these jobs through listing and deletion.\u003c/p\u003e\n"],["\u003cp\u003eGenerated reports can be downloaded via a specified URL obtained from the API's response, after retrieving them by using the \u003ccode\u003ejobs.reports.list()\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThe API requires OAuth 2.0 authorization, and provides scopes for viewing user activity metrics (\u003ccode\u003ehttps://www.googleapis.com/auth/yt-analytics.readonly\u003c/code\u003e) and monetary reports (\u003ccode\u003ehttps://www.googleapis.com/auth/yt-analytics-monetary.readonly\u003c/code\u003e).\u003c/p\u003e\n"]]],["Developers use the YouTube Reporting API to schedule and download bulk reports containing YouTube Analytics data. Key actions include: listing available report types via `reportTypes.list()`, creating reporting jobs with `jobs.create()`, and managing jobs using `jobs.list()` and `jobs.delete()`. To get data, retrieve generated reports for a specific job with `jobs.reports.list()`, each with a downloadable URL. Finally, you can request the download using the given URL. All actions require authorization via OAuth 2.0.\n"],null,["# YouTube Reporting API\n\nThe YouTube Reporting API enables developers to schedule reporting jobs and then download generated bulk reports. The API supports a predefined set of reports, each of which contains a comprehensive set of YouTube Analytics data for a channel or content owner.\n\nThe steps below explain how to schedule reporting jobs and retrieve reports:\n\n1. Call the [reportTypes.list()](/youtube/reporting/v1/reference/rest/v1/reportTypes/list) method to retrieve a list of reports that a channel or content owner can retrieve.\n2. Call the [jobs.create()](/youtube/reporting/v1/reference/rest/v1/jobs/create) method to identify a report that should be generated for a channel or content owner. You can subsequently use the API's [jobs.list()](/youtube/reporting/v1/reference/rest/v1/jobs/list) and [jobs.delete()](/youtube/reporting/v1/reference/rest/v1/jobs/delete) to retrieve or change the list of reports being generated.\n3. Call the [jobs.reports.list()](/youtube/reporting/v1/reference/rest/v1/jobs.reports/list) method to retrieve a list of reports that have been generated for a particular job. Each resource in the response contains a [downloadUrl](/youtube/reporting/v1/reference/rest/v1/jobs.reports#downloadUrl) property that specifies the URL from which the report can be downloaded.\n4. Send an authorized `GET` request to retrieve the report from the download URL.\n\n\u003cbr /\u003e\n\nAuthorization\n-------------\n\nAll YouTube Reporting API requests must be authorized. The [Authorization guide](/youtube/reporting/guides/authorization) explains how to use the OAuth 2.0 protocol to retrieve authorization tokens.\n\nYouTube Reporting API requests use the following authorization scopes:\n\n| Scopes ||\n|----------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| https://www.googleapis.com/auth/yt-analytics.readonly | View YouTube Analytics reports for your YouTube content. This scope provides access to user activity metrics, like view counts and rating counts. |\n| https://www.googleapis.com/auth/yt-analytics-monetary.readonly | View YouTube Analytics monetary reports for your YouTube content. This scope provides access to user activity metrics and to estimated revenue and ad performance metrics. |\n\nResource types\n--------------\n\nThe following sections provide general descriptions of the API's resources and methods. All method URIs shown in the tables are relative to `https://youtubereporting.googleapis.com`.\n\n### [jobs](/youtube/reporting/v1/reference/rest/v1/jobs)\n\n| Methods ||\n|---------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [create](/youtube/reporting/v1/reference/rest/v1/jobs/create) | `POST /v1/jobs` Creates a reporting job. By creating a reporting job, you are instructing YouTube to generate that report on a daily basis. The report is available within 24 hours of the time that the job is created. |\n| [delete](/youtube/reporting/v1/reference/rest/v1/jobs/delete) | `DELETE /v1/jobs/{jobId}` Deletes a reporting job. |\n| [get](/youtube/reporting/v1/reference/rest/v1/jobs/get) | `GET /v1/jobs/{jobId}` Retrieves information about a specific reporting job that has been scheduled for a channel or content owner. |\n| [list](/youtube/reporting/v1/reference/rest/v1/jobs/list) | `GET /v1/jobs` Lists reporting jobs that have been scheduled for a channel or content owner. Each resource in the response contains an `id` property, which specifies the ID that YouTube uses to uniquely identify the job. You need that ID to retrieve the list of reports that have been generated for the job or to delete the job. |\n\n### [jobs.reports](/youtube/reporting/v1/reference/rest/v1/jobs.reports)\n\n| Methods ||\n|-------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|\n| [get](/youtube/reporting/v1/reference/rest/v1/jobs.reports/get) | `GET /v1/jobs/{jobId}/reports/{reportId}` Retrieves the metadata for a specific report. |\n| [list](/youtube/reporting/v1/reference/rest/v1/jobs.reports/list) | `GET /v1/jobs/{jobId}/reports` Lists reports that have been generated for the specified reporting job. |\n\n### [reportTypes](/youtube/reporting/v1/reference/rest/v1/reportTypes)\n\n| Methods ||\n|------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|\n| [list](/youtube/reporting/v1/reference/rest/v1/reportTypes/list) | `GET /v1/reportTypes` Returns a list of report types that the channel or content owner can retrieve. |"]]