REST Resource: activities

Resource: Activity

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 uploading a video, subscribing to a channel, and adding a video to a playlist. 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 uploaded video or subscribed channel.

JSON representation
{
  "kind": string,
  "etag": string,
  "id": string,
  "snippet": {
    "publishedAt": string,
    "channelId": string,
    "title": string,
    "description": string,
    "thumbnails": {
      object (ThumbnailDetails)
    },
    "channelTitle": string,
    "type": enum
  },
  "contentDetails": {
    "upload": {
      "videoId": string
    },
    "subscription": {
      "resourceId": {
        "kind": string,
        "videoId": string,
        "channelId": string,
        "playlistId": string
      }
    },
    "playlistItem": {
      "resourceId": {
        "kind": string,
        "videoId": string,
        "channelId": string,
        "playlistId": string
      },
      "playlistId": string,
      "playlistItemId": string
    }
  }
}
Fields
kind

string

Identifies what kind of resource this is.

Value: The fixed string "youtube#activity".

etag

string

Etag of this resource

id

string

The ID that YouTube uses to uniquely identify the activity.

snippet

object

The snippet object contains basic details about the activity, including the activity's type, title, description, and thumbnails.

snippet.publishedAt

string

The date and time that the activity occurred. The value is specified in ISO 8601 format.

snippet.channelId

string

The ID that YouTube uses to uniquely identify the channel associated with the activity.

snippet.title

string

The title of the resource primarily associated with the activity.

snippet.description

string

The description of the resource primarily associated with the activity.

snippet.thumbnails

object (ThumbnailDetails)

A 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.channelTitle

string

Channel title for the channel responsible for this activity

snippet.type

enum

The type of activity that the resource describes.

Valid values of this enum field are:

  • upload
  • subscription
  • playlistItem
contentDetails

object

The contentDetails object contains information about the content associated with the activity. For example, if the snippet.type value is upload, then the contentDetails object identifies the uploaded video.

contentDetails.upload

object

The upload object contains information about the uploaded video. This property is only present if the snippet.type is upload.

contentDetails.upload.videoId

string

The ID that YouTube uses to uniquely identify the uploaded video.

contentDetails.subscription

object

The subscription object contains information about a channel that a user subscribed to. This property is only present if the snippet.type is subscription and the channel's subscriptions are public.

contentDetails.subscription.resourceId

object

The resourceId object contains information that identifies the resource that the user subscribed to.

contentDetails.subscription.resourceId.kind

string

The type of the API resource.

contentDetails.subscription.resourceId.videoId

string

The ID that YouTube uses to uniquely identify the referred resource, if that resource is a video. This property is only present if the resourceId.kind value is youtube#video.

contentDetails.subscription.resourceId.channelId

string

The ID that YouTube uses to uniquely identify the referred resource, if that resource is a channel. This property is only present if the resourceId.kind value is youtube#channel.

contentDetails.subscription.resourceId.playlistId

string

The ID that YouTube uses to uniquely identify the referred resource, if that resource is a playlist. This property is only present if the resourceId.kind value is youtube#playlist.

contentDetails.playlistItem

object

The playlistItem object contains information about a new playlist item. This property is only present if the snippet.type is playlistItem.

contentDetails.playlistItem.resourceId

object

The resourceId object contains information about the resource that was added to the playlist.

contentDetails.playlistItem.resourceId.kind

string

The type of the API resource.

contentDetails.playlistItem.resourceId.videoId

string

The ID that YouTube uses to uniquely identify the referred resource, if that resource is a video. This property is only present if the resourceId.kind value is youtube#video.

contentDetails.playlistItem.resourceId.channelId

string

The ID that YouTube uses to uniquely identify the referred resource, if that resource is a channel. This property is only present if the resourceId.kind value is youtube#channel.

contentDetails.playlistItem.resourceId.playlistId

string

The ID that YouTube uses to uniquely identify the referred resource, if that resource is a playlist. This property is only present if the resourceId.kind value is youtube#playlist.

contentDetails.playlistItem.playlistId

string

The value that YouTube uses to uniquely identify the playlist.

contentDetails.playlistItem.playlistItemId

string

ID of the item within the playlist.

Methods

list

Returns a list of channel activity events that match the request criteria.