# YouTube Data — Pipedream Connect

> With the YouTube Data API, you can add a variety of YouTube features to your application. Use the API to upload videos, manage playlists and subscriptions, update channel settings, and more.

- API slug: `youtube_data_api` (use in MCP headers and tool keys)
- Auth: OAuth (Pipedream-managed)
- Categories: Entertainment
- Website: https://youtube.com
- Managed OAuth scopes: `email` · `profile` · `https://www.googleapis.com/auth/youtube.readonly` · `https://www.googleapis.com/auth/youtube.upload` · `https://www.googleapis.com/auth/youtube` · `https://www.googleapis.com/auth/youtube.force-ssl`
- This page (HTML): https://pipedream.com/apps/youtube-data-api
- Tools: 19 actions · 10 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: youtube_data_api`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "youtube_data_api",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Add Playlist Items:
const result = await mcp.callTool({
  name: "youtube_data_api-add-playlist-items",
  arguments: {
    playlistId: "Playlist ID",
    videoIds: ["Video IDs"],
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a YouTube Data endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://www.googleapis.com/oauth2/v1/userinfo

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vb2F1dGgyL3YxL3VzZXJpbmZv?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "youtube_data_api-add-playlist-items",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    youtube_data_api: { authProvisionId: "apn_xxxxxxx" },
    playlistId: "Playlist ID",
    videoIds: ["Video IDs"],
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (19)

### `youtube_data_api-add-playlist-items` — Add Playlist Items (Write)

Adds resources to a playlist. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/add-playlist-items.md

### `youtube_data_api-channel-statistics` — Channel Statistics (Read-only)

Returns statistics from my YouTube Channel or by id. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/channel-statistics.md

### `youtube_data_api-create-comment-thread` — Create Comment Thread (Write)

Creates a new top-level comment in a video. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/create-comment-thread.md

### `youtube_data_api-create-playlist` — Create Playlist (Write)

Creates a playlist. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/create-playlist.md

### `youtube_data_api-delete-playlist` — Delete Playlist (Write)

Deletes a playlist. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/delete-playlist.md

### `youtube_data_api-delete-playlist-items` — Delete Playlist Items (Write)

Deletes a playlist item. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/delete-playlist-items.md

### `youtube_data_api-list-activities` — List Activities (Read-only)

Returns a list of channel activity events that match the request criteria. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/list-activities.md

### `youtube_data_api-list-language-options` — List Language Options (Read-only)

Retrieves available language options for the Language (hl) field.

Full schema: https://pipedream.com/apps/youtube-data-api/actions/list-language-options.md

### `youtube_data_api-list-playlist-videos` — List Playlist Videos (Read-only)

List videos in a playlist. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/list-playlist-videos.md

### `youtube_data_api-list-playlists` — List Playlists (Read-only)

Returns a collection of playlists that match the API request parameters. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/list-playlists.md

### `youtube_data_api-list-videos` — List Videos (Read-only)

Returns a list of videos that match the API request parameters. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/list-videos.md

### `youtube_data_api-reply-to-comment` — Reply To Comment (Write)

Creates a reply to an existing comment. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/reply-to-comment.md

### `youtube_data_api-search-videos` — Search Videos (Read-only)

Returns a list of videos that match the search parameters. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/search-videos.md

### `youtube_data_api-update-channel` — Update Channel (Write)

Updates a channel's metadata. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/update-channel.md

### `youtube_data_api-update-playlist` — Update Playlist (Write)

Modifies a playlist. For example, you could change a playlist's title, description, or privacy status. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/update-playlist.md

### `youtube_data_api-update-video-details` — Update Video Details (Write)

Updates a video's metadata. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/update-video-details.md

### `youtube_data_api-upload-channel-banner` — Upload Channel Banner (Write)

Uploads a channel banner image to YouTube. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/upload-channel-banner.md

### `youtube_data_api-upload-thumbnail` — Upload Thumbnail (Read-only)

Uploads a custom video thumbnail to YouTube and sets it for a video. Note: Account must be verified. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/upload-thumbnail.md

### `youtube_data_api-upload-video` — Upload Video (Write)

Post a video to your channel. See the documentation for more information

Full schema: https://pipedream.com/apps/youtube-data-api/actions/upload-video.md

## Triggers (10)

### `youtube_data_api-new-comment-in-channel` — New Comment In Channel (Polling)

Emit new event for each new comment or reply posted to a Youtube channel (or any of its videos).

Full schema: https://pipedream.com/apps/youtube-data-api/triggers/new-comment-in-channel.md

### `youtube_data_api-new-comment-posted` — New Comment Posted (Polling)

Emit new event for each new comment or reply posted to a Youtube video.

Full schema: https://pipedream.com/apps/youtube-data-api/triggers/new-comment-posted.md

### `youtube_data_api-new-liked-videos` — New Liked Videos (Polling)

Emit new event for each new Youtube video liked by the authenticated user.

Full schema: https://pipedream.com/apps/youtube-data-api/triggers/new-liked-videos.md

### `youtube_data_api-new-subscriber` — New Subscriber (Polling)

Emit new event for each new Youtube subscriber to a user Channel.

Full schema: https://pipedream.com/apps/youtube-data-api/triggers/new-subscriber.md

### `youtube_data_api-new-subscription` — New Subscription (Polling)

Emit new event for each new subscription from authenticated user.

Full schema: https://pipedream.com/apps/youtube-data-api/triggers/new-subscription.md

### `youtube_data_api-new-videos` — New Videos (Polling)

Emit new event for each new Youtube video the user posts.

Full schema: https://pipedream.com/apps/youtube-data-api/triggers/new-videos.md

### `youtube_data_api-new-videos-by-handle` — New Videos by Handle (Polling)

Emit new event for each new Youtube video tied to a handle.

Full schema: https://pipedream.com/apps/youtube-data-api/triggers/new-videos-by-handle.md

### `youtube_data_api-new-videos-by-search` — New Videos by Search (Polling)

Emit new event for each new YouTube video matching the search criteria.

Full schema: https://pipedream.com/apps/youtube-data-api/triggers/new-videos-by-search.md

### `youtube_data_api-new-videos-in-playlist` — New Videos in Playlist (Polling)

Emit new event for each new Youtube video added to a Playlist.

Full schema: https://pipedream.com/apps/youtube-data-api/triggers/new-videos-in-playlist.md

### `youtube_data_api-new-videos-in-subscribed-channels` — New Videos in Subscribed Channels (Polling)

Emit new event for each new YouTube video posted to a subscribed channel.

Full schema: https://pipedream.com/apps/youtube-data-api/triggers/new-videos-in-subscribed-channels.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
