@toolpal/youtube-transcript
publicv2.0published 1 download this weekMIT
Fetches the transcript, timestamped segments, chapters, and video metadata (title, channel, duration, publish date, available languages) from a public YouTube URL or video ID, and saves the transcript as a .txt, .md, .srt, or .vtt file. No API key needed.
You're viewing 1.0, an older version
The latest is 2.0.
# @toolpal/youtube-transcript
Fetches the transcript, timestamps, chapters, and metadata for any public YouTube video — with no API key required.
## How it works
1. Accepts any YouTube URL (`watch?v=...`, `youtu.be/...`, `/shorts/...`, `/live/...`, `/embed/...`) or a bare 11-character video ID.
2. Fetches video metadata, description chapters, and available caption tracks via YouTube's InnerTube player endpoint.
3. Picks your preferred `language` (preferring human-authored captions over auto-generated ones) and optionally translates captions via `translateTo`.
4. Returns structured metadata, chapters, full plain-text transcript, timestamped segments, and writes a ready-to-use file (`.txt`, `.md`, `.srt`, or `.vtt`).
## Example
```json
{
"video": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"language": "en",
"format": "timestamped"
}
```
## Notes
- Requires no API key or environment variables (`net: true` to YouTube).
- Works with any public video that has manual or auto-generated captions enabled.
- Output files (`.txt`, `.md`, `.srt`, `.vtt`) can be passed directly into `@toolpal/meeting-notes` or `@toolpal/translate-document`.