Method: subscriptions.list

Returns subscription resources that match the API request criteria.

Requests that use channelId to retrieve public subscriptions don't require OAuth 2.0 authorization. Requests that use id, mine, mySubscribers, or myRecentSubscribers require OAuth 2.0 authorization. For method-specific error responses, see subscriptions.list errors. For code examples, see subscriptions.list code snippets.

HTTP request

GET https://youtube.googleapis.com/youtube/v3/subscriptions

The URL uses gRPC Transcoding syntax.

Query parameters

Parameters
id[]

string

Specifies a comma-separated list of up to 50 YouTube subscription IDs to retrieve. Specify exactly one filter parameter (channelId, id, mine, myRecentSubscribers, or mySubscribers).

Requires OAuth 2.0 authorization and returns only subscriptions belonging to the authenticated user (IDs belonging to other users are skipped).

mine

boolean

Set to true to retrieve a feed of the authenticated user's subscriptions (setting false fails with HTTP 400). Requires OAuth 2.0 authorization. Specify exactly one filter parameter (channelId, id, mine, myRecentSubscribers, or mySubscribers).

channelId

string

Specifies a YouTube channel ID to return that channel's public subscriptions (or the authenticated user's subscriptions when matching the caller's channel). Requests for public subscriptions don't require OAuth 2.0 authorization. Specify exactly one filter parameter (channelId, id, mine, myRecentSubscribers, or mySubscribers).

forChannelId

string

Specifies a comma-separated list of channel IDs. The API response includes only subscriptions matching those channels.

order

enum

Specifies how to sort returned subscriptions when listing the authenticated user's own subscriptions (mine=true, or channelId matching the caller); ignored for other filters. The default value is relevance. Valid values are alphabetical (sort alphabetically), relevance (sort by relevance), and unread (sort by order of activity).

Valid values of this enum field are:

  • relevance
  • unread
  • alphabetical
mySubscribers

boolean

Set to true to retrieve subscribers of the authenticated user who have made their subscriptions public, sorted in reverse chronological order (newest first), up to 1,000 results. Only true is supported. Requires OAuth 2.0 authorization. Specify exactly one filter parameter (channelId, id, mine, myRecentSubscribers, or mySubscribers).

myRecentSubscribers

boolean

Set to true to retrieve subscribers of the authenticated user who have made their subscriptions public, sorted in reverse chronological order (newest first), up to 1,000 results. Only true is supported. Requires OAuth 2.0 authorization. Specify exactly one filter parameter (channelId, id, mine, myRecentSubscribers, or mySubscribers).

maxResults

integer (uint32 format)

Specifies the maximum number of items 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 to return (up to 1,000 reachable results). In an API response, the nextPageToken and prevPageToken properties identify other pages that can be retrieved.

part[]

string

Required. Specifies a comma-separated list of one or more subscription 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 subscription resource, the snippet property contains other properties, such as a display title for the subscription. Setting part=snippet returns all of those nested properties.

Valid values are contentDetails, id, snippet, and subscriberSnippet.

onBehalfOfContentOwner

string

Intended exclusively for YouTube content partners. Indicates that the request's authorization credentials identify a YouTube CMS user acting on behalf of the content owner specified in the parameter value. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.

Although the API validates content owner authorization (and requires onBehalfOfContentOwnerChannel when combined with mine=true), subscriptions.list doesn't support channel delegation and evaluates user-scoped filters (mine, id, mySubscribers, and myRecentSubscribers) against the authenticated user's account.

onBehalfOfContentOwnerChannel

string

Intended exclusively for YouTube content partners and valid only in a properly authorized request. Specifies a YouTube channel ID and can only be used together with onBehalfOfContentOwner, which is required when specifying this parameter. The authenticating CMS account must be linked to the specified content owner and have reader permissions on the specified channel.

Although the API validates these permissions, subscriptions.list doesn't delegate subscription queries to the specified channel and evaluates user-scoped filters (mine, id, mySubscribers, and myRecentSubscribers) against the authenticated user's account.

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

string

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

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.

pageInfo

object

General pagination information for the result set.

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 (Subscription)

A list of subscriptions 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/youtube.readonly
  • https://www.googleapis.com/auth/youtube.force-ssl

For more information, see the OAuth 2.0 Overview.