YouTube Data API v3 . subscriptions

Instance Methods

close()

Close httplib2 connections.

delete(id, x__xgafv=None)

Deletes a resource.

insert(part, body=None, x__xgafv=None)

Inserts a new resource into this collection.

list(part, channelId=None, forChannelId=None, id=None, maxResults=None, mine=None, myRecentSubscribers=None, mySubscribers=None, onBehalfOfContentOwner=None, onBehalfOfContentOwnerChannel=None, order=None, pageToken=None, x__xgafv=None)

Retrieves a list of resources, possibly filtered.

list_next()

Retrieves the next page of results.

Method Details

close()
Close httplib2 connections.
delete(id, x__xgafv=None)
Deletes a resource.

Args:
  id: string, A parameter (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format
insert(part, body=None, x__xgafv=None)
Inserts a new resource into this collection.

Args:
  part: string, The *part* parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. (required) (repeated)
  body: object, The request body.
    The object takes the form of:

{ # 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.
  "contentDetails": { # Details about the content to witch a subscription refers. # The contentDetails object contains basic statistics about the subscription.
    "activityType": "A String", # The type of activity this subscription is for (only uploads, everything).
    "newItemCount": 42, # The number of new items in the subscription since its content was last read.
    "totalItemCount": 42, # The approximate number of items that the subscription points to.
  },
  "etag": "A String", # Etag of this resource.
  "id": "A String", # The ID that YouTube uses to uniquely identify the subscription.
  "kind": "youtube#subscription", # Identifies what kind of resource this is. Value: the fixed string "youtube#subscription".
  "snippet": { # Basic details about a subscription, including title, description and thumbnails of the subscribed item. # The snippet object contains basic details about the subscription, including its title and the channel that the user subscribed to.
    "channelId": "A String", # The ID that YouTube uses to uniquely identify the subscriber's channel.
    "description": "A String", # The subscription's details.
    "publishedAt": "A String", # The date and time that the subscription was created.
    "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # The id object contains information about the channel that the user subscribed to.
      "channelId": "A 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.
      "kind": "A String", # The type of the API resource.
      "playlistId": "A 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.
      "videoId": "A 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.
    },
    "thumbnails": { # Internal representation of thumbnails for a YouTube resource. # A map of thumbnail images associated with the video. 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.
      "default": { # A thumbnail is an image representing a YouTube resource. # The default image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "high": { # A thumbnail is an image representing a YouTube resource. # The high quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "maxres": { # A thumbnail is an image representing a YouTube resource. # The maximum resolution quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "medium": { # A thumbnail is an image representing a YouTube resource. # The medium quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "standard": { # A thumbnail is an image representing a YouTube resource. # The standard quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
    },
    "title": "A String", # The subscription's title.
  },
  "subscriberSnippet": { # Basic details about a subscription's subscriber including title, description, channel ID and thumbnails. # The subscriberSnippet object contains basic details about the subscriber.
    "channelId": "A String", # The channel ID of the subscriber.
    "description": "A String", # The description of the subscriber.
    "thumbnails": { # Internal representation of thumbnails for a YouTube resource. # Thumbnails for this subscriber.
      "default": { # A thumbnail is an image representing a YouTube resource. # The default image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "high": { # A thumbnail is an image representing a YouTube resource. # The high quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "maxres": { # A thumbnail is an image representing a YouTube resource. # The maximum resolution quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "medium": { # A thumbnail is an image representing a YouTube resource. # The medium quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "standard": { # A thumbnail is an image representing a YouTube resource. # The standard quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
    },
    "title": "A String", # The title of the subscriber.
  },
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # 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.
  "contentDetails": { # Details about the content to witch a subscription refers. # The contentDetails object contains basic statistics about the subscription.
    "activityType": "A String", # The type of activity this subscription is for (only uploads, everything).
    "newItemCount": 42, # The number of new items in the subscription since its content was last read.
    "totalItemCount": 42, # The approximate number of items that the subscription points to.
  },
  "etag": "A String", # Etag of this resource.
  "id": "A String", # The ID that YouTube uses to uniquely identify the subscription.
  "kind": "youtube#subscription", # Identifies what kind of resource this is. Value: the fixed string "youtube#subscription".
  "snippet": { # Basic details about a subscription, including title, description and thumbnails of the subscribed item. # The snippet object contains basic details about the subscription, including its title and the channel that the user subscribed to.
    "channelId": "A String", # The ID that YouTube uses to uniquely identify the subscriber's channel.
    "description": "A String", # The subscription's details.
    "publishedAt": "A String", # The date and time that the subscription was created.
    "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # The id object contains information about the channel that the user subscribed to.
      "channelId": "A 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.
      "kind": "A String", # The type of the API resource.
      "playlistId": "A 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.
      "videoId": "A 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.
    },
    "thumbnails": { # Internal representation of thumbnails for a YouTube resource. # A map of thumbnail images associated with the video. 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.
      "default": { # A thumbnail is an image representing a YouTube resource. # The default image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "high": { # A thumbnail is an image representing a YouTube resource. # The high quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "maxres": { # A thumbnail is an image representing a YouTube resource. # The maximum resolution quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "medium": { # A thumbnail is an image representing a YouTube resource. # The medium quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "standard": { # A thumbnail is an image representing a YouTube resource. # The standard quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
    },
    "title": "A String", # The subscription's title.
  },
  "subscriberSnippet": { # Basic details about a subscription's subscriber including title, description, channel ID and thumbnails. # The subscriberSnippet object contains basic details about the subscriber.
    "channelId": "A String", # The channel ID of the subscriber.
    "description": "A String", # The description of the subscriber.
    "thumbnails": { # Internal representation of thumbnails for a YouTube resource. # Thumbnails for this subscriber.
      "default": { # A thumbnail is an image representing a YouTube resource. # The default image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "high": { # A thumbnail is an image representing a YouTube resource. # The high quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "maxres": { # A thumbnail is an image representing a YouTube resource. # The maximum resolution quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "medium": { # A thumbnail is an image representing a YouTube resource. # The medium quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
      "standard": { # A thumbnail is an image representing a YouTube resource. # The standard quality image for this resource.
        "height": 42, # (Optional) Height of the thumbnail image.
        "url": "A String", # The thumbnail image's URL.
        "width": 42, # (Optional) Width of the thumbnail image.
      },
    },
    "title": "A String", # The title of the subscriber.
  },
}
list(part, channelId=None, forChannelId=None, id=None, maxResults=None, mine=None, myRecentSubscribers=None, mySubscribers=None, onBehalfOfContentOwner=None, onBehalfOfContentOwnerChannel=None, order=None, pageToken=None, x__xgafv=None)
Retrieves a list of resources, possibly filtered.

Args:
  part: string, The *part* parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set *part=snippet*, the API response will also contain all of those nested properties. (required) (repeated)
  channelId: string, Return the subscriptions of the given channel owner.
  forChannelId: string, Return the subscriptions to the subset of these channels that the authenticated user is subscribed to.
  id: string, Return the subscriptions with the given IDs for Stubby or Apiary. (repeated)
  maxResults: integer, The *maxResults* parameter specifies the maximum number of items that should be returned in the result set.
  mine: boolean, Flag for returning the subscriptions of the authenticated user.
  myRecentSubscribers: boolean, A parameter
  mySubscribers: boolean, Return the subscribers of the given channel owner.
  onBehalfOfContentOwner: string, *Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwner* parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.
  onBehalfOfContentOwnerChannel: string, This parameter can only be used in a properly authorized request. *Note:* This parameter is intended exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.
  order: string, The order of the returned subscriptions
    Allowed values
      subscriptionOrderUnspecified - 
      relevance - Sort by relevance.
      unread - Sort by order of activity.
      alphabetical - Sort alphabetically.
  pageToken: string, The *pageToken* parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    {
  "etag": "A String", # Etag of this resource.
  "eventId": "A String", # Serialized EventId of the request which produced this response.
  "items": [ # A list of subscriptions that match the request criteria.
    { # 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.
      "contentDetails": { # Details about the content to witch a subscription refers. # The contentDetails object contains basic statistics about the subscription.
        "activityType": "A String", # The type of activity this subscription is for (only uploads, everything).
        "newItemCount": 42, # The number of new items in the subscription since its content was last read.
        "totalItemCount": 42, # The approximate number of items that the subscription points to.
      },
      "etag": "A String", # Etag of this resource.
      "id": "A String", # The ID that YouTube uses to uniquely identify the subscription.
      "kind": "youtube#subscription", # Identifies what kind of resource this is. Value: the fixed string "youtube#subscription".
      "snippet": { # Basic details about a subscription, including title, description and thumbnails of the subscribed item. # The snippet object contains basic details about the subscription, including its title and the channel that the user subscribed to.
        "channelId": "A String", # The ID that YouTube uses to uniquely identify the subscriber's channel.
        "description": "A String", # The subscription's details.
        "publishedAt": "A String", # The date and time that the subscription was created.
        "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # The id object contains information about the channel that the user subscribed to.
          "channelId": "A 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.
          "kind": "A String", # The type of the API resource.
          "playlistId": "A 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.
          "videoId": "A 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.
        },
        "thumbnails": { # Internal representation of thumbnails for a YouTube resource. # A map of thumbnail images associated with the video. 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.
          "default": { # A thumbnail is an image representing a YouTube resource. # The default image for this resource.
            "height": 42, # (Optional) Height of the thumbnail image.
            "url": "A String", # The thumbnail image's URL.
            "width": 42, # (Optional) Width of the thumbnail image.
          },
          "high": { # A thumbnail is an image representing a YouTube resource. # The high quality image for this resource.
            "height": 42, # (Optional) Height of the thumbnail image.
            "url": "A String", # The thumbnail image's URL.
            "width": 42, # (Optional) Width of the thumbnail image.
          },
          "maxres": { # A thumbnail is an image representing a YouTube resource. # The maximum resolution quality image for this resource.
            "height": 42, # (Optional) Height of the thumbnail image.
            "url": "A String", # The thumbnail image's URL.
            "width": 42, # (Optional) Width of the thumbnail image.
          },
          "medium": { # A thumbnail is an image representing a YouTube resource. # The medium quality image for this resource.
            "height": 42, # (Optional) Height of the thumbnail image.
            "url": "A String", # The thumbnail image's URL.
            "width": 42, # (Optional) Width of the thumbnail image.
          },
          "standard": { # A thumbnail is an image representing a YouTube resource. # The standard quality image for this resource.
            "height": 42, # (Optional) Height of the thumbnail image.
            "url": "A String", # The thumbnail image's URL.
            "width": 42, # (Optional) Width of the thumbnail image.
          },
        },
        "title": "A String", # The subscription's title.
      },
      "subscriberSnippet": { # Basic details about a subscription's subscriber including title, description, channel ID and thumbnails. # The subscriberSnippet object contains basic details about the subscriber.
        "channelId": "A String", # The channel ID of the subscriber.
        "description": "A String", # The description of the subscriber.
        "thumbnails": { # Internal representation of thumbnails for a YouTube resource. # Thumbnails for this subscriber.
          "default": { # A thumbnail is an image representing a YouTube resource. # The default image for this resource.
            "height": 42, # (Optional) Height of the thumbnail image.
            "url": "A String", # The thumbnail image's URL.
            "width": 42, # (Optional) Width of the thumbnail image.
          },
          "high": { # A thumbnail is an image representing a YouTube resource. # The high quality image for this resource.
            "height": 42, # (Optional) Height of the thumbnail image.
            "url": "A String", # The thumbnail image's URL.
            "width": 42, # (Optional) Width of the thumbnail image.
          },
          "maxres": { # A thumbnail is an image representing a YouTube resource. # The maximum resolution quality image for this resource.
            "height": 42, # (Optional) Height of the thumbnail image.
            "url": "A String", # The thumbnail image's URL.
            "width": 42, # (Optional) Width of the thumbnail image.
          },
          "medium": { # A thumbnail is an image representing a YouTube resource. # The medium quality image for this resource.
            "height": 42, # (Optional) Height of the thumbnail image.
            "url": "A String", # The thumbnail image's URL.
            "width": 42, # (Optional) Width of the thumbnail image.
          },
          "standard": { # A thumbnail is an image representing a YouTube resource. # The standard quality image for this resource.
            "height": 42, # (Optional) Height of the thumbnail image.
            "url": "A String", # The thumbnail image's URL.
            "width": 42, # (Optional) Width of the thumbnail image.
          },
        },
        "title": "A String", # The title of the subscriber.
      },
    },
  ],
  "kind": "youtube#subscriptionListResponse", # Identifies what kind of resource this is. Value: the fixed string "youtube#subscriptionListResponse".
  "nextPageToken": "A String", # The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set.
  "pageInfo": { # Paging details for lists of resources, including total number of items available and number of resources returned in a single page.
    "resultsPerPage": 42, # The number of results included in the API response.
    "totalResults": 42, # The total number of results in the result set.
  },
  "prevPageToken": "A String", # The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set.
  "tokenPagination": { # Stub token pagination template to suppress results.
  },
  "visitorId": "A String", # The visitorId identifies the visitor.
}
list_next()
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.