Toolpal

@toolpal/youtube-transcript

public

v2.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.

manifest.json7.1 KBRaw
{
  "manifestVersion": 1,
  "name": "@toolpal/youtube-transcript",
  "version": "2.0",
  "description": "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.",
  "license": "MIT",
  "keywords": [
    "youtube",
    "transcript",
    "captions",
    "subtitles",
    "video",
    "research"
  ],
  "entry": "dist/tool.mjs",
  "sdk": "0.1.0",
  "engines": {
    "node": ">=22.15.0"
  },
  "inputSchema": {
    "type": "object",
    "required": [
      "video"
    ],
    "properties": {
      "video": {
        "type": "string",
        "minLength": 11,
        "maxLength": 300,
        "description": "YouTube URL (watch, youtu.be, shorts, live, embed) or 11-character video ID"
      },
      "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\""
      },
      "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"
      },
      "includeSegments": {
        "type": "boolean",
        "description": "Include the per-line timestamped segments array in JSON output; default true"
      }
    }
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "videoId",
      "url",
      "title",
      "channel",
      "durationSeconds",
      "language",
      "isAutoGenerated",
      "availableLanguages",
      "chapters",
      "wordCount",
      "transcript",
      "file"
    ],
    "properties": {
      "videoId": {
        "type": "string"
      },
      "url": {
        "type": "string"
      },
      "title": {
        "type": "string"
      },
      "channel": {
        "type": "string"
      },
      "durationSeconds": {
        "type": "integer"
      },
      "publishDate": {
        "type": "string"
      },
      "language": {
        "type": "string"
      },
      "isAutoGenerated": {
        "type": "boolean"
      },
      "availableLanguages": {
        "type": "array",
        "items": {
          "type": "object",
          "required": [
            "code",
            "name",
            "isAutoGenerated"
          ],
          "properties": {
            "code": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "isAutoGenerated": {
              "type": "boolean"
            }
          }
        }
      },
      "chapters": {
        "type": "array",
        "items": {
          "type": "object",
          "required": [
            "start",
            "timestamp",
            "title"
          ],
          "properties": {
            "start": {
              "type": "integer"
            },
            "timestamp": {
              "type": "string"
            },
            "title": {
              "type": "string"
            }
          }
        }
      },
      "wordCount": {
        "type": "integer"
      },
      "transcript": {
        "type": "string",
        "description": "Full plain-text transcript"
      },
      "segments": {
        "type": "array",
        "items": {
          "type": "object",
          "required": [
            "start",
            "duration",
            "text"
          ],
          "properties": {
            "start": {
              "type": "number"
            },
            "duration": {
              "type": "number"
            },
            "text": {
              "type": "string"
            }
          }
        }
      },
      "file": {
        "type": "string",
        "description": "Saved transcript file (.txt, .md, .srt, or .vtt)",
        "x-toolpal-file": true
      }
    }
  },
  "examples": [
    {
      "title": "Fetch a timestamped transcript",
      "input": {
        "video": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
        "format": "timestamped"
      },
      "output": {
        "videoId": "jNQXAC9IVRw",
        "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
        "title": "Me at the zoo",
        "channel": "jawed",
        "durationSeconds": 19,
        "publishDate": "2005-04-23T20:31:52-07:00",
        "language": "en",
        "isAutoGenerated": false,
        "availableLanguages": [
          {
            "code": "en",
            "name": "English",
            "isAutoGenerated": false
          },
          {
            "code": "de",
            "name": "German",
            "isAutoGenerated": false
          }
        ],
        "chapters": [
          {
            "start": 0,
            "timestamp": "00:00",
            "title": "Intro"
          },
          {
            "start": 5,
            "timestamp": "00:05",
            "title": "The cool thing"
          },
          {
            "start": 17,
            "timestamp": "00:17",
            "title": "End"
          }
        ],
        "wordCount": 39,
        "transcript": "All right, so here we are, in front of the elephants the cool thing about these guys is that they have really... really really long trunks and that's cool (baaaaaaaaaaahhh!!) and that's pretty much all there is to say",
        "segments": [
          {
            "start": 1.2,
            "duration": 2.16,
            "text": "All right, so here we are, in front of the elephants"
          },
          {
            "start": 5.32,
            "duration": 2.66,
            "text": "the cool thing about these guys is that they have really..."
          },
          {
            "start": 7.97,
            "duration": 4.64,
            "text": "really really long trunks"
          },
          {
            "start": 12.62,
            "duration": 1.75,
            "text": "and that's cool"
          },
          {
            "start": 14.42,
            "duration": 1.31,
            "text": "(baaaaaaaaaaahhh!!)"
          },
          {
            "start": 16.88,
            "duration": 2,
            "text": "and that's pretty much all there is to say"
          }
        ],
        "file": "me-at-the-zoo.txt"
      },
      "outputFiles": {
        "file": {
          "name": "me-at-the-zoo.txt",
          "size": 266,
          "mediaType": "text/plain"
        }
      }
    }
  ],
  "permissions": {
    "net": true,
    "env": [],
    "tmp": true
  },
  "limits": {
    "timeoutMs": 30000,
    "memoryMb": 128
  },
  "build": {
    "toolpal": "0.1.0",
    "esbuild": "0.28.2",
    "options": "sha256-tMpkndD8HsDUvZadrPbEAMGGIGK7nvmTGxMMlUxy9Fo="
  }
}