{"openapi":"3.0.0","info":{"description":"YouTube Analytics API provides targeted queries to generate custom YouTube Analytics reports for your channels and content owners: retrieve views, watch-time and revenue metrics, and manage analytics groups and group items. OAuth 2.0 (Google) with yt-analytics scopes.","version":[{"name":"v2","value":"v2"}]},"servers":[{"description":"YouTube Analytics API provides targeted queries to generate custom YouTube Analytics reports for your channels and content owners: retrieve views, watch-time and revenue metrics, and manage analytics groups and group items. OAuth 2.0 (Google) with yt-analytics scopes.","url":"https://api.apirails.com/youtubeanalytics"}],"paths":{"/v2/reports":{"get":{"tags":["Reports"],"parameters":[{"name":"currency","in":"query","description":"The currency to which financial metrics should be converted. The default is US Dollar (USD). If the result contains no financial metrics, this flag will be ignored. Responds with an error if the specified currency is not recognized.\", pattern: [A-Z]{3}","required":false,"schema":{"type":"string","example":""}},{"name":"dimensions","in":"query","description":"A comma-separated list of YouTube Analytics dimensions, such as `views` or `ageGroup,gender`. See the [Available Reports](/youtube/analytics/v2/available_reports) document for a list of the reports that you can retrieve and the dimensions used for those reports. Also see the [Dimensions](/youtube/analytics/v2/dimsmets/dims) document for definitions of those dimensions.\" pattern: [0-9a-zA-Z,]+","required":false,"schema":{"type":"string","example":""}},{"name":"endDate","in":"query","description":"The end date for fetching YouTube Analytics data. The value should be in `YYYY-MM-DD` format. required: true, pattern: [0-9]{4}-[0-9]{2}-[0-9]{2}","required":false,"schema":{"type":"string","example":""}},{"name":"filters","in":"query","description":"A list of filters that should be applied when retrieving YouTube Analytics data. The [Available Reports](/youtube/analytics/v2/available_reports) document identifies the dimensions that can be used to filter each report, and the [Dimensions](/youtube/analytics/v2/dimsmets/dims) document defines those dimensions. If a request uses multiple filters, join them together with a semicolon (`;`), and the returned result table will satisfy both filters. For example, a filters parameter value of `video==dMH0bHeiRNg;country==IT` restricts the result set to include data for the given video in Italy.\",","required":false,"schema":{"type":"string","example":""}},{"name":"ids","in":"query","description":"Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics data. - To request data for a YouTube user, set the `ids` parameter value to `channel==CHANNEL_ID`, where `CHANNEL_ID` specifies the unique YouTube channel ID. - To request data for a YouTube CMS content owner, set the `ids` parameter value to `contentOwner==OWNER_NAME`, where `OWNER_NAME` is the CMS name of the content owner. required: true, pattern: [a-zA-Z]+==[a-zA-Z0-9_+-]+","required":false,"schema":{"type":"string","example":""}},{"name":"includeHistoricalChannelData","in":"query","description":"If set to true historical data (i.e. channel data from before the linking of the channel to the content owner) will be retrieved.\",","required":false,"schema":{"type":"boolean","example":""}},{"name":"maxResults","in":"query","description":"The maximum number of rows to include in the response.\", minValue: 1","required":false,"schema":{"type":"integer","example":""}},{"name":"metrics","in":"query","description":"A comma-separated list of YouTube Analytics metrics, such as `views` or `likes,dislikes`. See the [Available Reports](/youtube/analytics/v2/available_reports) document for a list of the reports that you can retrieve and the metrics available in each report, and see the [Metrics](/youtube/analytics/v2/dimsmets/mets) document for definitions of those metrics. required: true, pattern: [0-9a-zA-Z,]+","required":false,"schema":{"type":"string","example":""}},{"name":"sort","in":"query","description":"A comma-separated list of dimensions or metrics that determine the sort order for YouTube Analytics data. By default the sort order is ascending. The '`-`' prefix causes descending sort order.\", pattern: [-0-9a-zA-Z,]+","required":false,"schema":{"type":"string","example":""}},{"name":"startDate","in":"query","description":"The start date for fetching YouTube Analytics data. The value should be in `YYYY-MM-DD` format. required: true, pattern: \"[0-9]{4}-[0-9]{2}-[0-9]{2}","required":false,"schema":{"type":"string","example":""}},{"name":"startIndex","in":"query","description":"An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter (one-based, inclusive).\", minValue: 1","required":false,"schema":{"type":"integer","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.google.com/youtube/analytics/reference/rest/v2/reports/query","api_endpoint":"https://youtubeanalytics.googleapis.com/v2/reports"},"summary":"Query reports","description":"Retrieve your YouTube Analytics reports for a channel or content owner","security":[{"bearerAuth":[]}]}},"/v2/groups":{"get":{"tags":["Groups"],"parameters":[{"name":"id","in":"query","description":"The `id` parameter specifies a comma-separated list of the YouTube group ID(s) for the resource(s) that are being retrieved. Each group must be owned by the authenticated user. In a `group` resource, the `id` property specifies the group's YouTube group ID. Note that if you do not specify a value for the `id` parameter, then you must set the `mine` parameter to `true`.","required":false,"schema":{"type":"string","example":""}},{"name":"mine","in":"query","description":"This parameter can only be used in a properly authorized request. Set this parameter's value to true to retrieve all groups owned by the authenticated user.","required":false,"schema":{"type":"boolean","example":""}},{"name":"onBehalfOfContentOwner","in":"query","description":"This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner.","required":false,"schema":{"type":"string","example":""}},{"name":"pageToken","in":"query","description":"The `pageToken` parameter identifies a specific page in the result set that should be returned. In an API response, the `nextPageToken` property identifies the next page that can be retrieved.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.google.com/youtube/analytics/reference/rest/v2/groups/list","api_endpoint":"https://youtubeanalytics.googleapis.com/v2/groups"},"summary":"List groups","description":"Returns a collection of groups that match the API request parameters","security":[{"bearerAuth":[]}]},"post":{"tags":["Groups"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.google.com/youtube/analytics/reference/rest/v2/groups/insert","api_endpoint":"https://youtubeanalytics.googleapis.com/v2/groups"},"summary":"Create group","description":"Creates a group","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"contentDetails":{"type":"object","description":"Group content details (item type).","properties":{"itemCount":{"type":"integer","description":"Output only. Number of items in the group."},"itemType":{"type":"string","description":"Type of resources the group contains: youtube#video, youtube#channel, or youtube#asset."}}},"snippet":{"type":"object","description":"Group metadata. title is required when creating a group.","properties":{"publishedAt":{"type":"string","description":"Output only. Date and time the group was created."},"title":{"type":"string","description":"Group name. Required on insert; changes the group title on update.","required":true}}}}},"example":{"contentDetails":{"itemType":"youtube#video"},"snippet":{"title":"My videos"}}}}}},"put":{"tags":["Groups"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.google.com/youtube/analytics/reference/rest/v2/groups/update","api_endpoint":"https://youtubeanalytics.googleapis.com/v2/groups"},"summary":"Update group","description":"Modifies a group (for example, changes its title)","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"contentDetails":{"type":"object","description":"Group content details (item type).","properties":{"itemCount":{"type":"integer","description":"Output only. Number of items in the group."},"itemType":{"type":"string","description":"Type of resources the group contains: youtube#video, youtube#channel, or youtube#asset."}}},"snippet":{"type":"object","description":"Group metadata. title is required when creating a group.","properties":{"publishedAt":{"type":"string","description":"Output only. Date and time the group was created."},"title":{"type":"string","description":"Group name. Required on insert; changes the group title on update.","required":true}}}}},"example":{"contentDetails":{"itemType":"youtube#video"},"snippet":{"title":"My videos"}}}}}},"delete":{"tags":["Groups"],"parameters":[{"name":"id","in":"query","description":"The `id` parameter specifies the YouTube group ID of the group that is being deleted.","required":false,"schema":{"type":"string","example":""}},{"name":"onBehalfOfContentOwner","in":"query","description":"This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.google.com/youtube/analytics/reference/rest/v2/groups/delete","api_endpoint":"https://youtubeanalytics.googleapis.com/v2/groups"},"summary":"Delete group","description":"Deletes a group","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v2/groupItems":{"get":{"tags":["Group Items"],"parameters":[{"name":"groupId","in":"query","description":"The `groupId` parameter specifies the unique ID of the group for which you want to retrieve group items.","required":false,"schema":{"type":"string","example":""}},{"name":"onBehalfOfContentOwner","in":"query","description":"This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner.","required":false,"schema":{"type":"string","example":""}},{"name":"pageToken","in":"query","description":"The pageToken parameter identifies a specific page of results to be returned.","schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.google.com/youtube/analytics/reference/rest/v2/groupItems/list","api_endpoint":"https://youtubeanalytics.googleapis.com/v2/groupItems"},"summary":"List group items","description":"Returns a collection of group items that match the API request parameters","security":[{"bearerAuth":[]}]},"post":{"tags":["Group Items"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.google.com/youtube/analytics/reference/rest/v2/groupItems/insert","api_endpoint":"https://youtubeanalytics.googleapis.com/v2/groupItems"},"summary":"Create group item","description":"Creates a group item (adds a channel/video/asset to a group)","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"snippet":{"type":"object","description":"Group item metadata: which group and which resource to add.","properties":{"groupId":{"type":"string","description":"ID of the group that contains the item. Required.","required":true},"resourceId":{"type":"object","description":"Resource (channel/video/asset) that is being added to the group.","required":true}}}}},"example":{"snippet":{"groupId":"ABxz...","resourceId":{"kind":"youtube#video","videoId":"dQw4w9WgXcQ"}}}}}}},"delete":{"tags":["Group Items"],"parameters":[{"name":"id","in":"query","description":"The `id` parameter specifies the YouTube group item ID of the group item that is being deleted.","required":false,"schema":{"type":"string","example":""}},{"name":"onBehalfOfContentOwner","in":"query","description":"This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.google.com/youtube/analytics/reference/rest/v2/groupItems/delete","api_endpoint":"https://youtubeanalytics.googleapis.com/v2/groupItems"},"summary":"Delete group item","description":"Removes an item from a group","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"security":[{"bearerAuth":[]}]}