Skip to main content
The YouTube tool lets an agent search videos, fetch details, and pull transcripts.

Overview

YouTube tool allows you to search videos, get video details, and extract transcripts.

Installation

Environment Variables

Quick Start

1

Simple Usage

2

With Configuration

Use the same tool with an agent — see Usage with Agent below, or pass env vars and options from the sections above.

How It Works

Usage with Agent

Available Methods

search(query, max_results=5)

Search YouTube videos.

get_video(video_id)

Get video details.

get_transcript(video_id)

Get video transcript.

Common Errors

Best Practices

Basic transcript features work without a key, but video search needs YOUTUBE_API_KEY. Set it in your shell or .env.
search(query, max_results=5) defaults to 5. Keep it low so the agent processes fewer videos per query.
Not every video has captions. Wrap get_transcript(video_id) in try/except so the agent can skip or report videos without transcripts.

Spotify

Music search

Wikipedia

Knowledge base