CONNECT APP
Build with YouTube Data
Entertainment
- OAuth
MCP
Give your agent YouTube Data tools
Every YouTube Data action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's YouTube Data account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{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"],
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{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",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Add Playlist Items:
result = await session.call_tool("youtube_data_api-add-playlist-items", {
"playlistId": "Playlist ID",
"videoIds": ["Video IDs"],
})API PROXY
Call the YouTube Data API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the YouTube Data API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://www.googleapis.com/oauth2/v1/userinfo",
})
// Any allowed YouTube Data endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# 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"SDK
Run YouTube Data actions from your backend
Connect a user's YouTube Data account once, then run Add Playlist Items on their behalf from your own code — TypeScript, Python, or plain HTTP.
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"],
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="youtube_data_api-add-playlist-items",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"youtube_data_api": {"authProvisionId": "apn_xxxxxxx"},
"playlistId": "Playlist ID",
"videoIds": ["Video IDs"],
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "youtube_data_api-add-playlist-items",
"configured_props": {
"youtube_data_api": { "authProvisionId": "apn_xxxxxxx" },
"playlistId": "Playlist ID",
"videoIds": ["Video IDs"]
}
}'TOOLS
YouTube Data actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Add Playlist Items
actionAdds resources to a playlist. See the documentation for more informationWritev0.0.3 -
Channel Statistics
actionReturns statistics from my YouTube Channel or by id. See the documentation for more informationRead-onlyv0.0.5 -
Create Comment Thread
actionCreates a new top-level comment in a video. See the documentation for more informationWritev0.0.5 -
Create Playlist
actionCreates a playlist. See the documentation for more informationWritev0.0.4 -
Delete Playlist
actionDeletes a playlist. See the documentation for more informationWritev0.0.3 -
Delete Playlist Items
actionDeletes a playlist item. See the documentation for more informationWritev0.0.3 -
List Activities
actionReturns a list of channel activity events that match the request criteria. See the documentation for more informationRead-onlyv0.0.5 -
List Language Options
actionRetrieves available language options for the Language (hl) field.Read-onlyv0.0.1 -
List Playlist Videos
actionList videos in a playlist. See the documentation for more informationRead-onlyv0.0.3 -
List Playlists
actionReturns a collection of playlists that match the API request parameters. See the documentation for more informationRead-onlyv0.0.5 -
List Videos
actionReturns a list of videos that match the API request parameters. See the documentation for more informationRead-onlyv0.0.5 -
Reply To Comment
actionCreates a reply to an existing comment. See the documentation for more informationWritev0.0.3 -
Search Videos
actionReturns a list of videos that match the search parameters. See the documentation for more informationRead-onlyv0.0.2 -
Update Channel
actionUpdates a channel's metadata. See the documentation for more informationWritev0.0.3 -
Update Playlist
actionModifies a playlist. For example, you could change a playlist's title, description, or privacy status. See the documentation for more informationWritev0.0.5 -
Update Video Details
actionUpdates a video's metadata. See the documentation for more informationWritev0.0.3 -
Upload Channel Banner
actionUploads a channel banner image to YouTube. See the documentation for more informationWritev1.0.2 -
Upload Thumbnail
actionUploads a custom video thumbnail to YouTube and sets it for a video. Note: Account must be verified. See the documentation for more informationRead-onlyv1.0.4 -
Upload Video
actionPost a video to your channel. See the documentation for more informationWritev1.0.2
EVENTS
YouTube Data triggers
Event sources your backend can deploy for users and receive through a webhook.
-
New Comment In Channel
triggerEmit new event for each new comment or reply posted to a Youtube channel (or any of its videos).v0.0.1 -
New Comment Posted
triggerEmit new event for each new comment or reply posted to a Youtube video.v0.0.3 -
New Liked Videos
triggerEmit new event for each new Youtube video liked by the authenticated user.v0.0.6 -
New Subscriber
triggerEmit new event for each new Youtube subscriber to a user Channel.v0.0.6 -
New Subscription
triggerEmit new event for each new subscription from authenticated user.v0.0.6 -
New Videos
triggerEmit new event for each new Youtube video the user posts.v0.0.10 -
New Videos by Handle
triggerEmit new event for each new Youtube video tied to a handle.v0.0.3 -
New Videos by Search
triggerEmit new event for each new YouTube video matching the search criteria.v0.0.11 -
New Videos in Playlist
triggerEmit new event for each new Youtube video added to a Playlist.v0.0.12 -
New Videos in Subscribed Channels
triggerEmit new event for each new YouTube video posted to a subscribed channel.v0.0.7
MULTI-APP
Use YouTube Data with other popular apps
Most products don't stop at one integration. Pair YouTube Data with the other apps your users rely on, and ship use cases that span both.
- App slug
- youtube_data_api
- Authentication
- OAuth
- Categories
- Entertainment
- Actions
- 19
- Triggers
- 10
- API proxy
- Available
OAuth scopes
These are the scopes Pipedream's managed YouTube Data OAuth client requests when one of your users connects an account. Supply your own OAuth client to request a different set.
- 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