Subscribe to a Channel
youtube_subscribeSubscribe the authenticated user to a YouTube channel by providing the channel ID.
Instructions
Subscribe the authenticated user to a YouTube channel, using the YouTube Data API v3 subscriptions.insert endpoint.
Args:
channelId(required) — The YouTube channel ID to subscribe to (e.g.,"UCxxxxxx"). This is the channel's resource ID, not a handle or name. You can obtain it fromyoutube_search(type: channel) oryoutube_list_subscriptions.
Returns (JSON shape):
{
"id": "new-subscription-resource-id",
"snippet": {
"publishedAt": "2024-06-03T10:00:00Z",
"title": "Subscribed Channel Title",
"description": "Channel description...",
"resourceId": { "kind": "youtube#channel", "channelId": "UCxxxxxx" },
"thumbnails": { "default": { "url": "https://..." } }
},
"contentDetails": {
"totalItemCount": 0,
"newItemCount": 0,
"activityType": "all"
}
}Examples:
Subscribe to a channel:
{ "channelId": "UC_x5XG1OV2P6uZZ5FSM9Ttw" }
Common Errors:
400 subscriptionDuplicate— The authenticated user is already subscribed to this channel.400 invalidChannelId— The providedchannelIddoes not correspond to an existing channel.401 / 403 authError— Credentials missing or expired; re-runnpm run auth.403 forbidden— The authenticated account cannot subscribe (e.g., cannot subscribe to own channel, or missing scopehttps://www.googleapis.com/auth/youtube).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channelId | Yes | The YouTube channel ID to subscribe to (e.g. "UCxxxxxx"). Obtain from youtube_search or youtube_list_subscriptions. |