youtube-transcript-api RequestBlocked or IpBlocked: why it happens and how to fix it
Checked on 2026-11-18.
Your script fetched transcripts fine on your laptop. On a server it raises RequestBlocked or IpBlocked. Your code did not break: YouTube is refusing the address the request comes from.
What the error means
The library's own README puts it plainly: "YouTube has started blocking most IPs that are known to belong to cloud providers". AWS, Google Cloud, Azure, most VPS hosts and serverless platforms all send requests from such addresses, so the same call that works at home is refused there. The two exceptions the README names for this are RequestBlocked and IpBlocked.
To confirm that this is your case, run the same script on your own computer with the same video ID. If it works there and fails on the server, it is the address, not your code.
Fix 1: run it from an address that is not blocked
For a one-off job, such as a few hundred videos for a research project, run the script on your own machine and upload the result. It costs nothing and needs no changes. It stops being practical when the job has to run on a schedule or behind a web app.
Fix 2: send the requests through rotating residential proxies
This is the fix the README describes. The library has two proxy settings built in:
from youtube_transcript_api import YouTubeTranscriptApi
from youtube_transcript_api.proxies import GenericProxyConfig, WebshareProxyConfig
# A Webshare "residential" plan, which the library supports directly
api = YouTubeTranscriptApi(
proxy_config=WebshareProxyConfig(
proxy_username="<proxy-username>",
proxy_password="<proxy-password>",
)
)
# Or any other proxy provider
api = YouTubeTranscriptApi(
proxy_config=GenericProxyConfig(
http_url="http://user:pass@my-custom-proxy.org:port",
https_url="https://user:pass@my-custom-proxy.org:port",
)
)
transcript = api.fetch("jNQXAC9IVRw")It works, with two costs. You pay for a proxy plan, usually by traffic, and you own the upkeep: a single static proxy address gets blocked like any other, so the addresses have to rotate. Signing in is not a way around the block at the moment either: the README says cookie authentication is currently not available.
Fix 3: move the request to an HTTP API
With Pipefetch the transcript is one HTTPS request to our servers, so it does not matter where your code runs, and there are no proxies to buy or rotate.
import os
import requests
res = requests.get(
"https://pipefetch.com/v1/youtube/transcript",
params={"video": "https://www.youtube.com/watch?v=jNQXAC9IVRw"},
headers={"x-api-key": os.environ["PIPEFETCH_API_KEY"]},
timeout=90,
)
if res.status_code == 404:
print("No captions for this video") # not charged
else:
res.raise_for_status()
data = res.json()["data"]
print(data["text"]) # the whole transcript
for segment in data["segments"]: # timed pieces
print(segment["start"], segment["text"])A request costs 1 credit, a video without captions costs nothing, and a new account has 100 free credits. The answer also carries the video's title, channel, language and chapters. The reference lists every parameter.
Which fix fits
| Situation | Fix |
|---|---|
| A one-off batch you can run yourself | Run it on your own computer |
| It must run on a server and you already pay for residential proxies | The library's proxy settings |
| It must run on a server and you would rather not run proxies | An HTTP API such as Pipefetch |
The same block hits other tools
This is not specific to one library. yt-dlp and the JavaScript transcript packages read the same pages, and from a data-centre address they are refused in the same way. Switching library does not help; changing where the request comes from does.
Try it with 100 free credits. No card, no Google Cloud project, no OAuth. Get an API key or read the docs.
APIs used in this guide
More guides
- How to get a YouTube transcript in Python
- How to get a YouTube transcript in Node.js
- YouTube API quota exceeded: what the error means and how to fix it
- How to find a YouTube channel ID from a handle or URL
- How to download YouTube subtitles as SRT or VTT
- How to get YouTube comments in Python
- How to search YouTube from Python
- How to list a YouTube channel's videos in Python
- How to summarize a YouTube video with an LLM in Python