# YouTube Transcript Scraper (`agentflow/youtube-transcript-scraper`) Actor

Extract transcripts and metadata from YouTube videos. Fast, lightweight, no browser needed.

- **URL**: https://apify.com/agentflow/youtube-transcript-scraper.md
- **Developed by:** [Yunbin Huang](https://apify.com/agentflow) (community)
- **Categories:** Videos
- **Features:** Limited permissions
- **Stats:** 16 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.80 / 1,000 video processeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube Transcript Scraper

Extract transcripts, subtitles, and metadata from YouTube videos. No browser needed — pure HTTP, fast and affordable.

### What does YouTube Transcript Scraper do?

YouTube Transcript Scraper extracts publicly available transcripts and metadata from YouTube videos, at a fraction of the cost of alternatives.

- Extract **full transcripts** with or without timestamps from any YouTube video
- Get **video metadata**: title, description, views, duration, channel, keywords
- Support **100+ languages** — both manual captions and auto-generated subtitles
- Process **multiple videos** in a single run via batch URL input
- Get **full plain text output** ready for AI, LLM, and RAG pipelines
- **No browser, no Playwright, no Puppeteer** — pure HTTP, minimal compute cost

### How to use YouTube transcript data

You can use this scraper to:

- **Feed AI and LLMs**: Use transcripts as context for ChatGPT, Claude, or your own models
- **Content research**: Analyze what competitors or influencers are saying at scale
- **SEO research**: Extract keywords, topics, and talking points from top-ranking videos
- **Build knowledge bases**: Create searchable text databases from video content
- **Summarization pipelines**: Auto-summarize YouTube videos without watching them
- **Accessibility**: Generate text versions of video content for hearing-impaired users
- **Training data**: Collect large-scale multilingual text for model training

### What data can you extract?

| Field | Description |
|-------|-------------|
| 📝 Full transcript | Complete text of all spoken content |
| ⏱ Timestamped segments | Text broken into segments with start time and duration |
| 🎬 Video title | Title of the video |
| 📄 Description | Full video description |
| 👁 View count | Total number of views |
| ⏳ Duration | Video length in seconds |
| 📺 Channel name | Name of the YouTube channel |
| 🔑 Keywords | Tags associated with the video |
| 🌐 Available languages | All available transcript languages |
| 🖼 Thumbnail | URL of the video thumbnail |

### How to scrape YouTube transcripts

Get started in minutes:

1. Create a free Apify account
2. Open [YouTube Transcript Scraper](https://apify.com/agentflow/youtube-transcript-scraper)
3. Paste one or more YouTube video URLs
4. Click **Start** and wait for the results
5. Download your data in JSON, CSV, Excel, or HTML

### ⬇️ Input example

```json
{
    "urls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://youtu.be/9bZkp7q19f0"
    ],
    "language": "en",
    "includeAutoGenerated": true,
    "includeTimestamps": true,
    "outputFullText": true
}
```

**Supported URL formats:**

- `https://www.youtube.com/watch?v=VIDEO_ID`
- `https://youtu.be/VIDEO_ID`
- `https://www.youtube.com/shorts/VIDEO_ID`
- Direct video ID: `VIDEO_ID`

### ⬆️ Output example

```json
{
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "videoId": "dQw4w9WgXcQ",
    "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
    "channelName": "Rick Astley",
    "viewCount": 1752068825,
    "lengthSeconds": 213,
    "selectedLanguage": "en",
    "isAutoGenerated": true,
    "segments": [
        {
            "text": "We're no strangers to love",
            "start": 18.0,
            "startFormatted": "0:18",
            "duration": 3.28
        }
    ],
    "fullText": "We're no strangers to love You know the rules and so do I..."
}
```

### ❓ FAQ

#### Does it work with auto-generated subtitles?

Yes. YouTube automatically generates subtitles for most videos. This scraper supports both manually uploaded captions and auto-generated ones. You can control this via the `includeAutoGenerated` parameter.

#### What languages are supported?

Any language that YouTube provides captions for. Set your preferred language using the `language` parameter (e.g. `en`, `zh-Hans`, `ja`, `ko`, `es`, `fr`). If the preferred language is unavailable, the scraper falls back to the next best match.

#### What if a video has no transcript?

The result will include all available metadata but `segments` and `fullText` will be null, and an `error` field will indicate "No transcript available".

#### How much does it cost?

This scraper uses pure HTTP — no browser, no Playwright. It consumes minimal compute units. At **$5.00 per 1,000 videos**, it is among the most affordable YouTube transcript tools on Apify.

#### Is it faster than alternatives?

Yes. Because we don't launch a browser, typical runs complete in 2–5 seconds for a single video, compared to 15–30 seconds for browser-based scrapers.

# Actor input Schema

## `urls` (type: `array`):

List of YouTube video URLs to extract transcripts from. Supports standard URLs (youtube.com/watch?v=), short URLs (youtu.be/), and Shorts URLs.

## `language` (type: `string`):

Preferred transcript language code (e.g., 'en', 'zh-Hans', 'ja', 'ko'). If not available, falls back to the default language.

## `includeAutoGenerated` (type: `boolean`):

Whether to include YouTube's auto-generated transcripts when manual transcripts are not available.

## `includeTimestamps` (type: `boolean`):

Whether to include start time and duration for each transcript segment.

## `outputFullText` (type: `boolean`):

Whether to include a merged full text version of the transcript (without timestamps).

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "language": "en",
  "includeAutoGenerated": true,
  "includeTimestamps": true,
  "outputFullText": true
}
```

# Actor output Schema

## `results` (type: `string`):

One item per input video: transcript segments with timestamps, fullText, selected language, video metadata (title, channel, views, duration, keywords), or an error field when no transcript is available.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("agentflow/youtube-transcript-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"] }

# Run the Actor and wait for it to finish
run = client.actor("agentflow/youtube-transcript-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ]
}' |
apify call agentflow/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,agentflow/youtube-transcript-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/PfD50rBjlJo32KDZ7/builds/1KnLKrbV0a37a3pC9/openapi.json
