How to Get YouTube Transcripts in Python (youtube-transcript-api and a REST API)
Get a YouTube transcript in Python with the youtube-transcript-api library or a hosted REST API. Copy-paste code for both, and why the library gets blocked on cloud servers.
00:07:00 · SEP 26, 2026 · GÜNCELLENDI NOV 07, 2026
Hızlı yanıt
Açık kaynak kütüphaneyi kurun
youtube-transcript-api, YouTube'un kendi altyazı verisini doğrudan getiren, iyi bakımı yapılan bir Python paketidir - API anahtarı yok, YouTube Data API kotası yok.
pip install youtube-transcript-apiBir video ID ile transkript alın:
from youtube_transcript_api import YouTubeTranscriptApi
api = YouTubeTranscriptApi()
transcript = api.fetch("dQw4w9WgXcQ", languages=["en"])
for snippet in transcript:
print(snippet.text, snippet.start, snippet.duration)Deploy edince nerede bozuluyor
Bu, bir laptop üzerinde güvenilir şekilde çalışır. Bir bulut sunucusuna deploy edildiğinde, gerçek ve iyi belgelenmiş hatalarla karşılaşabilir - IP engelleme, PoTokenRequired ve göründüğü gibi olmayan bir 'transkript devre dışı' hatası. Tam nedenler ve çözümler için eksiksiz tanı kontrol listesine bakın.
Bir API anahtarı alın (kendiniz barındırmak istemiyorsanız)
panelden ücretsiz bir anahtar alın - 100 ücretsiz kredi, kart gerekmez.
pip install requestsBarındırılan API'yi Python'dan çağırma
Proxy havuzu yok, IP engelleme bakımı yok - sadece bir HTTP isteği:
import requests
response = requests.get(
"https://getyoutubetranscript.com/api/v1/transcript",
params={"v": "dQw4w9WgXcQ"},
headers={"Authorization": "Bearer sk_live_..."},
)
result = response.json()
print(result["data"]["transcript"])
print(result["data"]["word_count"])Başarısız bir istek, kütüphaneye özgü bir exception fırlatmak yerine bir hata nesnesi döndürür, böylece aynı hata yönetimi her endpoint'te çalışır.
{ "success": false, "code": "...", "message": "..." }Birden fazla video almak
Video ID listesi üzerinde döngü kurmak aynı şekilde çalışır - sadece planınızın dakikadaki istek limitine dikkat edin. Geri çekilme ve yeniden deneme mantığı için hız limiti rehberine bakın.
Her iki yaklaşım da aynı bilgiyi döndürür - fark, altyapıyı çalışır tutmayı kimin üstlendiğidir. Tam fiyatlandırmayı görün (100 ücretsiz kredi, kart gerekmez) ya da her endpoint için API belgelerini okuyun.
Python YouTube Transkript SSS
Hangi yaklaşımı kullanmalıyım?
Hızlı bir yerel script veya prototip için youtube-transcript-api. Production'a deploy ederken ve proxy/IP engelleme çözümlerini kendiniz sürdürmek istemediğinizde barındırılan bir API.
Barındırılan API, youtube-transcript-api kütüphanesini gerektirir mi?
Hayır - düz bir REST API. Herhangi bir HTTP istemcisiyle (requests, httpx, hatta curl) çağırabilirsiniz; Python'a özgü bir bağımlılık gerekmez.
Sadece tam metin değil, satır başına zaman damgası alabilir miyim?
Evet. Transkript isteğine timestamps=true ekle, yanıtta segments de gelir: her altyazı satırı için bir {start, duration, text}, süreler saniye cinsinden. Açık kaynak kütüphane de parça başına aynı türde zamanlama döndürür.
Bir videoda transkript yoksa ne olur?
Her iki yaklaşım da boş bir string yerine belirli bir hata döndürür - her hata kodunun ne anlama geldiğini tanı kontrol listesinde görebilirsiniz.
İlgili
- YouTube "Show Transcript" Button Missing? Where It Is Now and Why It Disappears
- How to Cite a YouTube Video in APA, MLA and Chicago (With Timestamps and Transcript Quotes)
- YouTube Captions by the Numbers: What 30,000 Transcripts Show (2026)
- Faceless YouTube Channel with AI: Research with Transcripts, Write Scripts YouTube Will Pay For
- How to Translate a YouTube Video: Transcript and Subtitles in Any Language
- Can ChatGPT Watch YouTube Videos? How to Connect YouTube to ChatGPT (2026)
- How to Get a YouTube Transcript for Claude (2026): Can Claude Watch YouTube Videos?
- We Benchmarked Three Ways to Get a YouTube Transcript: Home Connection vs Cloud Server
- youtube-transcript-api Errors Explained: IpBlocked, RequestBlocked and More
- 191 Starter Story Founder Interviews: How They Got Their First Customers
- How to Get a YouTube Video Transcript: Find, View, Copy and Download (2026)
- n8n YouTube Transcript Failing on Your Server? Why YouTube Blocks It and How to Fix It
- YouTube API Quota Exceeded: Causes and Fixes
- YouTube Transcript API Rate Limit: What It Is and How to Handle 429s
- YouTube Transcript MCP Server: Setup Guide for Claude and Other AI Tools
- YouTube Transcripts in n8n: HTTP Request Workflow Guide
- Migrating from Supadata: A Field Guide
- Migrate from TranscriptAPI.com: Parameter Mapping and curl Example
- Build an AI YouTube Video Summarizer with LangChain and Next.js
- How to Build a RAG Pipeline with YouTube Transcripts
- YouTube Transcript API: 6 Options Compared (2026), Free and Paid
- yt-dlp Subtitles: Download YouTube Subtitles and Transcripts (Tested Commands, 2026)
- YouTube Automatic Captions: Turn Them On or Off, Fix Missing Ones, Get the Text (2026)
- Can Gemini Watch YouTube Videos? What the App and the API Actually Do (2026)
- Can Copilot Watch YouTube Videos? Edge Sidebar vs the Copilot App (2026)
- Summarize.tech Not Working? It Has Been Down Since August 2026 (Alternatives)
- Can Grok Watch YouTube Videos? Give Grok YouTube Transcripts with MCP (2026)
- Can Perplexity Watch YouTube Videos? Add a YouTube Transcript Connector (2026)
- GetYouTubeTranscript ve TranscriptAPI karşılaştırması
- GetYouTubeTranscript ve youtubetotranscript.com karşılaştırması
- GetYouTubeTranscript ve youtube-transcript.io karşılaştırması
- GetYouTubeTranscript vs NoteGPT
- GetYouTubeTranscript vs Tactiq
- GetYouTubeTranscript vs Glasp
- GetYouTubeTranscript vs Eightify
- GetYouTubeTranscript ve Supadata
- GetYouTubeTranscript ve DownSub
- GetYouTubeTranscript ve youtubetranscript.dev







































































