Skip to main content

ClearCaption: YouTube transcripts that work from the cloud

youtube-transcript-api works on your laptop, then fails on AWS, GCP, Colab, Vercel or Render with RequestBlocked, IpBlocked, TranscriptsDisabled (when captions clearly exist) or 429 Too Many Requests. YouTube blocks cloud IP ranges, and translated captions (transcript.translate('de')) return 429 from almost any IP.

ClearCaption is a drop-in fallback: the same output ([{"text", "start", "duration"}]), but the request runs on Apify's rotating proxies, so it works from any server. It can also translate: it fetches the original track and translates it.

Free: ~1,000 videos/month with a free Apify account ($5 monthly credit, no credit card).

pip install clearcaption
export APIFY_TOKEN=your_token   # free account: https://console.apify.com/sign-up
from clearcaption import fetch, fetch_many

fetch("dQw4w9WgXcQ")                        # [{'text': ..., 'start': 18.64, 'duration': 3.24}, ...]
fetch("dQw4w9WgXcQ", translate_to="de")     # translated
fetch_many(["https://youtu.be/dQw4w9WgXcQ", "https://www.youtube.com/@channel"])  # videos, channels, playlists

Keep youtube-transcript-api and fall back only when blocked

from youtube_transcript_api import YouTubeTranscriptApi
from youtube_transcript_api._errors import RequestBlocked, IpBlocked
from clearcaption import fetch

def transcript(video_id):
    try:
        return YouTubeTranscriptApi().fetch(video_id).to_raw_data()
    except (RequestBlocked, IpBlocked):
        return fetch(video_id)

Other ways to call it

  • REST / any language: POST https://api.apify.com/v2/acts/clearcaption~youtube-transcript-translate/run-sync-get-dataset-items?token=... with {"videos": ["dQw4w9WgXcQ"]}.
  • AI agents (Claude, Cursor, n8n) via MCP: add https://mcp.apify.com?tools=clearcaption/youtube-transcript-translate as an MCP server (header Authorization: Bearer <APIFY_TOKEN>, or sign in to Apify on first connection).
  • No code: Apify Store page: paste URLs, download JSON / CSV / SRT / VTT.

Price

$0.005 per video with captions. Videos without captions cost $0. Translation costs $0.005 per started 10 minutes of video, and is free when YouTube already has a track in that language. Pay per use on Apify, no subscription. The free Apify plan includes monthly credit.

Compared with

youtube-transcript-api + residential proxy Hosted subscription APIs ClearCaption
Works from cloud yes, if you run proxy rotation yes yes
Translated captions 429 on tlang varies yes
Channels / playlists / search no some yes
Billing proxy plan monthly plan per video, $0 without captions

MIT license. Issues and PRs welcome.

Command line

clearcaption dQw4w9WgXcQ                 # plain text
clearcaption dQw4w9WgXcQ --to de --srt   # German SRT, timestamps kept
clearcaption https://www.youtube.com/@freecodecamp --json

Other ways to use it

  • JavaScript / TypeScript: npm i clearcaption (clearcaption-js)
  • n8n: community node n8n-nodes-clearcaption (repo)

Metadata

Release files for clearcaption 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clearcaption 0.2.0
File Size Uploaded Provenance Actions
clearcaption-0.2.0.tar.gz 5.2 kB With provenance Details for clearcaption-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for clearcaption 0.2.0
File Interpreter ABI Platform Actions
clearcaption-0.2.0-py3-none-any.whl Python 3 none any Details for clearcaption-0.2.0-py3-none-any.whl

Total release size: 11.0 kB

Release files / clearcaption-0.2.0.tar.gz

Download URL clearcaption-0.2.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6213cf8663e2cc9912a56285dd4a5dac2cfe3e68a3b5b60685cf334ad63caf02
BLAKE2b-256 checksum
How to use checksums
d8bb51e06b988a64940114d1aa8b16c0757769229724ef07f25b4a54f1710c08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / clearcaption-0.2.0-py3-none-any.whl

Download URL clearcaption-0.2.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
705b502c89a0ed1d77de5ac79a97beb8a91b44eebc493fe0441b8e12a36ac86f
BLAKE2b-256 checksum
How to use checksums
25b3953fbb450a5bad8c6231687a45d904b216806c9216ca4bfc88909f99876a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for clearcaption 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for clearcaption-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page