Python tools
YouTube transcripts in CrewAI
Give a CrewAI agent three YouTube tools: read a video's transcript (optionally with [m:ss] timestamps), search YouTube, and list a channel's videos. Errors come back to the agent as text, so one bad video doesn't stop the crew.
Set it up
- 1
Install the tools
Into the same environment as crewai:
pip install crewai-getyoutubetranscript - 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_...
A video research crew
from crewai import Agent, Crew, Task
from crewai_getyoutubetranscript import GetYouTubeTranscriptTool, YouTubeSearchTool
researcher = Agent(
role="Video researcher",
goal="Find the best YouTube talks on a topic and summarize them with timestamps",
backstory="You turn long videos into short, cited notes.",
tools=[YouTubeSearchTool(), GetYouTubeTranscriptTool()],
)
task = Task(
description="Find a talk about vector databases and summarize its key points with [m:ss] timestamps.",
expected_output="A bullet list of key points, each with a timestamp.",
agent=researcher,
)
print(Crew(agents=[researcher], tasks=[task]).kickoff())What you can build
- A competitor-monitoring crew that lists a channel's new videos and summarizes them.
- Content repurposing: one agent reads the transcript, another drafts posts from it.
- Use a tool directly: GetYouTubeTranscriptTool().run(video="https://youtu.be/...", timestamps=True).
Links
Questions about CrewAI
Which tools are included?
GetYouTubeTranscriptTool, YouTubeSearchTool and YouTubeChannelVideosTool (by @handle, URL or channel ID, newest first).
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.