Robby

youtube-apify-transcript

データ分析v1.4.0
作者:Robby更新日 2026-08-31全 18 バージョン · 最新版の公開日 2026-08-31@clawhub_robbyczgw-cla/youtube-apify-transcript
データインサイトWeb スクレイピング#Apify#Batch#Transcript#YouTube#Caching

AlphaMoatによると、2026-09時点でyoutube-apify-transcriptのダウンロード数は4,711、スター数は5で、AIスキル全体5,078件中2,015位、データ分析では399件中161位です。

インストール数
263
ダウンロード数
4711
スター数
5
総合順位
#2,015
全体の上位 40% · データ分析の上位 41%
プラットフォームインストール数ダウンロード数スター数コメント
ClawHub ↗15147115-
SkillHub ↗26346605—

プラットフォームごとに集計方法と集計時点が異なります。

このスキルでできること

YouTube はクラウド IP(AWS、GCP 等)からの字幕リクエストをブロックする;Apify はレジデンシャルプロキシ経由でリクエストを転送し bot 検出を回避。デフォルト actor は topaz_sharingan/youtube-transcript-scraper-1(2026-08-31 に Apify API で検証:公開・非推奨扱いなし、30 日間で 36,362 成功/0 失敗);従量課金は $0.01/結果($10.00/1,000 結果);Apify 無料プランの月 $5 前払いクレジットで約 500 本の動画を処理可能($0.007/714 本とする古いドキュメントは誤り);キャッシュヒットの再リクエストは actor 実行を開始せず課金されない。入力は startUrls と timestamps の 2 フィールドのみ——言語フィールドはなく、--lang はデフォルト actor には届かない(pintostudio/starvibe/karamelo actor の場合のみ転送)。使い方:python3 scripts/fetch_transcript.py "URL"(デフォルトでテキスト・キャッシュ利用)、--json、--output、--batch urls.txt(2 回の API 呼び出しで約 $0.02 と表示)、--no-cache、--cache-stats、--clear-cache;キャッシュはスキルディレクトリの .cache/、YT_TRANSCRIPT_CACHE_DIR で上書き可能。エージェント指示:動画を要約するときはスクリプトで字幕を取得し、自分のモデル能力で直接要約する——--summarize は使用しない。APIFY_API_TOKEN(https://console.apify.com/account/integrations から取得)と python3 -m pip install requests が必要。

資料公開日 2026-10-29

できること

  • 直接アクセスがブロックされる環境(クラウドサーバー)から YouTube 字幕を取得
  • 複数動画の字幕を一括取得し Apify コストを管理
  • ローカルキャッシュで同じ動画の字幕を無料で再取得

使う場面

  • 開発者とエージェントが、直接アクセスがブロックされうる環境から YouTube 字幕を取得するために使用
  • 取得した字幕テキストや JSON は要約・分析・アーカイブ等の下流ワークフローに利用可能

プロンプト例

スキルのドキュメントをもとに生成した例であり、実際の実行結果ではありません。

この YouTube 動画の字幕を取って要点をまとめて
この urls.txt の全動画の字幕を一括取得して
--lang パラメータが効かないのはなぜ?

月次の推移

ダウンロード数4711
3216401948222026-03 · ダウンロード数 33272026-05 · ダウンロード数 38782026-06 · ダウンロード数 40522026-07 · ダウンロード数 43202026-08 · ダウンロード数 45012026-09 · ダウンロード数 471126-0326-09
スター数5
4562026-03 · スター数 52026-05 · スター数 52026-06 · スター数 52026-07 · スター数 52026-08 · スター数 52026-09 · スター数 526-0326-09

2026-09 から集計方法を変更し、同名スキルを作者ごとに分けて集計し、全スキルを対象にしました。破線は変更前の月で、変更後のデータとは直接比較せず、変更をまたぐ増減も計算していません。

月ダウンロード数前月比スター数
2026-094711—5
2026-084501+4.2%5
2026-074320+6.6%5
2026-064052+4.5%5
2026-053878—5
2026-033327—5

SKILL.md 原文

作者が公開した元のファイルをテキストのまま表示しています。AlphaMoat による編集や審査はしていません。リンクはクリックできません。コマンドは内容を確認してから実行してください。取得日 2026-10-23。

7.3 KB・ClawHub v1.4.0
---
name: youtube-apify-transcript
version: 1.4.0
description: Fetch YouTube transcripts via the Apify API. Works from cloud IPs (Hetzner, AWS, etc.) by bypassing YouTube's bot detection. Features local caching (free repeat requests) and batch mode. Requires APIFY_API_TOKEN and the Python requests library.
tags: [youtube, transcript, apify, video, subtitles, captions, cloud-ip, free-tier, web-scraping, caching, batch]
metadata:
  openclaw:
    requires:
      bins: ["python3"]
      env: ["APIFY_API_TOKEN"]
すべて表示(全 222 行)
    primaryEnv: APIFY_API_TOKEN
    envVars:
      - name: APIFY_API_TOKEN
        required: true
        description: "Apify API token from https://console.apify.com/account/integrations"
      - name: YT_TRANSCRIPT_CACHE_DIR
        required: false
        description: "Cache directory. Defaults to .cache/ in the skill directory."
    note: "Install the Python dependency once: python3 -m pip install requests"
---

# 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.

## Default actor

`topaz_sharingan/youtube-transcript-scraper-1` (YouTube Transcript Ninja). Store sheet: https://apify.com/topaz_sharingan/youtube-transcript-scraper-1

Checked against the Apify API on 2026-08-31:

- Public, not deprecated (`isDeprecated: false`, `notice: NONE`)
- Last code change: 2026-07-19
- 30-day public runs: 36,362 succeeded, 0 failed, 91 timed out, 18 aborted (36,471 total)

### Cost

Pay per event: $0.01 per result ($10.00 per 1,000 results). The actor page states platform compute is included in that event price. Older docs that said $0.007 per video were wrong.

Apify Free plan (https://apify.com/pricing, 2026-08-31): $5 prepaid usage per month, no credit card. Unused credits do not roll over.

Free-tier video count: $5 / $0.01 = **500 videos per month**, not 714. (714 was $5 / $0.007.) Repeat requests served from the local cache do not start an actor run.

Track spend at https://console.apify.com/billing

### Input

OpenAPI input schema on 2026-08-31 has two fields:

| Field | Type | Required | Default | Role |
| --- | --- | --- | --- | --- |
| `startUrls` | string[] | yes | (none) | YouTube video URLs |
| `timestamps` | boolean | no | `false` | `true`: transcript as `{timestamp, text}` array. `false`: joined text |

There is no language field. `--lang` on the CLI does not change the default actor's input. The script only forwards `--lang` for other actor IDs (`pintostudio`, `starvibe`, `karamelo`). For `topaz_sharingan~Youtube-Transcript-Scraper-1` it sends `startUrls` only.

```json
{
  "startUrls": ["https://www.youtube.com/watch?v=VIDEO_ID"],
  "timestamps": false
}
```

The schema types `startUrls` items as strings. The script currently sends `[{"url": "..."}]` Request-list objects.

### Output

Actor sheet examples:

- `timestamps: false` → `{"transcript": "plain text..."}`
- `timestamps: true` → `{"transcript": [{"timestamp": "0:01", "text": "..."}]}`

The skill script also looks for `text`, `captions`, `title` / `videoTitle`, and `channelName`. If a run returns only `transcript`, formatting depends on whether that value is a string or a list.

## Links

- [Apify Pricing](https://apify.com/pricing)
- [Get API token](https://console.apify.com/account/integrations)
- [YouTube Transcripts Actor](https://apify.com/topaz_sharingan/youtube-transcript-scraper-1)

## Setup

1. Create a free Apify account: https://apify.com/
2. Get your API token: https://console.apify.com/account/integrations
3. Set the environment variable and install `requests` yourself. OpenClaw has no `kind: pip` installer (allowed kinds: brew, node, go, uv, download), so this is a manual step.

```bash
# Add to ~/.bashrc or ~/.zshrc
export APIFY_API_TOKEN="apify_api_YOUR_TOKEN_HERE"

# Python dependency (once)
python3 -m pip install requests

# Or use .env file (never commit this!)
echo 'APIFY_API_TOKEN=apify_api_YOUR_TOKEN_HERE' >> .env
```

## Usage

### Basic Usage

```bash
# 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

```bash
# Output to file
python3 scripts/fetch_transcript.py "URL" --output transcript.txt

# JSON format (includes timestamps when the payload has them)
python3 scripts/fetch_transcript.py "URL" --json

# Both: JSON to file
python3 scripts/fetch_transcript.py "URL" --json --output transcript.json

# --lang is accepted by the CLI but is not sent to the default actor
# (no language field on topaz_sharingan/youtube-transcript-scraper-1).
python3 scripts/fetch_transcript.py "URL" --lang de
```

### Caching

Transcripts are cached locally by default. Repeat requests for the same video do not start an actor run.

```bash
# First request: fetches from Apify ($0.01)
python3 scripts/fetch_transcript.py "URL"

# Second request: uses cache
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:

```bash
# 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.020 for 2 API call(s)]

# Batch with JSON output to file
python3 scripts/fetch_transcript.py --batch urls.txt --json --output all_transcripts.json
```

The script's cost line prints $0.01 per result, so two fetched videos show about $0.02.

### Output Formats

**Text (default):**
```
Hello and welcome to this video.
Today we're going to talk about...
```

**JSON (--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..."
}
```

The actor's timestamped items use `timestamp` (string like `"0:01"`), not `start` / `duration`. The JSON example above is the skill script's shape when captions already have those keys.

## 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

Runtime requirements live in the YAML frontmatter (`metadata.openclaw`). OpenClaw 2.0 (v2026.8.1) installer kinds are brew, node, go, uv, and download. There is no `kind: pip`. Install `requests` with `python3 -m pip install requests`.

データ分析の人気スキル

Robbyのその他のスキル

データ月:2026-09 · ダウンロード数、スター数、インストール数は公開スキルレジストリ(ClawHub、SkillHub)から月単位で集計しています。詳しくはデータの方法論をご覧ください。