Extract full transcripts from any public YouTube video. Multi-language support with automatic language detection. Perfect for content analysis, AI training, and accessibility.
Pass any YouTube video URL — we support both youtube.com and youtu.be formats
We fetch available captions in your requested language (or default)
Receive the complete transcript as clean, formatted text
YouTube videos may have auto-generated captions (created by YouTube's AI) or manually uploaded subtitles. Our API returns whichever is available, with manual captions typically being more accurate.
If you don't specify a language, the API returns the video's default transcript — usually the language the creator uploaded or YouTube auto-detected.
Request a specific language using ISO 639-1 codes. Returns 404 if that language transcript isn't available.
t= parameter.Authorization: Bearer YOUR_LLMLAYER_API_KEYBuild datasets from educational videos, lectures, tutorials, and podcasts for fine-tuning language models.
Convert video content into blog posts, articles, social media threads, or newsletters automatically.
Index video transcripts for full-text search. Find specific moments across thousands of videos.
Analyze competitor videos, track mentions, extract insights, and perform sentiment analysis.
Generate summaries, key points, and study guides from educational videos and lectures.
Create accessible text versions of video content for deaf/hard-of-hearing users or text-preference readers.
Extract transcripts, translate to other languages, and create multilingual subtitles.
Automatically generate show notes, timestamps, and chapter markers from video podcasts.
Add video knowledge to your RAG pipeline. Let users ask questions about video content.
en = Englishes = Spanishfr = Frenchde = Germanpt = Portugueseit = Italianja = Japaneseko = Koreanzh = Chinesefrom llmlayer import LLMLayerClient
client = LLMLayerClient(api_key="your_api_key")
# Get transcript in default language
response = client.get_youtube_transcript(
url="https://www.youtube.com/watch?v=dQw4w9WgXcQ"
)
print(f"Language: {response.language}")
print(f"Transcript length: {len(response.transcript)} chars")
print(response.transcript[:500]) # First 500 chars# Request Spanish transcript
response = client.get_youtube_transcript(
url="https://www.youtube.com/watch?v=dQw4w9WgXcQ",
language="es"
)
print(f"Got transcript in: {response.language}")
print(response.transcript)import { LLMLayerClient } from 'llmlayer';
const client = new LLMLayerClient({
apiKey: process.env.LLMLAYER_API_KEY
});
async function getTranscript(videoUrl: string, lang?: string) {
try {
const response = await client.getYouTubeTranscript({
url: videoUrl,
language: lang
});
console.log(`Language: ${response.language}`);
console.log(`Cost: $${response.cost}`);
return response.transcript;
} catch (error) {
if (error.status === 404) {
console.log('Language not available for this video');
} else if (error.status === 500) {
console.log('Video has no captions or is unavailable');
}
throw error;
}
}
// Usage
const transcript = await getTranscript(
'https://youtu.be/dQw4w9WgXcQ',
'en'
);import re
def save_transcript(video_url: str, output_path: str):
response = client.get_youtube_transcript(url=video_url)
# Extract video ID for filename
video_id = re.search(r'(?:v=|/)([a-zA-Z0-9_-]{11})', video_url)
filename = video_id.group(1) if video_id else 'transcript'
with open(f"{output_path}/{filename}.txt", 'w') as f:
f.write(f"URL: {response.url}\n")
f.write(f"Language: {response.language}\n")
f.write(f"---\n\n")
f.write(response.transcript)
print(f"Saved: {output_path}/{filename}.txt")
# Usage
save_transcript(
"https://youtu.be/dQw4w9WgXcQ",
"./transcripts"
)video_urls = [
"https://youtu.be/video1",
"https://youtu.be/video2",
"https://youtu.be/video3",
]
transcripts = []
total_cost = 0
for url in video_urls:
try:
response = client.get_youtube_transcript(url=url)
transcripts.append({
"url": url,
"language": response.language,
"transcript": response.transcript
})
total_cost += response.cost
print(f"✅ {url}")
except Exception as e:
print(f"❌ {url}: {e}")
print(f"\nProcessed: {len(transcripts)}/{len(video_urls)}")
print(f"Total cost: ${total_cost:.3f}")curl -X POST https://api.llmlayer.dev/api/v1/youtube_transcript \
-H "Authorization: Bearer $LLMLAYER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"language": "en"
}'{
"transcript": "Never gonna give you up, never gonna let you down...",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"language": "en",
"cost": 0.003
}Get transcripts from any YouTube video in 9+ languages. $0.003 per video, no duration limits.