AI-generated Key Takeaways
-
YouTube's channel bulletin feature has been removed, making the
activities.listmethod unable to retrieve bulletins and rendering theactivities.insertmethod obsolete. -
An activity resource represents a channel or user action on YouTube, including actions like video uploads, likes, favorites, comments, and subscriptions.
-
The
activities.listmethod can be used to retrieve activity events that meet specific criteria, while theactivities.insertmethod is no longer functional. -
The
activityresource contains details in thesnippetandcontentDetailsproperties, offering information such as timestamps, channel IDs, activity type, and associated resource details like videos, playlists, or social posts. -
The social post
contentDetailssection, which is present when the activitytypeis social, provides the social network name, the resource ID related to the post, the author, the reference URL and the author image URL.
An activity resource contains information about an action that a particular channel, or user, has taken on YouTube. The actions reported in activity feeds include rating a video, sharing a video, marking a video as a favorite, uploading a video, and so forth. Each activity resource identifies the type of action, the channel associated with the action, and the resource(s) associated with the action, such as the video that was rated or uploaded.
Methods
The API supports the following methods for activities resources:
- list
- Returns a list of channel activity events that match the request criteria. For example, you can retrieve events associated with a particular channel or with the user's own channel. Try it now.
Resource representation
The following JSON structure shows the format of an activities resource:
{
"kind": "youtube#activity",
"etag": etag,
"id": string,
"snippet": {
"publishedAt": datetime,
"channelId": string,
"title": string,
"description": string,
"thumbnails": {
(key): {
"url": string,
"width": unsigned integer,
"height": unsigned integer
}
},
"channelTitle": string,
"type": string,
"groupId": string
},
"contentDetails": {
"upload": {
"videoId": string
},
"like": {
"resourceId": {
"kind": string,
"videoId": string,
}
},
"favorite": {
"resourceId": {
"kind": string,
"videoId": string,
}
},
"comment": {
"resourceId": {
"kind": string,
"videoId": string,
"channelId": string,
}
},
"subscription": {
"resourceId": {
"kind": string,
"channelId": string,
}
},
"playlistItem": {
"resourceId": {
"kind": string,
"videoId": string,
},
"playlistId": string,
"playlistItemId": string
},
"recommendation": {
"resourceId": {
"kind": string,
"videoId": string,
"channelId": string,
},
"reason": string,
"seedResourceId": {
"kind": string,
"videoId": string,
"channelId": string,
"playlistId": string
}
},
"social": {
"type": string,
"resourceId": {
"kind": string,
"videoId": string,
"channelId": string,
"playlistId": string
},
"author": string,
"referenceUrl": string,
"imageUrl": string
},
"channelItem": {
"resourceId": {
}
},
}
}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#activity. |
etag |
etagThe Etag of this resource. |
id |
stringThe ID that YouTube uses to uniquely identify the activity. |
snippet |
objectThe snippet object contains basic details about the activity, including the activity's type and group ID. |
snippet.publishedAt |
datetimeThe date and time that the activity occurred. The value is specified in ISO 8601 format. |
snippet.channelId |
stringThe ID that YouTube uses to uniquely identify the channel associated with the activity. |
snippet.title |
stringThe title of the resource primarily associated with the activity. |
snippet.description |
stringThe description of the resource primarily associated with the activity. |
snippet.thumbnails |
objectA map of thumbnail images associated with the resource that is primarily associated with the activity. 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. |
snippet.channelTitle |
stringChannel title for the channel responsible for this activity |
snippet.type |
stringThe type of activity that the resource describes. Valid values for this property are:
|
snippet.groupId |
stringThe group ID associated with the activity. A group ID identifies user events that are associated with the same user and resource. For example, if a user rates a video and marks the same video as a favorite, the entries for those events would have the same group ID in the user's activity feed. In your user interface, you can avoid repetition by grouping events with the same groupId value. |
contentDetails |
objectThe contentDetails object contains information about the content associated with the activity. For example, if the snippet.type value is videoRated, then the contentDetails object's content identifies the rated video. |
contentDetails.upload |
objectThe upload object contains information about the uploaded video. This property is only present if the snippet.type is upload. |
contentDetails.upload.videoId |
stringThe ID that YouTube uses to uniquely identify the uploaded video. |
contentDetails.like |
objectThe like object contains information about a resource that received a positive (like) rating. This property is only present if the snippet.type is like. |
contentDetails.like.resourceId |
objectThe resourceId object contains information that identifies the rated resource. |
contentDetails.like.resourceId.kind |
stringThe type of the API resource. |
contentDetails.like.resourceId.videoId |
stringThe ID that YouTube uses to uniquely identify the video, if the rated resource is a video. This property is only present if the resourceId.kind is youtube#video. |
contentDetails.favorite |
objectThe favorite object contains information about a video that was marked as a favorite video. This property is only present if the snippet.type is favorite. |
contentDetails.favorite.resourceId |
objectThe resourceId object contains information that identifies the resource that was marked as a favorite. |
contentDetails.favorite.resourceId.kind |
stringThe type of the API resource. |
contentDetails.favorite.resourceId.videoId |
stringThe ID that YouTube uses to uniquely identify the favorite video. This property is only present if the resourceId.kind is youtube#video.Note: The activities.list method does not currently return resources for new comments. |
contentDetails.comment |
objectThe comment object contains information about a resource that received a comment. This property is only present if the snippet.type is comment. |
contentDetails.comment.resourceId |
objectThe resourceId object contains information that identifies the resource associated with the comment. |
contentDetails.comment.resourceId.kind |
stringThe type of the API resource. |
contentDetails.comment.resourceId.videoId |
stringThe ID that YouTube uses to uniquely identify the video associated with a comment. This property is only present if the resourceId.kind is youtube#video. |
contentDetails.comment.resourceId.channelId |
stringThe ID that YouTube uses to uniquely identify the channel associated with a comment. This property is only present if the resourceId.kind is youtube#channel. |
contentDetails.subscription |
objectThe subscription object contains information about a channel that a user subscribed to. This property is only present if the snippet.type is subscription. |
contentDetails.subscription.resourceId |
objectThe resourceId object contains information that identifies the resource that the user subscribed to. |
contentDetails.subscription.resourceId.kind |
stringThe type of the API resource. |
contentDetails.subscription.resourceId.channelId |
stringThe ID that YouTube uses to uniquely identify the channel that the user subscribed to. This property is only present if the resourceId.kind is youtube#channel. |
contentDetails.playlistItem |
objectThe playlistItem object contains information about a new playlist item. This property is only present if the snippet.type is playlistItem. |
contentDetails.playlistItem.resourceId |
objectThe resourceId object contains information that identifies the resource that was added to the playlist. |
contentDetails.playlistItem.resourceId.kind |
stringThe type of the API resource. |
contentDetails.playlistItem.resourceId.videoId |
stringThe ID that YouTube uses to uniquely identify the video that was added to the playlist. This property is only present if the resourceId.kind is youtube#video. |
contentDetails.playlistItem.playlistId |
stringThe value that YouTube uses to uniquely identify the playlist. |
contentDetails.playlistItem.playlistItemId |
stringThe value that YouTube uses to uniquely identify the item in the playlist. |
contentDetails.recommendation |
objectThe recommendation object contains information about a recommended resource. This property is only present if the snippet.type is recommendation. |
contentDetails.recommendation.resourceId |
objectThe resourceId object contains information that identifies the recommended resource. |
contentDetails.recommendation.resourceId.kind |
stringThe type of the API resource. |
contentDetails.recommendation.resourceId.videoId |
stringThe ID that YouTube uses to uniquely identify the video, if the recommended resource is a video. This property is only present if the resourceId.kind is youtube#video. |
contentDetails.recommendation.resourceId.channelId |
stringThe ID that YouTube uses to uniquely identify the channel, if the recommended resource is a channel. This property is only present if the resourceId.kind is youtube#channel. |
contentDetails.recommendation.reason |
stringThe reason that the resource is recommended to the user. Valid values for this property are:
|
contentDetails.recommendation.seedResourceId |
objectThe seedResourceId object contains information about the resource that caused the recommendation. |
contentDetails.recommendation.seedResourceId.kind |
stringThe type of the API resource. |
contentDetails.recommendation.seedResourceId.videoId |
stringThe ID that YouTube uses to uniquely identify the video, if the recommendation was caused by a particular video. This property is only present if the seedResourceId.kind is youtube#video. |
contentDetails.recommendation.seedResourceId.channelId |
stringThe ID that YouTube uses to uniquely identify the channel, if the recommendation was caused by a particular channel. This property is only present if the seedResourceId.kind is youtube#channel. |
contentDetails.recommendation.seedResourceId.playlistId |
stringThe ID that YouTube uses to uniquely identify the playlist, if the recommendation was caused by a particular playlist. This property is only present if the seedResourceId.kind is youtube#playlist. |
contentDetails.social |
objectThe social object contains details about a social network post. This property is only present if the snippet.type is social. |
contentDetails.social.type |
stringThe name of the social network. Valid values for this property are:
|
contentDetails.social.resourceId |
objectThe resourceId object encapsulates information that identifies the resource associated with a social network post. |
contentDetails.social.resourceId.kind |
stringThe type of the API resource. |
contentDetails.social.resourceId.videoId |
stringThe ID that YouTube uses to uniquely identify the video featured in a social network post, if the post refers to a video. This property will only be present if the value of the social.resourceId.kind property is youtube#video. |
contentDetails.social.resourceId.channelId |
stringThe ID that YouTube uses to uniquely identify the channel featured in a social network post, if the post refers to a channel. This property will only be present if the value of the social.resourceId.kind property is youtube#channel. |
contentDetails.social.resourceId.playlistId |
stringThe ID that YouTube uses to uniquely identify the playlist featured in a social network post, if the post refers to a playlist. This property will only be present if the value of the social.resourceId.kind property is youtube#playlist. |
contentDetails.social.author |
stringThe author of the social network post. |
contentDetails.social.referenceUrl |
stringThe URL of the social network post. |
contentDetails.social.imageUrl |
stringAn image of the post's author. |
contentDetails.channelItem |
objectThe channelItem object contains details about a resource that was added to a channel. This property is only present if the snippet.type is channelItem. |
contentDetails.channelItem.resourceId |
objectThe resourceId object contains information that identifies the resource that was added to the channel. |