YouTube API . activities

Instance Methods

insert(part, body, onBehalfOfContentOwner=None)

Post a channel bulletin.

list(part, onBehalfOfContentOwner=None, pageToken=None, publishedBefore=None, channelId=None, mine=None, maxResults=None, home=None, publishedAfter=None)

Browse the YouTube channel activity collection.

list_next(previous_request, previous_response)

Retrieves the next page of results.

Method Details

insert(part, body, onBehalfOfContentOwner=None)
Post a channel bulletin.

Args:
  part: string, One or more parts to return on the current request. (required)
  body: object, The request body. (required)
    The object takes the form of:

{ # An activity resource contains information about an action that a channel has taken on YouTube.
    "snippet": { # Basic details about an activity, including title, description, thumbnails, activity type and group. # Basic details about the activity: title, description, thumbnails.
      "thumbnails": { # Activity thumbnails.
        "a_key": { # A thumbnail is an image representing a YouTube resource. # A map of thumbnails by their name.
          "url": "A String", # The URL for the thumbnail.
        },
      },
      "title": "A String", # Title of the activity.
      "channelId": "A String", # Channel publishing the activity.
      "publishedAt": "A String", # Date and time the activity was published at.
      "type": "A String", # Type of the activity.
      "groupId": "A String", # Id of the group that this activity is part of.
      "description": "A String", # Description of the activity.
    },
    "contentDetails": { # Details about the content of an activity: the video that was shared, the channel that was subscribed to, etc. # Type specific information about the activity.
      "comment": { # Only present if the type is "comment".
        "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the commented resource.
          "kind": "A String", # The kind of the referred resource.
          "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
          "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
          "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
        },
      },
      "playlistItem": { # Only present if the type is "playlistItem".
        "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the resource added to the playlist.
          "kind": "A String", # The kind of the referred resource.
          "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
          "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
          "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
        },
        "playlistId": "A String", # ID of the playlist the resource was added to.
      },
      "like": { # Only present if the type is "like".
        "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the rated resource.
          "kind": "A String", # The kind of the referred resource.
          "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
          "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
          "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
        },
      },
      "social": { # Only present if the type is "social".
        "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the resource this social activity is about.
          "kind": "A String", # The kind of the referred resource.
          "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
          "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
          "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
        },
        "imageUrl": "A String", # Image of the post author.
        "type": "A String", # Type of the social network.
        "referenceUrl": "A String", # Url of the social post.
        "author": "A String", # Author of the post.
      },
      "favorite": { # Only present if the type is "favorite".
        "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the favorited resource.
          "kind": "A String", # The kind of the referred resource.
          "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
          "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
          "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
        },
      },
      "upload": { # Only present if the type is "upload".
        "videoId": "A String", # ID of the uploaded video.
      },
      "recommendation": { # Only set if the type is "recommendation".
        "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the recommended resource.
          "kind": "A String", # The kind of the referred resource.
          "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
          "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
          "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
        },
        "reason": "A String", # Reason for which the video was recommended.
        "seedResourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the video that caused this recommendation.
          "kind": "A String", # The kind of the referred resource.
          "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
          "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
          "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
        },
      },
      "bulletin": { # Only present if the type is "bulletin".
        "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the resource this bulletin is about.
          "kind": "A String", # The kind of the referred resource.
          "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
          "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
          "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
        },
      },
      "subscription": { # Only present if the type is "subscription".
        "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the resource subscribed to.
          "kind": "A String", # The kind of the referred resource.
          "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
          "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
          "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
        },
      },
    },
    "kind": "youtube#activity", # The type of this API response.
    "etag": "A String", # The eTag of the activity.
    "id": "A String", # The unique ID of the activity.
  }

  onBehalfOfContentOwner: string, The authenticated user acts on behalf of this content owner.

