get_video_transcript
Fetch a YouTube video's transcript as plain text without downloading or needing an API key. Gets manual captions or auto-generated ones.
Instructions
Fetch a video's transcript as clean plain text. No download, no API key.
Prefers a human-written caption track and falls back to YouTube's auto-generated one. Nothing is written to disk - the caption track is read straight into memory.
Args: video_url_or_id: An 11-character video ID, or any watch/youtu.be/shorts/ live/embed URL. language: Preferred caption language code (default 'en'). Regional variants match too ('en' will accept 'en-US'); if the language is missing entirely, the first available track is used. include_timestamps: True prefixes each paragraph with [H:MM:SS], which is what you want when you intend to cite a moment in the video. max_chars: Truncate the transcript at this many characters (0 = no limit). Set it when scanning many videos, since a long tutorial can run tens of thousands of characters.
Returns: { "video_id": str, "title": str | None, "channel": str | None, "url": str, "duration_seconds": int | None, "duration": str | None, "upload_date": str | None, # "2022-08-14" "transcript_kind": str, # "manual" or "automatic" "language": str, # track actually used, e.g. "en" "char_count": int, "truncated": bool, "transcript": str # blank-line separated ~30s paragraphs }
Errors: Raises ValueError for an unparseable video reference, and RuntimeError when the video is unavailable or has no caption track at all (some videos genuinely have none - listen for that message rather than retrying).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| language | No | en | |
| max_chars | No | ||
| video_url_or_id | Yes | ||
| include_timestamps | No |