AI-generated Key Takeaways
-
A YouTube subscription notifies users about new videos or actions on a channel, such as uploads, ratings, or comments.
-
The API supports methods to list, insert, and delete subscription resources, allowing for management of user subscriptions.
-
Subscription resources contain details like the subscription's title, the channel subscribed to, creation time, and thumbnail images.
-
Content details in a subscription resource include the total item count, new item count, and the type of activity the subscription covers.
-
The subscription resource contains information about the subscriber, such as title, description, and thumbnails.
A subscription resource contains information about a YouTube user subscription. A subscription notifies a user when new videos are added to a channel or when another user takes one of several actions on YouTube, such as uploading a video, rating a video, or commenting on a video.
Methods
The API supports the following methods for subscriptions resources:
- list
- Returns subscription resources that match the API request criteria. Try it now.
- insert
- Adds a subscription for the authenticated user's channel. Try it now.
- delete
- Deletes a subscription. Try it now.
Resource representation
The following JSON structure shows the format of a subscriptions resource:
{
"kind": "youtube#subscription",
"etag": etag,
"id": string,
"snippet": {
"publishedAt": datetime,
"channelTitle": string,
"title": string,
"description": string,
"resourceId": {
"kind": string,
"channelId": string,
},
"channelId": string,
"thumbnails": {
(key): {
"url": string,
"width": unsigned integer,
"height": unsigned integer
}
}
},
"contentDetails": {
"totalItemCount": unsigned integer,
"newItemCount": unsigned integer,
"activityType": string
},
"subscriberSnippet": {
"title": string,
"description": string,
"channelId": string,
"thumbnails": {
(key): {
"url": string,
"width": unsigned integer,
"height": unsigned integer
}
}
}
}Properties
The following table defines the properties that appear in this resource:
| Properties | |
|---|---|
kind |
stringIdentifies the API resource's type. The value will be youtube#subscription. |
etag |
etagThe Etag of this resource. |
id |
stringThe ID that YouTube uses to uniquely identify the subscription. |
snippet |
objectThe snippet object contains basic details about the subscription, including its title and the channel that the user subscribed to. |
snippet.publishedAt |
datetimeThe date and time that the subscription was created. The value is specified in ISO 8601 format. |
snippet.title |
stringThe subscription's title. |
snippet.description |
stringThe subscription's details. |
snippet.resourceId |
objectThe id object contains information about the channel that the user subscribed to. |
snippet.resourceId.kind |
stringThe type of the API resource. |
snippet.resourceId.channelId |
stringThe value that YouTube uses to uniquely identify the channel that the user subscribed to. |
snippet.channelId |
stringThe ID that YouTube uses to uniquely identify the subscriber's channel. The resource_id object identifies the channel that the user subscribed to. |
snippet.thumbnails |
objectA map of thumbnail images associated with the subscription. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail. |
snippet.thumbnails.(key) |
objectValid key values are:
|
snippet.thumbnails.(key).url |
stringThe image's URL. |
snippet.thumbnails.(key).width |
unsigned integerThe image's width. |
snippet.thumbnails.(key).height |
unsigned integerThe image's height. |
contentDetails |
objectThe contentDetails object contains basic statistics about the subscription. |
contentDetails.totalItemCount |
unsigned integerThe approximate number of items that the subscription points to. |
contentDetails.newItemCount |
unsigned integerThe number of new items in the subscription since its content was last read. |
contentDetails.activityType |
stringThe type of activity this subscription is for (only uploads, everything). Valid values for this property are:
|
subscriberSnippet |
objectThe subscriberSnippet object contains basic details about the subscriber. |
subscriberSnippet.title |
stringThe title of the subscriber's channel. |
subscriberSnippet.description |
stringThe description of the subscriber's channel. |
subscriberSnippet.channelId |
stringThe ID that YouTube assigns to uniquely identify the subscriber's channel. |
subscriberSnippet.thumbnails |
objectThumbnail images for the subscriber's channel. |
subscriberSnippet.thumbnails.(key) |
objectValid key values are:
|
subscriberSnippet.thumbnails.(key).url |
stringThe image's URL. |
subscriberSnippet.thumbnails.(key).width |
unsigned integerThe image's width. |
subscriberSnippet.thumbnails.(key).height |
unsigned integerThe image's height. |