# youtube-transcript-scraper (`vexmeavf/youtube-transcript-scraper`) Actor

Extrae transcripciones de YouTube con análisis de sentimiento, extracción de entidades, métricas SEO y modo compacto optimizado para pipelines RAG/LLM. Soporte multi-idioma con detección automática.

- **URL**: https://apify.com/vexmeavf/youtube-transcript-scraper.md
- **Developed by:** [Marlon Vasquez](https://apify.com/vexmeavf) (community)
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

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 — Captions & Subtitles

**YouTube transcript scraper** to extract captions and subtitles from any YouTube video or channel, with timestamps in 6 formats, plus metadata, sentiment, entities and SEO metrics. Multi-language and RAG-ready.

### How to extract a YouTube transcript

Paste one or more YouTube URLs (or 11-character video IDs) and the Actor returns one item per video with the full **transcript** and **captions**. Ideal for content analysis, research, accessibility and AI/RAG pipelines.

### YouTube captions and subtitles to text

| Format | Type | Best for |
|--------|------|----------|
| `captions` | string\[] | Simple text processing |
| `textWithTimestamps` | object\[] | Segment analysis, seeking |
| `xmlWithoutTimestamps` | string | XML workflows |
| `xmlWithTimestamps` | string | Preserving timing data |
| `singleStringText` | string | Summarization, indexing |
| `compact` | string | RAG/LLM pipelines (fewer tokens) |

### What you get per video

- `video_id`, `title`, `language`, `total_segments`, `total_duration_seconds`
- `captions` / `full_text`
- `metadata` (channel, views, likes, comments and more)
- `sentiment`, `entities`, `seo` metrics
- `summary` (optional)

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `videoUrls` | string\[] | — | YouTube URLs or IDs |
| `languages` | string\[] | `["es","en","auto"]` | Language priority |
| `maxResults` | int | 50 | Max videos (1-1000) |
| `outputFormat` | string | `textWithTimestamps` | See formats above |
| `compactMode` | bool | false | Shorter output for LLM/RAG |
| `freeTier` | int | 10 | First N videos free |

### YouTube transcript API without a key

No API key required. Just provide the video URLs. The Actor handles retries and multi-language auto-detection.

### Pricing

Pay per event. **The first 10 videos of a run are free** — only results beyond that are charged. See the Pricing tab for the current rate.

### Use it from your stack (integration-ready)

- **MCP / AI agents** — discoverable via the Apify MCP server (Claude, Cursor, etc.).
- **n8n / Make / Zapier** — run it as a node/step and pass `videoUrls`.
- **LangChain / LlamaIndex** — load transcripts as documents for RAG.
- **Google Sheets / Airbyte** — push the dataset straight into your sheets or warehouse.
- **API** — `POST https://api.apify.com/v2/acts/vexmeavf~youtube-transcript-scraper/run-sync-get-dataset-items` with your token.

#### Schedule recommendation

Run **daily or weekly** to keep a fresh transcript dataset (ideal with Apify **Schedules**).

### More from us

- **[Research Scraper](https://apify.com/vexmeavf/research-scraper)** — 8 science databases in one (PubMed, arXiv, OpenAlex, Crossref, Europe PMC, DOAJ, Zenodo, OSF).
- **[Clinical Trials Scraper](https://apify.com/vexmeavf/clinical-trials-scraper)** — ClinicalTrials.gov studies.
- **[OpenAlex Scraper](https://apify.com/vexmeavf/openalex-scraper)** and **[Crossref Scraper](https://apify.com/vexmeavf/crossref-scraper)** — scholarly papers.

### FAQ

**How do I download a YouTube transcript?**
Run this Actor with the video URL. The transcript is returned in the dataset, ready to export as JSON, CSV or Excel.

**Does it work without captions?**
It returns the available captions/subtitles. If a video has none, the item reports an error.

**Can I get transcripts in another language?**
Yes — set your preferred languages; auto-detection is used as fallback.

**Is it good for RAG/LLM pipelines?**
Yes. Use `compact` output format to reduce token usage by ~50%.

# Actor input Schema

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

YouTube video URLs or 11-character video IDs. Automatic deduplication.

## `languages` (type: `array`):

Language codes in priority order. 'auto' = try common auto-generated languages.

## `maxResults` (type: `integer`):

Maximum number of videos to process in this run.

## `outputFormat` (type: `string`):

How to structure the transcript output: captions, timestamps, XML variants, single string, or compact mode for RAG/LLM.

## `compactMode` (type: `boolean`):

Reduce output size by 50% for LLM/RAG pipelines. Shorter field names, truncated text, essential data only.

## `maxRetries` (type: `integer`):

Number of retry attempts for failed videos with exponential backoff.

## `includeSummary` (type: `boolean`):

Generate a 3-sentence executive summary for each transcript.

## `includeSentiment` (type: `boolean`):

Analyze positive/negative/neutral sentiment per segment.

## `includeEntities` (type: `boolean`):

Extract named entities: persons, organizations, URLs, emails, dates, money.

## `includeSEO` (type: `boolean`):

Calculate readability scores, keyword density, and word count.

## `includeMetadata` (type: `boolean`):

Include video title, channel name, thumbnail URL, and 8 more fields from YouTube oEmbed API.

## `freeTier` (type: `integer`):

The first N results of a run are FREE. Beyond that, each result is charged.

## Actor input object example

```json
{
  "languages": [
    "es",
    "en",
    "auto"
  ],
  "maxResults": 50,
  "outputFormat": "textWithTimestamps",
  "compactMode": false,
  "maxRetries": 3,
  "includeSummary": true,
  "includeSentiment": true,
  "includeEntities": true,
  "includeSEO": true,
  "includeMetadata": true,
  "freeTier": 10
}
```

# Actor output Schema

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

One item per video: transcript, captions, language and metadata.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("vexmeavf/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 = {}

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

```

## MCP server setup

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