Youtube Apify Transcript
Fetch YouTube transcripts via APIFY API. Works from cloud IPs (Hetzner, AWS, etc.) by bypassing YouTube's bot detection. Features local caching (FREE repeat...
Robby
@robbyczgw-cla
What This Skill Does
Fetches YouTube video transcripts via the Apify API, bypassing YouTube's bot detection that blocks cloud IPs. Supports local caching to avoid repeat API costs and batch processing of multiple videos.
Replaces manual transcript extraction or unreliable scraping by using Apify's residential proxies to reliably fetch transcripts from cloud-hosted environments.
When to Use It
- Extract transcripts from YouTube videos for content analysis or note-taking
- Batch download transcripts for multiple videos in a playlist or channel
- Cache transcripts locally to avoid repeated API charges for the same video
- Get timestamped JSON transcripts for use in video editing or subtitling
- Fetch transcripts in a specific language for multilingual content processing
Install
$ openclaw skills install @robbyczgw-cla/youtube-apify-transcriptyoutube-apify-transcript
Fetch YouTube transcripts via APIFY API (works from cloud IPs, bypasses YouTube bot detection).
Why APIFY?
YouTube blocks transcript requests from cloud IPs (AWS, GCP, etc.). APIFY runs the request through residential proxies, bypassing bot detection reliably.
Free Tier
- $5/month free credits (~714 videos)
- No credit card required
- Perfect for personal use
Cost
- $0.007 per video (less than 1 cent!)
- Track usage at: https://console.apify.com/billing
Links
- ๐ APIFY Pricing
- ๐ Get API Key
- ๐ฌ YouTube Transcripts Actor
Setup
- Create free APIFY account: https://apify.com/
- Get your API token: https://console.apify.com/account/integrations
- Set environment variable:
# Add to ~/.bashrc or ~/.zshrc
export APIFY_API_TOKEN="apify_api_YOUR_TOKEN_HERE"
# Install Python dependency
pip install requests
# Or use .env file (never commit this!)
echo 'APIFY_API_TOKEN=apify_api_YOUR_TOKEN_HERE' >> .env
Usage
Basic Usage
# Get transcript as text (uses cache by default)
python3 scripts/fetch_transcript.py "https://www.youtube.com/watch?v=VIDEO_ID"
# Short URL also works
python3 scripts/fetch_transcript.py "https://youtu.be/VIDEO_ID"
Options
# Output to file
python3 scripts/fetch_transcript.py "URL" --output transcript.txt
# JSON format (includes timestamps)
python3 scripts/fetch_transcript.py "URL" --json
# Both: JSON to file
python3 scripts/fetch_transcript.py "URL" --json --output transcript.json
# Specify language preference
python3 scripts/fetch_transcript.py "URL" --lang de
Caching (saves money!)
Transcripts are cached locally by default. Repeat requests for the same video cost $0.
# First request: fetches from APIFY ($0.007)
python3 scripts/fetch_transcript.py "URL"
# Second request: uses cache (FREE!)
python3 scripts/fetch_transcript.py "URL"
# Output: [cached] Transcript for: VIDEO_ID
# Bypass cache (force fresh fetch)
python3 scripts/fetch_transcript.py "URL" --no-cache
# View cache stats
python3 scripts/fetch_transcript.py --cache-stats
# Clear all cached transcripts
python3 scripts/fetch_transcript.py --clear-cache
Cache location: .cache/ in skill directory (override with YT_TRANSCRIPT_CACHE_DIR env var)
Batch Mode
Process multiple videos at once:
# Create a file with URLs (one per line)
cat > urls.txt << EOF
https://youtube.com/watch?v=VIDEO1
https://youtu.be/VIDEO2
https://youtube.com/watch?v=VIDEO3
EOF
# Process all URLs
python3 scripts/fetch_transcript.py --batch urls.txt
# Output:
# [1/3] Fetching VIDEO1...
# [2/3] [cached] VIDEO2
# [3/3] Fetching VIDEO3...
# Batch complete: 2 fetched, 1 cached, 0 failed
# [Cost: ~$0.014 for 2 API call(s)]
# Batch with JSON output to file
python3 scripts/fetch_transcript.py --batch urls.txt --json --output all_transcripts.json
Output Formats
Text (default):
Hello and welcome to this video.
Today we're going to talk about...
JSON (--json):
{
"video_id": "dQw4w9WgXcQ",
"title": "Video Title",
"transcript": [
{"start": 0.0, "duration": 2.5, "text": "Hello and welcome"},
{"start": 2.5, "duration": 3.0, "text": "to this video"}
],
"full_text": "Hello and welcome to this video..."
}
Agent Instructions
When the user asks to summarize a YouTube video, first fetch the transcript using the script, then summarize the transcript text directly using your own model capabilities. Do NOT use --summarize flag.
Error Handling
The script handles common errors:
- Invalid YouTube URL
- Video has no transcript
- API quota exceeded
- Network errors
Metadata
metadata:
clawdbot:
emoji: "๐น"
requires:
env: ["APIFY_API_TOKEN"]
bins: ["python3"]
python:
packages: ["requests"]
Top skills in this category
postfast
@peturgeorgievvSchedule and manage social media posts across TikTok, Instagram, Facebook, X (Twitter), YouTube, LinkedIn, Threads, Bluesky, Pinterest, Telegram, and Google Business Profile using the PostFast API. Use when the user wants to schedule social media posts, manage social media content, upload media for social posting, list connected social accounts, check scheduled posts, delete scheduled posts, cross-post content to multiple platforms, manage Google Business Profile posts, geotag posts with real-world places, pick trending pre-cleared TikTok sounds for photo and carousel posts, read or reply to the comments on their posts (social inbox โ TikTok, Instagram, Facebook, Threads), triage or moderate comment conversations, or automate their social media workflow. PostFast is a SaaS tool โ no self-hosting required.
ATXP
@emilioaccAccess ATXP paid API tools for web search, AI image generation, music creation, video generation, X/Twitter search, email, and agent account management. Use...
Openai Whisper Api
@steipeteTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
Edge TTS
@i3130002Text-to-speech conversion using node-edge-tts npm package for generating audio from text. Supports multiple voices, languages, speed adjustment, pitch control, and subtitle generation. Use when: (1) User requests audio/voice output with the "tts" trigger or keyword. (2) Content needs to be spoken rather than read (multitasking, accessibility, driving, cooking). (3) User wants a specific voice, speed, pitch, or format for TTS output.
Telegram
@codedao12OpenClaw skill for designing Telegram Bot API workflows and command-driven conversations using direct HTTPS requests (no SDKs).