Method: channels.list

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

boolean

Indicates whether to return only channels owned by the authenticated user. Set this parameter to true to instruct the API to only return channels owned by the authenticated user.

id[]

string

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)

string

Deprecated: This parameter isn't supported.

managedByMe

boolean

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 onBehalfOfContentOwner parameter.

forUsername

string

Specifies a YouTube username, thereby requesting the channel associated with that username.

forHandle

string

Specifies a YouTube handle, thereby requesting the channel associated with that handle. The string can optionally begin with the @ symbol. For example, specify GoogleDevelopers or @GoogleDevelopers for the Google for Developers channel.

hl

string

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 snippet.localized. If no localization exists for the specified language, the API falls back to snippet.defaultLanguage. The parameter value must be a language code included in the list returned by the i18nLanguages.list method of the i18nLanguages resource (for example, en_US or es_MX).

maxResults

integer (uint32 format)

Specifies the maximum number of items that should be returned in the result set. Acceptable values are 0 to 50, inclusive. The default value is 5.

pageToken

string

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.

part[]

string

Required. Specifies a comma-separated list of one or more channel resource properties that the API response includes.

If the parameter identifies a property that contains child properties, the child properties are included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as uploads. As such, if you set part=contentDetails, the API response also contains all of those nested properties.

Valid part values are auditDetails, brandingSettings, contentDetails, contentOwnerDetails, id, localizations, snippet, statistics, status, and topicDetails.

onBehalfOfContentOwner

string

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 mine filter, and is intended for use with the id and managedByMe filters.

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 (Channel)
    }
  ]
}
Fields
kind

string

Identifies what kind of resource this is. Value: the fixed string "youtube#channelListResponse".

etag

string

Etag of this resource.

nextPageToken

string

The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set.

prevPageToken

string

The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set. The channels.list method doesn't populate this property.

pageInfo

object

General pagination information.

pageInfo.totalResults

integer

The total number of results in the result set.

pageInfo.resultsPerPage

integer

The number of results included in the API response.

items[]

object (Channel)

A list of channels that match the request criteria.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/youtube
  • https://www.googleapis.com/auth/youtubepartner
  • https://www.googleapis.com/auth/youtubepartner-channel-audit
  • https://www.googleapis.com/auth/youtube.readonly
  • https://www.googleapis.com/auth/youtube.force-ssl

For more information, see the OAuth 2.0 Overview.