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
- Input Schema
- Output Schema
operation'searchVideos' | 'getTranscript' | 'scrapeChannel' required- Operation: searchVideos for search/URLs, getTranscript for transcripts, scrapeChannel for channel videos. Not all videos will have transcript available.
searchQueriesstring[]- Search queries for YouTube (for searchVideos). Examples: ["AI tutorials", "react hooks"]
videoUrlsstring[]- Direct YouTube URLs - videos, channels, playlists (for searchVideos or getTranscript)
channelUrlstring- YouTube channel URL (for scrapeChannel operation)
videoUrlstring- Single video URL for transcript extraction (for getTranscript)
maxResultsnumber- Max videos to fetch (default: 20)
includeShortsboolean- Include YouTube Shorts in results
credentialsRecord<CredentialType,string>- Required credentials (auto-injected)
operation'searchVideos' | 'getTranscript' | 'scrapeChannel' required- Operation performed
videosobject[]- Array of YouTube videos
transcriptobject[]- Video transcript with timestamps
fullTranscriptTextstring- Complete transcript as plain text
totalResultsnumber required- Total number of results
successboolean required- Whether operation succeeded
errorstring required- Error message if failed