Returns:
  An object of the form:

    { # An activity resource contains information about an action that a channel has taken on YouTube.
      "snippet": { # Basic details about an activity, including title, description, thumbnails, activity type and group. # Basic details about the activity: title, description, thumbnails.
        "thumbnails": { # Activity thumbnails.
          "a_key": { # A thumbnail is an image representing a YouTube resource. # A map of thumbnails by their name.
            "url": "A String", # The URL for the thumbnail.
          },
        },
        "title": "A String", # Title of the activity.
        "channelId": "A String", # Channel publishing the activity.
        "publishedAt": "A String", # Date and time the activity was published at.
        "type": "A String", # Type of the activity.
        "groupId": "A String", # Id of the group that this activity is part of.
        "description": "A String", # Description of the activity.
      },
      "contentDetails": { # Details about the content of an activity: the video that was shared, the channel that was subscribed to, etc. # Type specific information about the activity.
        "comment": { # Only present if the type is "comment".
          "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the commented resource.
            "kind": "A String", # The kind of the referred resource.
            "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
            "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
            "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
          },
        },
        "playlistItem": { # Only present if the type is "playlistItem".
          "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the resource added to the playlist.
            "kind": "A String", # The kind of the referred resource.
            "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
            "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
            "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
          },
          "playlistId": "A String", # ID of the playlist the resource was added to.
        },
        "like": { # Only present if the type is "like".
          "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the rated resource.
            "kind": "A String", # The kind of the referred resource.
            "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
            "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
            "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
          },
        },
        "social": { # Only present if the type is "social".
          "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the resource this social activity is about.
            "kind": "A String", # The kind of the referred resource.
            "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
            "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
            "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
          },
          "imageUrl": "A String", # Image of the post author.
          "type": "A String", # Type of the social network.
          "referenceUrl": "A String", # Url of the social post.
          "author": "A String", # Author of the post.
        },
        "favorite": { # Only present if the type is "favorite".
          "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the favorited resource.
            "kind": "A String", # The kind of the referred resource.
            "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
            "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
            "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
          },
        },
        "upload": { # Only present if the type is "upload".
          "videoId": "A String", # ID of the uploaded video.
        },
        "recommendation": { # Only set if the type is "recommendation".
          "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the recommended resource.
            "kind": "A String", # The kind of the referred resource.
            "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
            "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
            "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
          },
          "reason": "A String", # Reason for which the video was recommended.
          "seedResourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the video that caused this recommendation.
            "kind": "A String", # The kind of the referred resource.
            "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
            "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
            "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
          },
        },
        "bulletin": { # Only present if the type is "bulletin".
          "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the resource this bulletin is about.
            "kind": "A String", # The kind of the referred resource.
            "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
            "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
            "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
          },
        },
        "subscription": { # Only present if the type is "subscription".
          "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the resource subscribed to.
            "kind": "A String", # The kind of the referred resource.
            "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
            "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
            "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
          },
        },
      },
      "kind": "youtube#activity", # The type of this API response.
      "etag": "A String", # The eTag of the activity.
      "id": "A String", # The unique ID of the activity.
    }
list(part, onBehalfOfContentOwner=None, pageToken=None, publishedBefore=None, channelId=None, mine=None, maxResults=None, home=None, publishedAfter=None)
Browse the YouTube channel activity collection.

Args:
  part: string, Activity parts to include in the returned response. Valid values are: id, snippet and contentDetails. (required)
  onBehalfOfContentOwner: string, The authenticated user acts on behalf of this content owner.
  pageToken: string, Token for the page selection.
  publishedBefore: string, Only return activities published before given date (exclusive).
  channelId: string, YouTube ID of the channel.
  mine: string, Flag indicating to return user's activities.
  maxResults: integer, Maximum number of results to return
  home: string, Flag indicating to return user's homepage feed.
  publishedAfter: string, Only return activities published after given date (inclusive).

