# Youtube Transcript

> Fetches existing YouTube video transcripts via the YouTube transcript API. Use when the user needs a YouTube video script, transcript, or captions, or when working with YouTube URLs.

- Skill: `ojbduce/youtube-transcript` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add ojbduce/youtube-transcript`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ojbduce/youtube-transcript/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: ojbduce (https://skillmd.com/u/ojbduce)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/ojbduce/youtube-transcript

---


# YouTube Transcript Skill

## Purpose

Fetch the existing transcript/captions for a YouTube video. This skill does NOT download audio or call transcription APIs — it only retrieves transcripts YouTube already has.

## How to Use

```bash
python ~/.cursor/skills/youtube-transcript/scripts/youtube_transcript.py --url <youtube_url>
```

### Arguments

| Arg | Required | Description |
|-----|----------|-------------|
| `--url` | Yes | YouTube video URL |
| `--output` | No | Write transcript to file; if omitted, print to stdout |
| `--output-format` | No | `text` (default) or `json` |
| `--language` | No | Preferred language code (default: `en`) |
| `--test` | No | Run diagnostics against a known test video |

### Exit Codes

- `0` Success
- `1` Invalid args or URL
- `3` Transcript not available

Errors go to stderr. Transcript goes to stdout or `--output` file.

## On Failure

If this skill exits with code 3 (transcript not available), use the `transcribe-audio` skill as fallback:

```bash
python ~/.cursor/skills/transcribe-audio/scripts/transcribe_audio.py --youtube-url <same_url>
```

## Output Formats

**text** (default): Plain transcript.

**json**:
```json
{
  "url": "https://...",
  "video_id": "...",
  "source": "youtube_api",
  "transcript": "..."
}
```

## Dependencies

- `youtube-transcript-api` (pip install youtube-transcript-api)

