youtube-transcript-api
This is a python API which allows you to get the transcripts/subtitles for a given YouTube video. It also works for automatically generated subtitles, supports translating subtitles and it does not require a headless browser, like other selenium based solutions do!
Install
youtube-transcript-api on PyPI
pip
pip install youtube-transcript-apiuv
uv add youtube-transcript-apipoetry
poetry add youtube-transcript-apiPackage facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<3.15,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — requests, defusedxml |
| Maintenance | actively maintained — 196 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: youtube_transcript_api-1.2.4-py3-none-any.whl
Keywords: cli, subtitle, subtitles, transcript, transcripts, youtube, youtube-api, youtube-subtitles, youtube-transcripts
About youtube-transcript-api
from the package's own PyPI description — quoted content, verbatim
<h1 align="center"> ✨ YouTube Transcript API ✨ </h1>
<p align="center"> <a href="https://github.com/sponsors/jdepoix"> <img src="https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86" alt="Sponsor"> </a> <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BAENLEW8VUJ6G&source=url"> <img src="https://img.shields.io/badge/Donate-PayPal-green.svg" alt="Donate"> </a> <a href="https://github.com/jdepoix/youtube-transcript-api/actions"> <img src="https://github.com/jdepoix/youtube-transcript-api/actions/workflows/ci.yml/badge.svg?branch=master" alt="Build Status"> </a> <a href="https://coveralls.io/github/jdepoix/youtube-transcript-api?branch=master"> <img src="https://coveralls.io/repos/github/jdepoix/youtube-transcript-api/badge.svg?branch=master" alt="Coverage Status"> </a> <a href="http://opensource.org/licenses/MIT"> <img src="http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat" alt="MIT license"> </a> <a href="https://pypi.org/project/youtube-transcript-api/"> <img src="https://img.shields.io/pypi/v/youtube-transcript-api.svg" alt="Current Version">...
Read as markdown · JSON record · Source repository · Homepage
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Retrieves transcripts and subtitles from YouTube videos, including auto-generated captions, with support for multiple languages and translation without requiring a browser.
Low friction install with just two runtime dependencies (requests and defusedxml). Active maintenance with recent releases and 8037 GitHub stars indicate solid community adoption and ongoing support.
MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Usage
pip install youtube-transcript-api
from youtube_transcript_api import YouTubeTranscriptApi
ytt_api = YouTubeTranscriptApi()
fetched_transcript = ytt_api.fetch('12345')
for snippet in fetched_transcript:
print(snippet.text)
Requires Python 3.8 or later (supports up to 3.14); pass video ID, not full URL.
Verdict: Well-maintained, actively developed library with no known vulnerabilities and permissive MIT licensing. Low install friction and strong community signals make it a reliable choice for YouTube transcript retrieval in Python projects.
Needs verification
- Whether YouTube's API changes or rate-limiting policies could affect transcript availability in future versions
- Specific behavior when transcripts are unavailable or restricted on particular videos
Similar packages
permissive · top 1,000 on PyPI
browser-usepermissive · top 1,000 on PyPI
Levenshteincopyleft · top 1,000 on PyPI
cramjampermissive · top 1,000 on PyPI
daffpermissive · top 1,000 on PyPI
holidayspermissive · top 1,000 on PyPI
rich-clickpermissive · top 1,000 on PyPI
chardetpermissive · top 1,000 on PyPI
opencv-pythonpermissive · top 1,000 on PyPI
opencv-python-headlesspermissive · top 1,000 on PyPI