Skip to main content

Youtube Tool

Search YouTube videos, extract transcripts, and scrape channel content with a simple interface

Quick Start

import { YouTubeTool } from '@bubblelab/bubble-core';
import { CredentialType } from '@bubblelab/shared-schemas';
const result = await new YouTubeTool({
operation: 'searchVideos',
credentials: {
[CredentialType.APIFY_CRED]: process.env.APIFY_CRED as string,
},
}).action();

Operation Details

execute

operation 'searchVideos' | 'getTranscript' | 'scrapeChannel' required
Operation: searchVideos for search/URLs, getTranscript for transcripts, scrapeChannel for channel videos. Not all videos will have transcript available.
searchQueries string[]
Search queries for YouTube (for searchVideos). Examples: ["AI tutorials", "react hooks"]
videoUrls string[]
Direct YouTube URLs - videos, channels, playlists (for searchVideos or getTranscript)
channelUrl string
YouTube channel URL (for scrapeChannel operation)
videoUrl string
Single video URL for transcript extraction (for getTranscript)
maxResults number
Max videos to fetch (default: 20)
includeShorts boolean
Include YouTube Shorts in results
credentials Record<CredentialType,string>
Required credentials (auto-injected)