# YouTube Video Transcript & Subtitles Scraper \[AI Ready] (`pagerka/youtube-transcript-scraper`) Actor

Lightning-fast YouTube video transcript and subtitles extractor. Get full timestamped transcripts, clean plain text, video titles, view counts, and metadata for AI summarization and RAG.

- **URL**: https://apify.com/pagerka/youtube-transcript-scraper.md
- **Developed by:** [Stepan Pagerka](https://apify.com/pagerka) (community)
- **Categories:** AI, Marketing, Developer examples
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🎬 YouTube Video Transcript & Subtitles Scraper \[AI Ready]

Lightning-fast YouTube video transcript and subtitles extractor. Extract full timestamped captions, clean plain text, video titles, view counts, and metadata for AI summarization, LLM ingestion, and RAG pipelines.

***

### ⚡ Key Features

- **⚡ Blazing Fast (HTTP-first)**: Extracts transcripts in under 1 second per video without heavy browser rendering.
- **🕒 Timestamps & Plain Text**: Delivers both structured timestamped arrays (`[00:15]`) and continuous plain text blocks ready for ChatGPT, Gemini, or Claude.
- **🌐 Multi-Language Support**: Extracts original manual captions or auto-generated transcripts with language fallback.
- **📊 Clean JSON/CSV/Text Export**: Export directly to JSON, CSV, Excel, or connect to Make, Zapier, LangChain, or LlamaIndex via API.

***

### 📥 Input Parameters

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `videoUrls` | Array | `["https://www.youtube.com/watch?v=dQw4w9WgXcQ"]` | List of YouTube video URLs or video IDs. |
| `preferredLanguage` | String | `"en"` | Language code for subtitles (e.g. `en`, `es`, `fr`, `de`, `ru`). |
| `includeTimestamps` | Boolean | `true` | Include segment timestamp breakdown in the dataset. |
| `proxyConfiguration` | Object | `{ "useApifyProxy": false }` | Optional proxy settings. |

***

### 📤 Sample Output (JSON)

```json
{
  "videoId": "dQw4w9WgXcQ",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Music Video)",
  "author": "Rick Astley",
  "viewCount": 1500000000,
  "lengthSeconds": 213,
  "captionLanguage": "en",
  "isAutoGenerated": false,
  "hasCaptions": true,
  "fullTranscriptText": "We're no strangers to love. You know the rules and so do I...",
  "segments": [
    { "start": 18.5, "startFormatted": "00:18", "duration": 4.2, "text": "We're no strangers to love" },
    { "start": 22.8, "startFormatted": "00:22", "duration": 3.9, "text": "You know the rules and so do I" }
  ],
  "scrapedAt": "2026-08-17T12:00:00.000Z"
}
```

***

### 🚀 Use Cases

- **AI Video Summarization**: Summarize lengthy podcasts, webinars, and educational videos automatically.
- **RAG & Knowledge Bases**: Ingest YouTube video transcripts into vector databases (Pinecone, Qdrant, Chroma).
- **SEO & Content Repurposing**: Turn YouTube videos into blog posts, newsletters, and social media threads.

# Actor input Schema

## `videoUrls` (type: `array`):

List of YouTube video URLs or 11-character video IDs (e.g. https://www.youtube.com/watch?v=dQw4w9WgXcQ or dQw4w9WgXcQ).

## `preferredLanguage` (type: `string`):

Language code for captions (e.g. 'en', 'es', 'de', 'fr', 'ru'). Defaults to 'en' with automatic fallback to any available language.

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

Include array of timestamped text segments (offset seconds and duration) in the output.

## `proxyConfiguration` (type: `object`):

Proxy settings (optional).

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "preferredLanguage": "en",
  "includeTimestamps": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Access extracted video transcripts, timestamps, plain text, and metadata in JSON, CSV, or text format.

# 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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("pagerka/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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("pagerka/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 '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call pagerka/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,pagerka/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/vxXo3tEEccGG8BxeI/builds/EoWpqXnJIUlhATePC/openapi.json
