Home / Use cases / YouTube Transcript API Blocked on a Server

Updated

YouTube Transcript API Blocked on a Server (RequestBlocked Fix)

Open-source transcript libraries work from a home connection, then fail once deployed: YouTube refuses requests from cloud IP ranges and the library raises RequestBlocked, IpBlocked or TooManyRequests. Rotating proxies yourself is fragile and costs more than the transcripts.

Try it now on Apify YouTube Transcript for AI: RAG Chunks, Chapters, SRT · $0.002 per one video whose transcript was returned · failed items are free

How to do it, step by step

  1. Keep your code; replace only the fetch step by one HTTP call to the Actor (example below).
  2. Send the video URLs or IDs in videos; several at once are processed in parallel.
  3. Read status on each item: ok, no_captions, private, unavailable; failed items are not charged.
  4. Cache the results on your side if you call the same video often.
curl -X POST "https://api.apify.com/v2/acts/plainprobe~youtube-transcript-ai/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"videos": ["https://youtu.be/kCc8FmEb1nY"]}'

The exact input used for the example below:

{
  "videos": [
    "https://youtu.be/kCc8FmEb1nY"
  ],
  "includeChunks": false,
  "includeSegments": false
}

Real result

Run eO1MhXCOF4hiEg5H8 on 2026-12-05: status SUCCEEDED, 1 item(s), 3.7 s of run time. Output shortened for reading (long text cut with “…”).

Run from Apify's cloud, as a deployed app would be:

The two-hour video came back in 3.7 s, without any proxy setting on the caller's side.

[
  {
    "videoId": "kCc8FmEb1nY",
    "title": "Let's build GPT: from scratch, in code, spelled out.",
    "channelName": "Andrej Karpathy",
    "durationSeconds": 6980,
    "language": "en",
    "captionType": "auto",
    "wordCount": 20767,
    "text": "Hi everyone. So by now you have probably heard of ChatGPT. It has taken the world and the AI community by storm. And it is a system that allows you to interact with an AI and give it text-based tasks. So for example, we …"
  }
]

Try it now with your own input

FAQ

Why does youtube-transcript-api work locally but not on my server?

YouTube treats traffic from data-centre IP ranges (AWS, GCP, Azure, most VPS) much more strictly than home connections, so the same request is blocked once deployed.

Do I need my own proxies with the Actor?

No. The Actor handles the network side; you send video URLs and get JSON.

Is this a way around YouTube's rules?

It reads only public captions, without an account and without downloading videos. Check that your use of the text respects the rights of the creators.

Related