Black Friday · 30% off

Get 30% off

Python component

YouTube transcripts in Haystack

GetYouTubeTranscriptFetcher turns YouTube URLs into Haystack Documents, one per video, ready for splitting, embedding and retrieval. Wrap it in a ComponentTool and a Haystack agent can read videos on demand.

Set it up

  1. 1

    Install the component

    Into the same environment as haystack-ai:

    pip install getyoutubetranscript-haystack
  2. 2

    Get an API key

    Sign in at getyoutubetranscript.com and create a key on the developers page (100 free credits, no card). Keys start with sk_live_. Set it as an environment variable:

    export GETYOUTUBETRANSCRIPT_API_KEY=sk_live_...

Index a video in a pipeline

from haystack import Pipeline
from haystack.components.preprocessors import DocumentSplitter
from haystack.components.writers import DocumentWriter
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack_integrations.components.fetchers.getyoutubetranscript import GetYouTubeTranscriptFetcher

store = InMemoryDocumentStore()
indexing = Pipeline()
indexing.add_component("fetcher", GetYouTubeTranscriptFetcher())
indexing.add_component("splitter", DocumentSplitter(split_by="word", split_length=200))
indexing.add_component("writer", DocumentWriter(document_store=store))
indexing.connect("fetcher.documents", "splitter.documents")
indexing.connect("splitter.documents", "writer.documents")
indexing.run({"fetcher": {"videos": ["https://youtu.be/5e37ZT3SQbk"]}})

What you can build

  • RAG over talks and lectures with any Haystack document store.
  • An agent tool: ComponentTool(component=GetYouTubeTranscriptFetcher(timestamps=True), name="youtube_transcript", ...).
  • Batch jobs that skip failures: raise_on_failure=False logs and skips videos without captions.

Links

Questions about Haystack

Can I save the pipeline as YAML?

Yes. The component serializes with to_dict() and from_dict() and keeps the key as an environment variable reference.

What happens when a video has no captions?

By default the run raises. Set raise_on_failure=False to log and skip those videos instead.

What does it cost?

Each transcript, search or channel page uses one credit from your account, and failed requests are not charged. New accounts get 100 free credits, no card, and paid plans add more credits each month.

Use it in your other tools

All integrations

Featured on aitoolfame.comFeatured on Aura++Featured on DeepLaunch.ioFeatured on Dofollow.ToolsFeatured on EasyDoFollowFeatured on EarlyHuntFeatured on Findly.toolsFeatured on FoundrListGood AI ToolsFeatured on IndieHuntFeatured on LaunchBuffFeatured on launched.toolsFeatured on Launch Llama ToolsFeatured on LemonLaunchLiftOff launch badgeMy Launch StashGetYouTubeTranscript on Nick LaunchesOpenHunts Club MemberFeatured on saasfame.comShinyLaunchFeatured on ShowMeBestAIFeatured on toolfame.comListed on Turbo0Featured on Twelve ToolsHuzzler Embed BadgeFeatured on CodeHypeGetYouTubeTranscript on Better LaunchDokeyAIFeatured on WayfindioFeatured on LaunchZoneFeatured on NoonlaunchFeatured on WhatsthebigdataSurfaced on CodeTrendyFeatured on ScrollLaunchFeatured on ufind.bestFeatured on ShipBoostProduct WingWe Like ToolsAppa ListAcid ToolsPower Up ToolsToshi ListAIGC 160Appsy ToolsHunt for ToolsBeam ToolsTool Find DirTool SignalSaaS Tools DirSoftware BoltProduct List DirStack DirectorySaaS FieldSaaS WheelSaaS RootsStartup BenchmarksUnite ListTrustinerBest Tool VaultSolver ToolsAsh ListSmart Kit HubAI X CollectionAI Tech ViralMillion Dot HomepageThat App ShowLaunch ScrollMy Start ToolsLatest AI UpdatesSuper AI BoomTools Under RadarThe Key ToolsTool JourneyTools List HQThe App ToolsThe Mega ToolsSource DirTool CosmosTop Trend ToolsTiny Tool HubTool PrismStartup AIdeasFeatured on WonderLaunchFeatured on ShipycornFeatured on ToolsClawListed on ProofStoriesFeatured on ToolListedLaunched on Launch Streak