How to use it
- Hit Copy SKILL.md — or use the Claude Code line below to get every file.
- Claude: ⋯ → Download .md, then Customize → Skills → Add → Upload skill.
ChatGPT: make a Project and paste it into Instructions.
Neither? Paste it at the top of a new chat — it works for that chat. - Describe your job in plain words. The AI follows the skill from there.
npx degit gooseworks-ai/goose-skills/skills/research-tools/capabilities/youtube-apify-transcript#main ~/.claude/skills/youtube-apify-transcriptFor one project only, change the path to .claude/skills/youtube-apify-transcript. This skill also uses transcript.txt, transcript.json, urls.txt, all_transcripts.json — copying SKILL.md alone won't be enough. See the folder on GitHub.
Not working?
- Check which app you pasted it into — the steps above name the right one.
- Some skills need the paid tier of Claude or ChatGPT.
Paste into Claude, ChatGPT or Cursor.
Show the full text165 lines
youtube-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
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"
# 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
# Batch with JSON output to file
python3 scripts/fetch_transcript.py --batch urls.txt --json --output all_transcripts.json
APIFY Actor Input
The script sends the following input to pintostudio/youtube-transcript-scraper:
{
"videoUrl": "https://www.youtube.com/watch?v=VIDEO_ID"
}
Output fields:
Each result contains a data array of transcript segments:
| Field | Type | Description |
|---|---|---|
start |
number | Segment start time (seconds) |
dur |
number | Segment duration (seconds) |
text |
string | Transcript text for this segment |
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, "dur": 2.5, "text": "Hello and welcome"},
{"start": 2.5, "dur": 3.0, "text": "to this video"}
],
"full_text": "Hello and welcome to this video..."
}
Error Handling
The script handles common errors:
- Invalid YouTube URL
- Video has no transcript
- API quota exceeded
- Network errors
| 1 | |
| 2 | name youtube-apify-transcript |
| 3 | description Fetch YouTube transcripts via APIFY API. Works from cloud IPs (Hetzner, AWS, etc.) by bypassing YouTube's bot detection. Free tier includes $5/month credits (~714 videos). No credit card required. |
| 4 | tags [research] |
| 5 | |
| 6 | |
| 7 | # youtube-apify-transcript |
| 8 | |
| 9 | Fetch YouTube transcripts via APIFY API (works from cloud IPs, bypasses YouTube bot detection). |
| 10 | |
| 11 | ## Why APIFY? |
| 12 | |
| 13 | YouTube blocks transcript requests from cloud IPs (AWS, GCP, etc.). APIFY runs the request through residential proxies, bypassing bot detection reliably. |
| 14 | |
| 15 | ## Free Tier |
| 16 | |
| 17 | **$5/month free credits** (~714 videos) |
| 18 | No credit card required |
| 19 | Perfect for personal use |
| 20 | |
| 21 | ## Cost |
| 22 | |
| 23 | **$0.007 per video** (less than 1 cent!) |
| 24 | Track usage at: https://console.apify.com/billing |
| 25 | |
| 26 | ## Links |
| 27 | |
| 28 | [APIFY Pricing] |
| 29 | [Get API Key] |
| 30 | [YouTube Transcript Scraper Actor] |
| 31 | |
| 32 | ## Setup |
| 33 | |
| 34 | Create free APIFY account: https://apify.com/ |
| 35 | Get your API token: https://console.apify.com/account/integrations |
| 36 | Set environment variable: |
| 37 | |
| 38 | |
| 39 | # Add to ~/.bashrc or ~/.zshrc |
| 40 | export APIFY_API_TOKEN="apify_api_YOUR_TOKEN_HERE" |
| 41 | |
| 42 | # Or use .env file (never commit this!) |
| 43 | echo 'APIFY_API_TOKEN=apify_api_YOUR_TOKEN_HERE' >> .env |
| 44 | |
| 45 | |
| 46 | ## Usage |
| 47 | |
| 48 | ### Basic Usage |
| 49 | |
| 50 | |
| 51 | # Get transcript as text (uses cache by default) |
| 52 | python3 scripts/fetch_transcript.py "https://www.youtube.com/watch?v=VIDEO_ID" |
| 53 | |
| 54 | # Short URL also works |
| 55 | python3 scripts/fetch_transcript.py "https://youtu.be/VIDEO_ID" |
| 56 | |
| 57 | |
| 58 | ### Options |
| 59 | |
| 60 | |
| 61 | # Output to file |
| 62 | python3 scripts/fetch_transcript.py "URL" --output transcript.txt |
| 63 | |
| 64 | # JSON format (includes timestamps) |
| 65 | python3 scripts/fetch_transcript.py "URL" --json |
| 66 | |
| 67 | # Both: JSON to file |
| 68 | python3 scripts/fetch_transcript.py "URL" --json --output transcript.json |
| 69 | |
| 70 | # Specify language preference |
| 71 | python3 scripts/fetch_transcript.py "URL" --lang de |
| 72 | |
| 73 | |
| 74 | ### Caching (saves money!) |
| 75 | |
| 76 | Transcripts are cached locally by default. Repeat requests for the same video cost $0. |
| 77 | |
| 78 | |
| 79 | # First request: fetches from APIFY ($0.007) |
| 80 | python3 scripts/fetch_transcript.py "URL" |
| 81 | |
| 82 | # Second request: uses cache (FREE!) |
| 83 | python3 scripts/fetch_transcript.py "URL" |
| 84 | # Output: [cached] Transcript for: VIDEO_ID |
| 85 | |
| 86 | # Bypass cache (force fresh fetch) |
| 87 | python3 scripts/fetch_transcript.py "URL" --no-cache |
| 88 | |
| 89 | # View cache stats |
| 90 | python3 scripts/fetch_transcript.py --cache-stats |
| 91 | |
| 92 | # Clear all cached transcripts |
| 93 | python3 scripts/fetch_transcript.py --clear-cache |
| 94 | |
| 95 | |
| 96 | Cache location: `.cache/` in skill directory (override with `YT_TRANSCRIPT_CACHE_DIR` env var) |
| 97 | |
| 98 | ### Batch Mode |
| 99 | |
| 100 | Process multiple videos at once: |
| 101 | |
| 102 | |
| 103 | # Create a file with URLs (one per line) |
| 104 | cat > urls.txt << EOF |
| 105 | https://youtube.com/watch?v=VIDEO1 |
| 106 | https://youtu.be/VIDEO2 |
| 107 | https://youtube.com/watch?v=VIDEO3 |
| 108 | EOF |
| 109 | |
| 110 | # Process all URLs |
| 111 | python3 scripts/fetch_transcript.py --batch urls.txt |
| 112 | |
| 113 | # Batch with JSON output to file |
| 114 | python3 scripts/fetch_transcript.py --batch urls.txt --json --output all_transcripts.json |
| 115 | |
| 116 | |
| 117 | ## APIFY Actor Input |
| 118 | |
| 119 | The script sends the following input to `pintostudio/youtube-transcript-scraper`: |
| 120 | |
| 121 | |
| 122 | { |
| 123 | "videoUrl": "https://www.youtube.com/watch?v=VIDEO_ID" |
| 124 | } |
| 125 | |
| 126 | |
| 127 | **Output fields:** |
| 128 | |
| 129 | Each result contains a `data` array of transcript segments: |
| 130 | |
| 131 | | Field | Type | Description | |
| 132 | |---------|--------|------------------------------------| |
| 133 | | `start` | number | Segment start time (seconds) | |
| 134 | | `dur` | number | Segment duration (seconds) | |
| 135 | | `text` | string | Transcript text for this segment | |
| 136 | |
| 137 | ### Output Formats |
| 138 | |
| 139 | **Text (default):** |
| 140 | |
| 141 | Hello and welcome to this video. |
| 142 | Today we're going to talk about... |
| 143 | |
| 144 | |
| 145 | **JSON (--json):** |
| 146 | |
| 147 | { |
| 148 | "video_id": "dQw4w9WgXcQ", |
| 149 | "title": "Video Title", |
| 150 | "transcript": [ |
| 151 | {"start": 0.0, "dur": 2.5, "text": "Hello and welcome"}, |
| 152 | {"start": 2.5, "dur": 3.0, "text": "to this video"} |
| 153 | ], |
| 154 | "full_text": "Hello and welcome to this video..." |
| 155 | } |
| 156 | |
| 157 | |
| 158 | ## Error Handling |
| 159 | |
| 160 | The script handles common errors: |
| 161 | Invalid YouTube URL |
| 162 | Video has no transcript |
| 163 | API quota exceeded |
| 164 | Network errors |
| 165 |