The 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.
The steps below explain how to schedule reporting jobs and retrieve reports:
- Call the
reportTypes.list()
method to retrieve a list of reports that a channel or content owner can retrieve. - Call the
jobs.create()
method to identify a report that should be generated for a channel or content owner. You can subsequently use the API'sjobs.list()
andjobs.delete()
to retrieve or change the list of reports being generated. - Call the
jobs.reports.list()
method to retrieve a list of reports that have been generated for a particular job. Each resource in the response contains adownloadUrl
property that specifies the URL from which the report can be downloaded. - Send an authorized
GET
request to retrieve the report from the download URL.
Resource types
The 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
.
jobs
Methods | |
---|---|
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. |
delete |
DELETE /v1/jobs/{jobId} Deletes a reporting job. |
get |
GET /v1/jobs/{jobId} Retrieves information about a specific reporting job that has been scheduled for a channel or content owner. |
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. |
jobs.reports
Methods | |
---|---|
get |
GET /v1/jobs/{jobId}/reports/{reportId} Retrieves the metadata for a specific report. |
list |
GET /v1/jobs/{jobId}/reports Lists reports that have been generated for the specified reporting job. |
reportTypes
Methods | |
---|---|
list |
GET /v1/reportTypes Returns a list of report types that the channel or content owner can retrieve. |