You need YouTube transcripts — for a RAG pipeline, content repurposing, or research. Here are the real options in late 2026, with working code and honest trade-offs.

1. youtube-transcript-api (Python) — the library everyone reaches for

from youtube_transcript_api import YouTubeTranscriptApi ytt = YouTubeTranscriptApi() transcript = ytt.fetch("UF8uR6Z6KLc") print(" ".join(s.text for s in transcript)) 

Pros: two lines, free, no API key. Cons: YouTube aggressively rate-limits datacenter IPs — expect IpBlocked/RequestBlocked errors the moment you scale past a few hundred videos or run it from a cloud box. You end up bolting on residential proxies anyway.

2. Raw timedtext endpoints — maximum control

Fetch the video's player response, read captions.captionTracks, request the track URL with fmt=json3. You get segments with start/duration/text.

Pros: zero dependencies, exact data YouTube serves the browser. Cons: you own the anti-block battle — IP rotation, client emulation (WEB client now requires attestation; IOS/ANDROID still work), retry logic.

3. youtubei.js (Node) — the pragmatic middle ground

import { Innertube } from 'youtubei.js'; const yt = await Innertube.create({ retrieve_player: false }); const info = await yt.getBasicInfo('UF8uR6Z6KLc', { client: 'IOS' }); const track = info.captions.caption_tracks[0]; const res = await fetch(track.base_url + '&fmt=json3'); const segs = (await res.json()).events .filter(e => e.segs).flatMap(e => e.segs.map(s => s.utf8)); console.log(segs.join(' ')); 

The mobile clients (IOS, ANDROID) still return caption tracks where the WEB client now demands proof-of-work tokens. This is the approach that survives longest before YouTube tightens again.

4. Managed API — when you don't want to babysit proxies

If the goal is thousands of transcripts rather than a weekend script, running the scraper yourself means owning proxy rotation, failure retries, and YouTube's quarterly breakage. A ready-made alternative on Apify: YouTube Transcript Scraper — paste a list of URLs, get JSON items with text, optional timestamps, language selection, video metadata. It rotates proxies internally and you pay per result (~$2 per 1,000 transcripts), so it's the option where cost scales with output rather than with infrastructure pain.

curl -X POST "https://api.apify.com/v2/acts/jarvis-duo-studio~youtube-transcript-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"videoUrls": ["https://www.youtube.com/watch?v=UF8uR6Z6KLc"], "language": "en", "includeTimestamps": true}' 

Honest verdict

  • < 500 videos, from home: youtube-transcript-api, done.
  • Custom pipeline, you enjoy plumbing: youtubei.js + mobile clients.
  • Bulk, recurring, or production: managed API — own the output, not the proxy fleet.

Full disclosure: option 4 is my own Actor — priced so it only makes sense at volume. Options 1-3 are genuinely the better fit for small jobs.