🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Youtube Transcript Api

by @volodstaimi

Extract, transcribe, and translate YouTube video transcripts using the YouTubeTranscript.dev V2 API. Supports captions, ASR audio transcription, batch proces...

Versionv0.1.0
⚑ When to Use
TriggerAction
- User wants to transcribe a YouTube video that has no captions (ASR)
- User wants to translate a YouTube video transcript to another language
- User needs to process multiple YouTube videos at once
- User wants to build an AI/LLM pipeline that uses YouTube video content
- User wants to repurpose video content into text (blog posts, summaries, etc.)
πŸ’‘ Examples

Basic Transcript Extraction (Python)

import requests

API_KEY = "your_api_key"

response = requests.post( "https://youtubetranscript.dev/api/v2/transcribe", headers={ "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json", }, json={"video": "dQw4w9WgXcQ"} )

data = response.json() for segment in data["data"]["transcript"]: print(f"[{segment['start']:.1f}s] {segment['text']}")

Basic Transcript Extraction (JavaScript/Node.js)

const response = await fetch("https://youtubetranscript.dev/api/v2/transcribe", {
  method: "POST",
  headers: {
    Authorization: Bearer ${API_KEY},
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ video: "dQw4w9WgXcQ" }),
});

const { data } = await response.json(); console.log(data.transcript);

Using the Node.js SDK

npm install youtube-audio-transcript-api

import { YouTubeTranscript } from "youtube-audio-transcript-api";

const yt = new YouTubeTranscript({ apiKey: "your_api_key" });

// Simple extraction const result = await yt.getTranscript("dQw4w9WgXcQ");

// With translation const translated = await yt.transcribe({ video: "dQw4w9WgXcQ", language: "es", });

// Batch (up to 100 videos) const batch = await yt.batch({ video_ids: ["dQw4w9WgXcQ", "jNQXAC9IVRw", "9bZkp7q19f0"], });

Basic Transcript Extraction (cURL)

curl -X POST https://youtubetranscript.dev/api/v2/transcribe \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"video": "dQw4w9WgXcQ"}'

Batch Processing (up to 100 videos)

curl -X POST https://youtubetranscript.dev/api/v2/batch \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"video_ids": ["dQw4w9WgXcQ", "jNQXAC9IVRw", "9bZkp7q19f0"]}'

Translation

Add "language": "es" (or any ISO 639-1 code) to get the transcript translated:

curl -X POST https://youtubetranscript.dev/api/v2/transcribe \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"video": "dQw4w9WgXcQ", "language": "es"}'

ASR Transcription (videos without captions)

For videos that don't have captions, use ASR with a webhook:

curl -X POST https://youtubetranscript.dev/api/v2/transcribe \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"video": "VIDEO_ID", "source": "asr", "webhook_url": "https://yoursite.com/webhook"}'

This returns immediately with status: "processing". Results are delivered to the webhook URL when ready. Poll with GET /api/v2/jobs/{job_id} if not using webhooks.

View on ClawHub
TERMINAL
clawhub install youtube-transcript-api

πŸ§ͺ Use this skill with your agent

Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

πŸ” Can't find the right skill?

Search 60,000+ AI agent skills β€” free, no login needed.

Search Skills β†’