# YouTube Transcript & Metadata Scraper (RAG) (`lepone31/youtube-transcript-pro`) Actor

Ultra-fast YouTube Transcript & Metadata Extractor via internal Innertube API. Extract timestamped transcripts, plain text, LLM-ready Markdown, chapters, views, and channel data from URLs, Video IDs, or Search Queries. 80% cheaper ($1.25/1k).

- **URL**: https://apify.com/lepone31/youtube-transcript-pro.md
- **Developed by:** [Cedric poma](https://apify.com/lepone31) (community)
- **Categories:** AI, Videos, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 transcript extracteds

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, Chapters & Metadata Scraper (AI / RAG Ready)

Extract **YouTube video transcripts, timestamps, chapters, and full video metadata** in milliseconds using YouTube's lightweight internal Innertube API — **no headless browser required**.

Built specifically for **AI Agents, RAG pipelines, n8n, Make, Zapier, and bulk research workflows**.

***

### Why Use This YouTube Transcript Scraper?

| Feature | Legacy Browser Scrapers (`$5 - $10 / 1k`) | **YouTube Transcript Pro (`$1.25 / 1k`)** |
| :--- | :--- | :--- |
| **Price per 1,000 Videos** | `$5.00` – `$10.00` | **`$1.25 / 1,000 results`** |
| **Execution Speed** | 8 – 25 seconds per video | **`< 0.4 seconds` per video** |
| **Memory Footprint** | 2,048 MB – 4,096 MB (Chromium) | **`128 MB RAM` (Pure HTTP)** |
| **Input Flexibility** | Video URLs only | **Video URLs, Shorts, Video IDs + Keyword Search** |
| **AI / LLM Output** | Raw text only | **Clean Text + Timestamped JSON + RAG Markdown + Chapters** |

***

### Key Features

- **Direct URLs, Shorts & Video IDs**: Pass any standard `youtube.com/watch?v=...`, `youtu.be/...`, `youtube.com/shorts/...`, or raw 11-character Video ID.
- **Built-in Keyword Search**: Pass `searchQueries` (e.g., `["AI agents tutorial", "n8n automation"]`) to automatically discover top videos and extract their full transcripts in a single run.
- **Multi-Language Support**: Specify your `preferredLanguage` (`en`, `fr`, `es`, `de`, `pt`, `ja`, etc.) with automatic fallback to manual or auto-generated (`asr`) captions.
- **Description Chapter Parsing**: Automatically extracts chapters (`00:00 Intro`, `02:15 Architecture`, etc.) from the video description.
- **LLM / RAG Markdown Output**: Generates a structured `ragMarkdown` field ready to feed directly into OpenAI, Claude, Gemini, Pinecone, Qdrant, or n8n AI nodes.

***

### Input Example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "searchQueries": [
    "mcp server tutorial"
  ],
  "maxSearchResultsPerQuery": 3,
  "preferredLanguage": "en",
  "includeTimestamps": true,
  "includeMarkdown": true
}
```

***

### Output Example

```json
{
  "videoId": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channelName": "Rick Astley",
  "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "publishDate": "2009-10-25T06:57:33-07:00",
  "durationSeconds": 213,
  "durationFormatted": "03:33",
  "viewCount": 1600000000,
  "hasTranscript": true,
  "language": "en",
  "isAutoGenerated": false,
  "wordCount": 412,
  "fullText": "♪ We're no strangers to love ♪ ♪ You know the rules and so do I ♪ ...",
  "chapters": [],
  "segments": [
    {
      "start": 18.64,
      "duration": 3.24,
      "timestamp": "00:18",
      "text": "♪ We're no strangers to love ♪"
    }
  ],
  "ragMarkdown": "# Rick Astley - Never Gonna Give You Up...\n## Transcript\n[00:18] ♪ We're no strangers to love ♪..."
}
```

# Actor input Schema

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

List of YouTube video URLs (watch, shorts, youtu.be) or 11-character Video IDs to extract transcripts and metadata from.

## `searchQueries` (type: `array`):

Search YouTube directly by keywords and extract transcripts + metadata for the top matching videos.

## `maxSearchResultsPerQuery` (type: `integer`):

Maximum number of videos to process for each search query.

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

ISO 639-1 language code (e.g., 'en', 'fr', 'es', 'de'). Falls back automatically to available tracks if preferred language is not present.

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

Include the detailed array of timestamped segments (\[{start, duration, text}]) in the output.

## `includeMarkdown` (type: `boolean`):

Generate a clean Markdown document combining metadata, description chapters, and timestamped transcript for AI agents (n8n, Make, LangChain).

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

Optional Apify Proxy configuration for high-volume runs.

## Actor input object example

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

# Actor output Schema

## `overview` (type: `string`):

No description

# 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"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lepone31/youtube-transcript-pro").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"] }

# Run the Actor and wait for it to finish
run = client.actor("lepone31/youtube-transcript-pro").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"
  ]
}' |
apify call lepone31/youtube-transcript-pro --silent --output-dataset

```

## MCP server setup

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

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/5RoPgROvZk3I4Y7Vd/builds/gKFTKQJhtpNKDjYGv/openapi.json
