Skip to content
Components

YouTube Data API

The YouTube Data API source connector uses the YouTube Data API to extract data about your YouTube channels or your YouTube activity. It is ideal for obtaining basic information about your channels, playlists, and videos.

To begin, create a new configuration for the YouTube connector. Then click Authorize Account to authorize the configuration.

Select one of the two available templates:

  • Channels: Provides information about your channels.
  • Videos: Offers details about your playlists and their associated videos.

Screenshot - Create configuration

You can switch to the JSON editor for more advanced configurations.

To give a simple example, the configuration for details about your channel looks like this:

{
"jobs": [
{
"endpoint": "channels?mine=true&part=snippet,contentDetails,statistics",
"dataType": "channels",
"dataField": "items"
}
]
}

To learn what is the correct endpoint, look to YouTube’s API documentation and browse for, e.g., Channels: list. Choose one of the predefined use cases, for instance, list (my channel), and switch the example to CURL. The endpoint is under # HTTP URL:, where you omit the base URL https://www.googleapis.com/youtube/v3/.

Screenshot - YouTube API

You can use other Generic Extractor’s functionality, too, including nesting. This example downloads your channel, iterates through its playlists, and gets all their videos:

{
"jobs": [
{
"endpoint": "channels?mine=true&part=id,snippet",
"dataType": "channels",
"dataField": "items",
"children": [
{
"endpoint": "playlists?channelId={channelId}&part=id,snippet",
"dataType": "playlists",
"dataField": "items",
"placeholders": {
"channelId": "id"
},
"children": [
{
"endpoint": "playlistItems?playlistId={playlistId}&part=id,snippet",
"dataType": "videos",
"dataField": "items",
"placeholders": {
"playlistId": "id"
}
}
]
}
]
}
]
}
Ask Kai

Hi, I'm Kai — Keboola's AI assistant for the docs. Ask me anything and I'll answer from the documentation and cite the pages I use.

Kai is an AI and can make mistakes. Check the sources it links.