アプリケーションで他のスコープへのアクセスをリクエストする必要が生じることもあります。たとえば、YouTube Analytics API と YouTube Data API を呼び出すアプリケーションで、YouTube アカウントへのアクセスをユーザーに許可しなければならない場合があります。承認の概要では、YouTube Analytics API を呼び出すアプリケーションでよく使われるスコープを識別します。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2023-02-22 UTC。"],[[["This sample code uses the Google APIs Client Library for JavaScript to retrieve daily views and other metrics for a YouTube channel for the 2017 calendar year, utilizing the YouTube Analytics API."],["The code requests user permission to access the `https://www.googleapis.com/auth/yt-analytics.readonly` scope to read YouTube Analytics data."],["Setting up authorization credentials in the Google API Console is required, including creating an OAuth client ID, enabling the YouTube Analytics API, and entering authorized JavaScript origins."],["The sample requires replacing `\u003cvar translate=\"no\"\u003eYOUR_CLIENT_ID\u003c/var\u003e` with the client ID obtained from the Google API Console in order to run."],["To run the code, users must authorize the application, load the API client, and execute the API query by clicking buttons in the browser, with successful operations and responses being logged in the browser's console."]]],["The code uses the Google APIs Client Library for JavaScript to retrieve YouTube channel statistics. It requires user authorization for the `https://www.googleapis.com/auth/yt-analytics.readonly` scope. Users need to create authorization credentials in the Google API Console, enabling the YouTube Analytics API. The client ID must be added to the code sample, which is loaded from a specified URL. Upon running, the code allows authorization and data retrieval, displaying daily channel metrics (views, watch time, etc.) for 2017.\n"]]