# YouTube Transcript Scraper - Subtitles & Captions (`pink_comic/youtube-transcript-scraper`) Actor

Get YouTube transcripts and subtitles as clean text with timestamps for videos, whole channels or search results. Manual + auto captions, any language.

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

## Pricing

from $1.50 / 1,000 transcripts

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

Get **YouTube transcripts, subtitles and closed captions** as clean text, with or without timestamps, for single videos, **whole channels** or **search results**. Each row has the full transcript, a `[mm:ss]` timestamped version, the caption segments, the language (manual or auto-generated) plus video metadata: title, channel, views, duration, description and tags. **No API key, no login, no YouTube quota.**

### Why this transcript scraper

- **Videos, channels and searches in one run.** Paste video links, a channel handle like `@hubermanlab` (latest videos) or a search term; the actor finds the videos and pulls every transcript.
- **Manual and auto-generated captions, any language.** Pick a language code (`en`, `es`, `de`, `ja`...). Human subtitles are preferred over auto captions; if your language is missing you still get the best available track, and `availableLanguages` lists every track.
- **AI-ready output.** Plain `transcript` text for LLMs/RAG, `timestampedTranscript` for quoting and chapters, and a `segments` array (start, duration, text) for subtitles or search.
- **Video metadata included at no extra cost.** Title, channel, views, duration, description, tags and thumbnail on every row.
- **Fast and reliable.** Reads YouTube's own caption files directly (no browser), 5 videos in parallel, typically 1-2 seconds per video.
- **Fair pricing.** $0.0015 per transcript + $0.002 per run. Videos without captions are **not charged** (they are listed in the `SKIPPED_VIDEOS` record).

### Use cases

- **AI and RAG pipelines**: feed lectures, podcasts and tutorials into ChatGPT, Claude or your vector database.
- **Content repurposing**: turn videos into blog posts, newsletters, show notes and social threads.
- **Market, brand and competitor research**: analyze what creators and competitors say about a product or topic across a whole channel or search.
- **SEO and keyword research**: mine spoken keywords and questions from top-ranking videos.
- **Education and accessibility**: export subtitles for study notes, translation work or captioning.
- **Media monitoring and journalism**: search quotes across many videos with timestamps.

### Input examples

Two videos (default):

```json
{ "videoUrls": ["https://www.youtube.com/watch?v=UF8uR6Z6KLc", "https://youtu.be/arj7oStGLkU"] }
```

Latest 25 videos of two channels, plain text only:

```json
{ "channelUrls": ["@hubermanlab", "https://www.youtube.com/@lexfridman"], "maxVideosPerInput": 25, "includeSegments": false }
```

Spanish transcripts of the top 20 results for a search:

```json
{ "searchQueries": ["receta pan de masa madre"], "language": "es", "maxVideosPerInput": 20 }
```

Only human-made subtitles:

```json
{ "videoUrls": ["https://www.youtube.com/watch?v=UF8uR6Z6KLc"], "allowAutoGenerated": false }
```

### Sample output

```json
{
  "availableLanguages": [
    "ar",
    "en (auto)",
    "en",
    "it",
    "ja",
    "km",
    "pt-BR",
    "es",
    "es-ES"
  ],
  "channelId": "UC-EnprmCZ3OXyAoG7vjVNCA",
  "channelName": "Stanford",
  "channelUrl": "https://www.youtube.com/channel/UC-EnprmCZ3OXyAoG7vjVNCA",
  "description": "Drawing from some of the most pivotal points in his life, Steve Jobs, chief executive officer and co-founder of Apple Co...",
  "durationSeconds": 904,
  "input": "https://www.youtube.com/watch?v=UF8uR6Z6KLc",
  "inputType": "video",
  "isAutoGenerated": false,
  "isLive": false,
  "keywords": [
    "apple",
    "graduation",
    "education"
  ],
  "language": "en",
  "languageName": "English - English",
  "scrapedAt": "2026-11-15T17:31:51Z",
  "segmentCount": 244,
  "segments": [
    {
      "start": 7.47,
      "duration": 2.899,
      "text": "This program is brought to you by Stanford University."
    },
    {
      "start": 10.47,
      "duration": 3.973,
      "text": "Please visit us at stanford.edu"
    }
  ],
  "thumbnail": "https://i.ytimg.com/vi/UF8uR6Z6KLc/hqdefault.jpg?sqp=-oaymwEmCOADEOgC8quKqQMa8AEB-AG-AoAC8AGKAgwIABABGGUgTShAMA8=&rs=AOn4CLBQpu5eC9IARIhuqaqee1Zc53SWpw",
  "timestampedTranscript": "[0:07] This program is brought to you by Stanford University.\n[0:10] Please visit us at stanford.edu\n[0:22] Thank You. I am honored to be with you today at your commencement\n...",
  "title": "Steve Jobs' 2005 Stanford Commencement Address",
  "transcript": "This program is brought to you by Stanford University. Please visit us at stanford.edu Thank You. I am honored to be with you today at your commencement from one of the finest universities in the worl...",
  "url": "https://www.youtube.com/watch?v=UF8uR6Z6KLc",
  "videoId": "UF8uR6Z6KLc",
  "viewCount": 49436166,
  "wordCount": 2298
}

```

