AI-generated Key Takeaways
-
The YouTube Analytics API allows retrieval of YouTube Analytics data for channels or content owners, supporting real-time queries to generate reports.
-
The API offers report retrieval via the
reports.querymethod, allowing specification of metrics, dimensions, filters, and sorting instructions, all defined by request parameters. -
YouTube Analytics groups are customizable collections of up to 500 channels, videos, playlists, or assets, which help in aggregating data for performance analysis and are manageable through the API.
-
Authorization for API requests requires OAuth 2.0 and uses specific scopes, such as
yt-analytics.readonlyfor viewing user activity metrics andyt-analytics-monetary.readonlyfor viewing financial reports. -
The API provides methods to manage YouTube Analytics groups including creating, listing, updating, and deleting groups and their items, with channels, videos, playlists, and assets being the acceptable components.
The YouTube Analytics API allows you to retrieve YouTube Analytics data for a YouTube channel or content owner. The API supports real-time queries and generates a report based on the API request parameters.
The API supports two types of functions:
-
Report retrieval – The API's
reports.querymethod retrieves YouTube Analytics reports. -
YouTube Analytics group management – A YouTube Analytics group is a custom collection of up to 500 channels, videos, playlists, or assets. The API supports several methods to create, retrieve, and update YouTube Analytics groups. Channel and content owners can then use the
reports.querymethod to retrieve aggregated data for all of the items in a group, which can aid performance analysis.
This page provides a brief overview of the API resources and methods that enable these functions.
Authorization
All YouTube Analytics API requests must be authorized. The Authorization guide explains how to use the OAuth 2.0 protocol to retrieve authorization tokens.
YouTube Analytics API requests use the following authorization scopes:
Report retrieval
The API's reports.query
method lets you retrieve many different YouTube Analytics reports. Each request uses query parameters to specify a channel ID or content owner, a start date, an end date, and at least one metric. You can also provide additional query parameters, such as dimensions, filters, and sorting instructions.
https://youtubeanalytics.googleapis.com/v2
GET /reports
- Metricsare individual measurements of user activity, such as video views or ratings (likes and dislikes).
- Dimensionsare common criteria that are used to aggregate data, such as the date on which the user activity occurred or the country where the users were located. In a report, each row of data has a unique combination of dimension values.
- Filtersare dimension values that specify the data that will be retrieved. For example, you could retrieve data for a specific country, a specific video, or a group of videos.
Group management
The API provides two resources for creating and managing YouTube Analytics groups:
Groups
A group
resource represents a YouTube Analytics group, which is a custom collection of up to 500 channels, videos, playlists, or assets.
All of the items in a group must represent the same type of resource. For example, you cannot create a group that contains 100 videos and 100 playlists.
An Analytics group can only contain resources that you have uploaded or claimed or that are linked to a channel that you administer. As a result, channel owners can create groups of videos and playlists. Content owners can create groups of videos, playlists, channels, or assets.
For more information about this resource, see its resource representation and list of properties .
https://youtubeanalytics.googleapis.com/v2
GET /groups
POST /groups
groupItems.insert
method to add items to the group.PUT /groups
groupItems.insert
and groupItems.delete
to add and remove group items.)GroupItems
A groupItem
resource represents an item in a YouTube Analytics group.
For more information about this resource, see its resource representation and list of properties .

