wickend.dev / Projects / youtube-transcript-ts
TypeScriptnpmYouTube live shipped Mar 14, 2025

youtube-transcript-ts

a TypeScript package that fetches YouTube video transcripts via the same internal endpoint the web player uses — no API key, no scraping, runs in Node and the browser.

§ the story

Every “fetch YouTube transcript” library on npm is some flavor of broken because YouTube keeps tightening the bolts on the player’s internal API. What ships on npm today probably stopped working three months ago.

This one solves that by reading the transcript out of the same player-config blob the JS player itself parses on page load. As long as the web player keeps loading, the package keeps working — and updating it when YouTube renames a field is a one-line patch.

surface area

  • getTranscript(videoId) — full transcript with timestamps.
  • getTranscriptAsText(videoId) — flattened plain text.
  • getAvailableLanguages(videoId) — list of caption tracks (English, auto-translated, community-contributed).
  • Browser + Node both supported. Zero runtime dependencies in Node. In the browser, you supply fetch.

where it ends up

Used downstream in a few of my own AI projects (transcript → Claude → summary), and surprisingly often in CI for “did the talk recording include the announcement we promised?” smoke tests.

pnpm add youtube-transcript-ts.

// shipped on a Wickend, Mar 14, 2025