### Output fields

| Field | Description |
|---|---|
| `transcript` | Full transcript as plain text |
| `timestampedTranscript` | One line per caption with a `[m:ss]` timestamp |
| `segments` | Array of `{start, duration, text}` (seconds) |
| `language`, `languageName`, `isAutoGenerated` | Which caption track was used |
| `availableLanguages` | Every caption track on the video (`(auto)` = auto-generated) |
| `wordCount`, `segmentCount` | Transcript size |
| `title`, `channelName`, `channelId`, `channelUrl`, `viewCount`, `durationSeconds`, `description`, `keywords`, `thumbnail` | Video metadata |
| `input`, `inputType` | The video link, channel or search that produced the row |

Download results as JSON, CSV, Excel or HTML, or read them with the Apify API, Python/JavaScript clients, Zapier, Make or n8n.

### Pricing

Pay per event: **$0.0015 per transcript** + **$0.002 per run**. 1,000 transcripts cost about $1.50. Videos without captions are skipped for free unless you turn on *Include videos without a transcript*. Set *Max transcripts* or a run spending limit to cap the cost.

### FAQ

**Does it need a YouTube API key or login?** No. It uses the same public caption files the YouTube player loads.

**What if a video has no subtitles?** Some videos have captions disabled. Those are skipped (not charged) and listed with the reason in the `SKIPPED_VIDEOS` key-value record. Turn on *Include videos without a transcript* if you want a row for each of them.

**Which language do I get?** Your preferred language as a manual track first, then as an auto-generated track. If neither exists, the video's best available track (check `language`). `availableLanguages` shows all tracks.

**Can it transcribe videos with no captions (speech-to-text)?** No, it extracts YouTube's existing captions. Nearly all spoken videos have auto-generated English captions.

**Does it work for Shorts and live replays?** Yes, if the video has captions.

**How do I use it with AI agents?** Call it from the Apify MCP server or API with a list of URLs and pass the `transcript` field to your model.

**Is it legal?** It reads publicly available caption data. You are responsible for how you use the content (copyright, YouTube Terms). Do not republish transcripts you do not have rights to.

### Related actors

- YouTube Scraper (search, channels, video stats) and YouTube Comments Scraper by the same author.

### Support

Found a video that fails or need a field? Open an issue on the Issues tab; we usually reply within a day.

# Actor input Schema

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

YouTube video, Shorts or youtu.be links (or 11-character video IDs).

## `channelUrls` (type: `array`):

Channel handles or URLs ('@mkbhd', 'https://www.youtube.com/@hubermanlab'). Gets transcripts of the channel's latest videos (up to Max videos per channel/search).

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

YouTube searches, e.g. 'sourdough tutorial'. Gets transcripts of the top results (up to Max videos per channel/search).

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

Language code of the transcript you want, e.g. en, es, de, fr, pt, ja. Manual captions in this language are preferred, then auto-generated ones; if the video has neither, the best available track is returned (see the language field).

## `allowAutoGenerated` (type: `boolean`):

Use YouTube's automatic (speech recognition) captions when no manual subtitles exist.

## `includeSegments` (type: `boolean`):

Add the segments array (start, duration, text) and a \[mm:ss] timestamped transcript. Turn off for plain text only.

## `includeVideosWithoutTranscript` (type: `boolean`):

Also output a row (with an error message) for videos that have no captions. These rows are charged like any result. Off = they are only listed in the SKIPPED_VIDEOS key-value record, free.

## `maxVideosPerInput` (type: `integer`):

How many videos to take from each channel or search term.

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

Maximum transcripts in total. Default 100 = at most about $0.15.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=UF8uR6Z6KLc",
    "https://www.youtube.com/watch?v=arj7oStGLkU"
  ],
  "language": "en",
  "allowAutoGenerated": true,
  "includeSegments": true,
  "includeVideosWithoutTranscript": false,
  "maxVideosPerInput": 10,
  "maxResults": 100
}
```

# Actor output Schema

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

All records from this run in the default dataset, shown with the Overview table view.

# 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=UF8uR6Z6KLc",
        "https://www.youtube.com/watch?v=arj7oStGLkU"
    ],
    "language": "en",
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("pink_comic/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=UF8uR6Z6KLc",
        "https://www.youtube.com/watch?v=arj7oStGLkU",
    ],
    "language": "en",
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("pink_comic/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=UF8uR6Z6KLc",
    "https://www.youtube.com/watch?v=arj7oStGLkU"
  ],
  "language": "en",
  "maxResults": 100
}' |
apify call pink_comic/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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