Returns:
  An object of the form:

    { # A paginated list of activities returned as a response to youtube.activities.list calls.
    "nextPageToken": "A String", # Token to the next page.
    "kind": "youtube#activityListResponse", # The type of this API response.
    "items": [ # List of activities matching the request criteria.
      { # An activity resource contains information about an action that a channel has taken on YouTube.
          "snippet": { # Basic details about an activity, including title, description, thumbnails, activity type and group. # Basic details about the activity: title, description, thumbnails.
            "thumbnails": { # Activity thumbnails.
              "a_key": { # A thumbnail is an image representing a YouTube resource. # A map of thumbnails by their name.
                "url": "A String", # The URL for the thumbnail.
              },
            },
            "title": "A String", # Title of the activity.
            "channelId": "A String", # Channel publishing the activity.
            "publishedAt": "A String", # Date and time the activity was published at.
            "type": "A String", # Type of the activity.
            "groupId": "A String", # Id of the group that this activity is part of.
            "description": "A String", # Description of the activity.
          },
          "contentDetails": { # Details about the content of an activity: the video that was shared, the channel that was subscribed to, etc. # Type specific information about the activity.
            "comment": { # Only present if the type is "comment".
              "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the commented resource.
                "kind": "A String", # The kind of the referred resource.
                "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
                "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
                "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
              },
            },
            "playlistItem": { # Only present if the type is "playlistItem".
              "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the resource added to the playlist.
                "kind": "A String", # The kind of the referred resource.
                "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
                "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
                "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
              },
              "playlistId": "A String", # ID of the playlist the resource was added to.
            },
            "like": { # Only present if the type is "like".
              "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the rated resource.
                "kind": "A String", # The kind of the referred resource.
                "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
                "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
                "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
              },
            },
            "social": { # Only present if the type is "social".
              "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the resource this social activity is about.
                "kind": "A String", # The kind of the referred resource.
                "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
                "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
                "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
              },
              "imageUrl": "A String", # Image of the post author.
              "type": "A String", # Type of the social network.
              "referenceUrl": "A String", # Url of the social post.
              "author": "A String", # Author of the post.
            },
            "favorite": { # Only present if the type is "favorite".
              "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the favorited resource.
                "kind": "A String", # The kind of the referred resource.
                "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
                "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
                "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
              },
            },
            "upload": { # Only present if the type is "upload".
              "videoId": "A String", # ID of the uploaded video.
            },
            "recommendation": { # Only set if the type is "recommendation".
              "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the recommended resource.
                "kind": "A String", # The kind of the referred resource.
                "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
                "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
                "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
              },
              "reason": "A String", # Reason for which the video was recommended.
              "seedResourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the video that caused this recommendation.
                "kind": "A String", # The kind of the referred resource.
                "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
                "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
                "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
              },
            },
            "bulletin": { # Only present if the type is "bulletin".
              "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the resource this bulletin is about.
                "kind": "A String", # The kind of the referred resource.
                "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
                "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
                "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
              },
            },
            "subscription": { # Only present if the type is "subscription".
              "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # ID of the resource subscribed to.
                "kind": "A String", # The kind of the referred resource.
                "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
                "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
                "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
              },
            },
          },
          "kind": "youtube#activity", # The type of this API response.
          "etag": "A String", # The eTag of the activity.
          "id": "A String", # The unique ID of the activity.
        },
    ],
    "etag": "A String", # The eTag of the response.
    "prevPageToken": "A String", # Token to the previous page.
    "pageInfo": { # Paging details for lists of resources, including total number of items available and number of resources returned in a single page. # Paging information for the list result.
      "totalResults": 42, # The total number of results.
      "resultsPerPage": 42, # The number of results to display for each page.
    },
  }
list_next(previous_request, previous_response)
Retrieves the next page of results.

Args:
  previous_request: The request for the previous page. (required)
  previous_response: The response from the request for the previous page. (required)

Returns:
  A request object that you can call 'execute()' on to request the next
  page. Returns None if there are no more items in the collection.