@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.
Fetches the transcript, timestamps, chapters, and metadata for any public YouTube video — with no API key required.
How it works
- Accepts any YouTube URL (
watch?v=...,youtu.be/...,/shorts/...,/live/...,/embed/...) or a bare 11-character video ID. - Fetches video metadata, description chapters, and available caption tracks via YouTube's InnerTube player endpoint.
- Picks your preferred
language(preferring human-authored captions over auto-generated ones) and optionally translates captions viatranslateTo. - Returns structured metadata, chapters, full plain-text transcript, timestamped segments, and writes a ready-to-use file (
.txt,.md,.srt, or.vtt).
Example
{
"video": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"language": "en",
"format": "timestamped"
}Notes
- Requires no API key or environment variables (
net: trueto 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-notesor@toolpal/translate-document.
Input
Validated before the workflow runs.
- videorequiredstring
YouTube URL (watch, youtu.be, shorts, live, embed) or 11-character video ID
min length 11 · max length 300
- format"text" | "timestamped" | "markdown" | "srt" | "vtt"
Output file format; timestamped by default
- languagestring
Preferred caption language code, e.g. "en", "es", "hi"; defaults to English or first available
max length 16
- translateTostring
Optional target language code for YouTube auto-translation, e.g. "en", "fr"
max length 16
- includeSegmentsboolean
Include the per-line timestamped segments array in JSON output; default true
| Field | Type | Description |
|---|---|---|
| videorequired | string | YouTube URL (watch, youtu.be, shorts, live, embed) or 11-character video ID min length 11 · max length 300 |
| format | "text" | "timestamped" | "markdown" | "srt" | "vtt" | Output file format; timestamped by default |
| language | string | Preferred caption language code, e.g. "en", "es", "hi"; defaults to English or first available max length 16 |
| translateTo | string | Optional target language code for YouTube auto-translation, e.g. "en", "fr" max length 16 |
| includeSegments | boolean | Include the per-line timestamped segments array in JSON output; default true |
JSON Schema
{
"type": "object",
"required": [
"video"
],
"properties": {
"video": {
"type": "string",
"maxLength": 300,
"minLength": 11,
"description": "YouTube URL (watch, youtu.be, shorts, live, embed) or 11-character video ID"
},
"format": {
"anyOf": [
{
"type": "string",
"const": "text"
},
{
"type": "string",
"const": "timestamped"
},
{
"type": "string",
"const": "markdown"
},
{
"type": "string",
"const": "srt"
},
{
"type": "string",
"const": "vtt"
}
],
"description": "Output file format; timestamped by default"
},
"language": {
"type": "string",
"maxLength": 16,
"description": "Preferred caption language code, e.g. \"en\", \"es\", \"hi\"; defaults to English or first available"
},
"translateTo": {
"type": "string",
"maxLength": 16,
"description": "Optional target language code for YouTube auto-translation, e.g. \"en\", \"fr\""
},
"includeSegments": {
"type": "boolean",
"description": "Include the per-line timestamped segments array in JSON output; default true"
}
}
}Output
Validated before your agent receives it.
- urlrequiredstring
- filerequiredfile
Saved transcript file (.txt, .md, .srt, or .vtt)
- titlerequiredstring
- channelrequiredstring
- videoIdrequiredstring
- chaptersrequiredobject[]
- languagerequiredstring
- segmentsobject[]
- wordCountrequiredinteger
- transcriptrequiredstring
Full plain-text transcript
- publishDatestring
- durationSecondsrequiredinteger
- isAutoGeneratedrequiredboolean
- availableLanguagesrequiredobject[]
| Field | Type | Description |
|---|---|---|
| urlrequired | string | - |
| filerequired | file | Saved transcript file (.txt, .md, .srt, or .vtt) |
| titlerequired | string | - |
| channelrequired | string | - |
| videoIdrequired | string | - |
| chaptersrequired | object[] | - |
| languagerequired | string | - |
| segments | object[] | - |
| wordCountrequired | integer | - |
| transcriptrequired | string | Full plain-text transcript |
| publishDate | string | - |
| durationSecondsrequired | integer | - |
| isAutoGeneratedrequired | boolean | - |
| availableLanguagesrequired | object[] | - |
JSON Schema
{
"type": "object",
"required": [
"videoId",
"url",
"title",
"channel",
"durationSeconds",
"language",
"isAutoGenerated",
"availableLanguages",
"chapters",
"wordCount",
"transcript",
"file"
],
"properties": {
"url": {
"type": "string"
},
"file": {
"type": "string",
"description": "Saved transcript file (.txt, .md, .srt, or .vtt)",
"x-toolpal-file": true
},
"title": {
"type": "string"
},
"channel": {
"type": "string"
},
"videoId": {
"type": "string"
},
"chapters": {
"type": "array",
"items": {
"type": "object",
"required": [
"start",
"timestamp",
"title"
],
"properties": {
"start": {
"type": "integer"
},
"title": {
"type": "string"
},
"timestamp": {
"type": "string"
}
}
}
},
"language": {
"type": "string"
},
"segments": {
"type": "array",
"items": {
"type": "object",
"required": [
"start",
"duration",
"text"
],
"properties": {
"text": {
"type": "string"
},
"start": {
"type": "number"
},
"duration": {
"type": "number"
}
}
}
},
"wordCount": {
"type": "integer"
},
"transcript": {
"type": "string",
"description": "Full plain-text transcript"
},
"publishDate": {
"type": "string"
},
"durationSeconds": {
"type": "integer"
},
"isAutoGenerated": {
"type": "boolean"
},
"availableLanguages": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"name",
"isAutoGenerated"
],
"properties": {
"code": {
"type": "string"
},
"name": {
"type": "string"
},
"isAutoGenerated": {
"type": "boolean"
}
}
}
}
}
}