TL;DR: youtube-transcript-api works on your laptop and then fails with RequestBlocked or IpBlocked as soon as it runs on AWS, Google Cloud, Azure, Heroku or a CI runner. YouTube blocks IP addresses that belong to cloud providers. You have three ways out: keep the job on a home connection, send the library's requests through a residential proxy, or call a hosted transcript API that already handles the proxies. Code for all three is below.

Why it works locally and fails on a server

The library's own README says it plainly in the section Working around IP bans: YouTube has started blocking most IPs known to belong to cloud providers. Your home IP belongs to a consumer internet provider, so YouTube treats it like any viewer. A server IP belongs to a data center, so YouTube answers with a bot check instead of captions.

I measured this while building a transcript tool. From data center IPs, YouTube's player API answered with a "sign in to confirm you're not a bot" check in 11 of 12 requests. Through residential IPs, all 12 of 12 requests returned the caption tracks. Retrying from the same server rarely helps, because the whole IP range is flagged.

If you are on an older version of the library, the same block can show up as a misleading TranscriptsDisabled or NoTranscriptFound error for videos that clearly have captions, or as YouTube's "This request has been detected as a bot" message. Upgrade with pip install -U youtube-transcript-api to get the clearer RequestBlocked / IpBlocked exceptions, then pick one of the fixes below.

Fix 1: Keep it on a home connection

If you need transcripts for a handful of videos, or a one-off dataset, run the script on your own machine. Nothing to configure, nothing to pay.

It stops working when you need it on a schedule (a cron job, a serverless function, a CI pipeline) or at volume. Hundreds of requests from one home IP will eventually get rate-limited too.

Fix 2: Route the library through a residential proxy

youtube-transcript-api accepts a proxy configuration. With any residential proxy provider that gives you an HTTP proxy URL, it looks like this:

from youtube_transcript_api import YouTubeTranscriptApi from youtube_transcript_api.proxies import GenericProxyConfig proxy = "http://USERNAME:PASSWORD@your-residential-proxy-host:PORT" api = YouTubeTranscriptApi(proxy_config=GenericProxyConfig(http_url=proxy, https_url=proxy)) transcript = api.fetch("aircAruvnKk") print(transcript.to_raw_data()[:3]) 

The library also ships a ready-made config for one specific provider; the README section linked above shows it.

Good: you keep the free, open-source library and full control.
Watch out for: you need a proxy subscription billed per GB, the proxy must be residential (data center proxies get the same bot check), and you still write your own retries for the requests that land on a flagged IP. Channels, playlists and search are not part of the library, so listing a channel's videos is another piece you build yourself.

Fix 3: Call a hosted transcript API

If you would rather not run proxies at all, use a service that does it for you. I built one for exactly this: YouTube Transcript Scraper, an Actor on the Apify platform. You send video links, and you get back JSON with the transcript. The residential proxies and the retries happen on its side.

from apify_client import ApifyClient client = ApifyClient("YOUR_APIFY_TOKEN") run = client.actor("aemon/youtube-transcript-scraper").call(run_input={ "urls": ["https://www.youtube.com/watch?v=aircAruvnKk"], }) for item in client.dataset(run["defaultDatasetId"]).iterate_items(): print(item["title"], item["wordCount"]) print(item["text"][:200]) 

This is the real result for that video (shortened):

{ "status": "ok", "videoId": "aircAruvnKk", "title": "But what is a neural network? | Deep learning chapter 1", "channel": "3Blue1Brown", "durationSec": 1120, "views": 25266486, "language": "en", "captionType": "manual", "wordCount": 3357, "text": "This is a 3. It's sloppily written and rendered at an extremely low resolution of 28x28 pixels, but your brain has no trouble recognizing it as a 3...", "segments": [ { "start": 4.22, "end": 5.4, "text": "This is a 3." }, { "start": 6.06, "end": 10.71, "text": "It's sloppily written and rendered at an extremely low resolution of 28x28 pixels," } ] } 

The run took under 10 seconds and moved about 51 KB through the proxy for an 18-minute video, because it reads only the caption data and never downloads the video.

A drop-in replacement for fetch()

If your code already expects the library's format (text, start, duration), wrap the call in a small function and keep the rest of your code as it is:

from apify_client import ApifyClient client = ApifyClient("YOUR_APIFY_TOKEN") def fetch_transcript(video_id: str) -> list[dict]: run = client.actor("aemon/youtube-transcript-scraper").call( run_input={"urls": [video_id], "includeSegments": True} ) item = next(client.dataset(run["defaultDatasetId"]).iterate_items()) if item["status"] != "ok": raise RuntimeError(f'{item["errorCode"]}: {item["error"]}') return [ {"text": s["text"], "start": s["start"], "duration": round(s["end"] - s["start"], 2)} for s in item["segments"] ] print(fetch_transcript("aircAruvnKk")[:3]) 

Bare 11-character video IDs work as input, as do watch, Shorts, live, embed and youtu.be links.

Things the library can't do

Because it is a service rather than a library, a few extras come with it:

  • Whole channels and playlists: pass https://www.youtube.com/@3blue1brown and set how many of the newest videos you want.
  • New videos only: publishedAfter: "2026-11-01" returns just what a channel published since that date, which makes a weekly cron job trivial.
  • YouTube search: searchQueries: ["rag tutorial"] transcribes the top results for a keyword.
  • AI-dubbed videos: when a creator uses YouTube's AI dubbing, the transcript comes from the original language, not a dub.
  • Optional AI summary with chapters, key points and sponsors, and SRT/WebVTT subtitles.

What it costs

$0.002 per video ($2 per 1,000), with the proxy included. Videos without captions, private and removed videos are not charged; they come back as a row with an errorCode such as NO_CAPTIONS. Apify's free plan includes monthly credit, so you can test it on your own videos before paying anything.

Which fix should you pick?

Home connection Library + residential proxy Hosted API
Works on AWS, GCP, Heroku, CI ❌ ✅ ✅
Setup None Proxy account, retries API token
Cost Free Proxy plan, billed per GB $0.002 per video
Channels, playlists, search ❌ Build it yourself ✅ Built in
Best for A few videos, one-off Full control, high volume Pipelines, agents, cron jobs

If you transcribe a few videos by hand, stay local. If you run millions of videos and want to own every part, a proxy plan with the library is the cheapest at that scale. For everything in between, especially scheduled jobs and AI agents, a hosted API saves you the proxy work.

Bonus: YouTube transcripts inside an AI agent

The Actor also works as a tool for Claude, ChatGPT, Cursor and other MCP clients through the Apify MCP server. Add https://mcp.apify.com?tools=aemon/youtube-transcript-scraper to your MCP config and ask "Get the transcript of this video and summarise it in five bullet points". Agents can even pay per run on their own through Apify's agentic payments.

Which of the three are you using today? Tell me in the comments, especially if you have found another way around the block.

Disclosure: I'm the author of YouTube Transcript Scraper, published on Apify under my agency Aemon. The measurements above come from my own test runs in November 2026.