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.
Go to siteThe YouTube Data API lets you incorporate functions normally executed on the YouTube website into your own website or application. You can perform operations like searching for videos, retrieving channel data, and managing playlists. When integrated with Pipedream's serverless platform, this API can be part of automations that react to events, synchronize YouTube data with other services, or generate custom reports.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
youtube_data_api: {
type: "app",
app: "youtube_data_api",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://www.googleapis.com/oauth2/v1/userinfo`,
headers: {
Authorization: `Bearer ${this.youtube_data_api.$auth.oauth_access_token}`,
},
})
},
})
Automated Video Reporting: Create a workflow that triggers weekly to fetch new videos from a specific YouTube channel using the YouTube Data API and compiles a report with views and engagement data. This report can then be sent to an email or a Slack channel.
Dynamic Playlist Management: Build an automation that monitors a Google Sheet for new rows containing video URLs, and using the YouTube Data API, adds those videos to a designated YouTube playlist. This is ideal for collaborative video collection or content curation projects.
Social Media Cross-Posting: Design a workflow that watches for new videos on your YouTube channel, then uses the YouTube Data API to get the video details and post them to Twitter, LinkedIn, or another social platform, broadening your content's reach.
Emit new event for each new comment or reply posted to a Youtube channel (or any of its videos).
Emit new event for each new comment or reply posted to a Youtube video.
Emit new event for each new Youtube video liked by the authenticated user.
Emit new event for each new Youtube subscriber to user Channel.
Emit new event for each new subscription from authenticated user.
Adds resources to a playlist. See the docs for more information
Returns statistics from my YouTube Channel or by id. See the docs for more information
Creates a new top-level comment in a video. See the docs for more information
Creates a playlist. See the docs for more information
Deletes a playlist. See the docs for more information
YouTube (Data API) uses OAuth authentication. When you connect your YouTube (Data API) account, Pipedream will open a popup window where you can sign into YouTube (Data API) and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any YouTube (Data API) API.
Pipedream requests the following authorization scopes when you connect your account:
email
profile
https://www.googleapis.com/auth/youtube.readonly
https://www.googleapis.com/auth/youtube.upload
https://www.googleapis.com/auth/youtube
GET
https://accounts.google.com/o/oauth2/v2/auth
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
&
access_type=offline
&
prompt=consent
POST
https://oauth2.googleapis.com/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://oauth2.googleapis.com/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}