YouTube Reporting API
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
YouTube Reporting API を使用すると、レポート作成ジョブのスケジュールを設定し、生成された一括レポートをダウンロードできます。この API は、事前定義された一連のレポートをサポートしています。各レポートには、チャンネルまたはコンテンツ所有者の YouTube アナリティクス データが包括的に含まれています。
レポート ジョブのスケジュール設定とレポートの取得の手順は次のとおりです。
reportTypes.list()
メソッドを呼び出して、チャンネルまたはコンテンツ所有者が取得できるレポートのリストを取得します。 jobs.create()
メソッドを呼び出して、チャンネルまたはコンテンツ所有者向けに生成する必要があるレポートを特定します。その後、API の jobs.list()
と jobs.delete()
を使用して、生成されるレポートのリストを取得または変更できます。 jobs.reports.list()
メソッドを呼び出して、特定のジョブ用に生成されたレポートのリストを取得します。レスポンス内の各リソースには、レポートをダウンロードできる URL を指定する downloadUrl
プロパティが含まれています。 - 承認済みの
GET
リクエストを送信して、ダウンロード URL からレポートを取得します。
承認
YouTube Reporting API へのすべてのリクエストは承認を受ける必要があります。認可ガイドでは、OAuth 2.0 プロトコルを使用して認可トークンを取得する方法について説明しています。
YouTube Reporting API リクエストでは、次の認証スコープが使用されます。
スコープ |
https://www.googleapis.com/auth/yt-analytics.readonly |
YouTube コンテンツの YouTube アナリティクス レポートを表示します。このスコープは再生回数や評価数など、ユーザー アクティビティの指標へのアクセスを提供します。 |
https://www.googleapis.com/auth/yt-analytics-monetary.readonly |
YouTube コンテンツに関する YouTube アナリティクス収益レポートを表示します。このスコープは、ユーザー アクティビティの指標と、推定収益と広告パフォーマンスの指標へのアクセスを提供します。 |
リソースタイプ
以降のセクションでは、API のリソースとメソッドの概要について説明します。表に示されているメソッド URI はすべて、https://youtubereporting.googleapis.com
に対する相対 URI です。
メソッド |
create |
POST /v1/jobs
レポートジョブを作成します。レポートジョブを作成すると、YouTube にそのレポートを毎日生成するよう指示することになります。レポートは、ジョブの作成後 24 時間以内に利用可能になります。 |
delete |
DELETE /v1/jobs/{jobId}
レポートジョブを削除します。 |
get |
GET /v1/jobs/{jobId}
チャンネルまたはコンテンツ所有者に対してスケジュールされた特定のレポートジョブに関する情報を取得します。 |
list |
GET /v1/jobs
チャンネルまたはコンテンツ所有者に対してスケジュール設定されたレポート ジョブを一覧表示します。レスポンス内の各リソースには id プロパティが含まれています。このプロパティは、YouTube がジョブを一意に識別するために使用する ID を指定します。この ID は、ジョブ用に生成されたレポートのリストを取得したり、ジョブを削除したりするために必要です。 |
メソッド |
get |
GET /v1/jobs/{jobId}/reports/{reportId}
特定のレポートのメタデータを取得します。 |
list |
GET /v1/jobs/{jobId}/reports
指定されたレポートジョブ用に生成されたレポートを一覧表示します。 |
メソッド |
list |
GET /v1/reportTypes
チャンネルまたはコンテンツ所有者が取得できるレポート タイプのリストを返します。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-21 UTC。
[null,null,["最終更新日 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. |"]]