Returns a collection of zero or more channel resources that match the request criteria.
Filters: Every request must specify exactly one of the following filter parameters: forHandle, forUsername, id, managedByMe, or mine. Omitting a filter or combining multiple filters returns an HTTP 400 error.
Authorization: Public channel data retrieved with the id, forHandle, or forUsername filter doesn't require authorization unless you request part=auditDetails. Requests that use mine, managedByMe, or onBehalfOfContentOwner require OAuth 2.0 authorization.
Requesting part=auditDetails requires an OAuth 2.0 token with the https://www.googleapis.com/auth/youtubepartner-channel-audit scope. If the request specifies parts other than id and auditDetails, the token must also include either the https://www.googleapis.com/auth/youtube.readonly or https://www.googleapis.com/auth/youtubepartner scope. The channel owner grants access during the audit process, and that access is revoked either when an audit decision is made or two weeks after authorization.
See the channels.list errors reference for error messages this method returns. For code examples, see channels.list code snippets.
HTTP request
GET https://youtube.googleapis.com/youtube/v3/channels
The URL uses gRPC Transcoding syntax.
Query parameters
| Parameters | |
|---|---|
mine |
Indicates whether to return only channels owned by the authenticated user. Set this parameter to |
id[] |
Specifies a comma-separated list of the YouTube channel ID(s) for the resource(s) that are being retrieved. A single request can specify up to 50 channel IDs. |
categoryId |
Deprecated: This parameter isn't supported. |
managedByMe |
Indicates whether to return only channels managed by the authenticated YouTube content owner. This parameter is intended only for YouTube content partners, and you must also set the |
forUsername |
Specifies a YouTube username, thereby requesting the channel associated with that username. |
forHandle |
Specifies a YouTube handle, thereby requesting the channel associated with that handle. The string can optionally begin with the |
hl |
Instructs the API to return localized resource metadata for a specific application language that the YouTube website supports. The API returns the localized metadata in |
maxResults |
Specifies the maximum number of items that should be returned in the result set. Acceptable values are |
pageToken |
Identifies a specific page in the result set that should be returned. In an API response, the |
part[] |
Required. Specifies a comma-separated list of one or more If the parameter identifies a property that contains child properties, the child properties are included in the response. For example, in a Valid part values are |
onBehalfOfContentOwner |
Indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and access all their video and channel data, without having to provide authentication credentials for each individual channel. You must use OAuth 2.0 authorization when setting this parameter, and the CMS account that the user authenticates with must be linked to the specified YouTube content owner. This parameter can't be combined with the |
Request body
The request body must be empty.
Response body
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{
"kind": string,
"etag": string,
"nextPageToken": string,
"prevPageToken": string,
"pageInfo": {
"totalResults": integer,
"resultsPerPage": integer
},
"items": [
{
object ( |
| Fields | |
|---|---|
kind |
Identifies what kind of resource this is. Value: the fixed string |
etag |
Etag of this resource. |
nextPageToken |
The token that can be used as the value of the |
prevPageToken |
The token that can be used as the value of the |
pageInfo |
General pagination information. |
pageInfo.totalResults |
The total number of results in the result set. |
pageInfo.resultsPerPage |
The number of results included in the API response. |
items[] |
A list of channels that match the request criteria. |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/youtubehttps://www.googleapis.com/auth/youtubepartnerhttps://www.googleapis.com/auth/youtubepartner-channel-audithttps://www.googleapis.com/auth/youtube.readonlyhttps://www.googleapis.com/auth/youtube.force-ssl
For more information, see the OAuth 2.0 Overview.