# YouTube Transcript Scraper - Reliable, Pay Only for Results (`dyalaalsharif/youtube-transcript-scraper`) Actor

Get YouTube transcripts and subtitles from videos, Shorts, channels, playlists and search: clean text, timestamps, SRT, 100+ languages and translation. Automatic retries, and you never pay for videos without captions.

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

## Pricing

from $6.00 / 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 — Reliable, Pay Only for Results

Get **YouTube transcripts, captions and subtitles** from single videos, Shorts, whole channels, playlists or YouTube search results. Clean text, timestamped lines, SRT subtitles, 100+ languages and built-in translation.

**You only pay for transcripts you actually get.** Videos without captions, private videos and failed requests are free and clearly marked in the output.

### What you get

| Field | Details |
|---|---|
| 📝 **transcript** | The full transcript as clean text, ready for AI, summaries or search |
| ⏱️ **segments** | Every caption line with start time and duration |
| 🎬 **srt** | Optional SRT subtitle text, ready to save as a .srt file |
| 🌍 **language** | Language used, whether captions are human-made or auto-generated, and all languages available for the video |
| 🔄 **translation** | Optional translation into any language YouTube supports |
| ℹ️ **video info** | Title, channel, duration and views (when available) |

### Why this scraper

- **Reliable** — automatic retries with fresh sessions, and an automatic switch to residential proxies when YouTube blocks.
- **Fair pricing** — charged per transcript returned. No captions = no charge.
- **Bulk friendly** — paste a channel or playlist link and get transcripts for its latest videos in one run.
- **Smart language choice** — give your preferred languages in order; human-made captions are used first, auto captions as backup.
- **Built on actively maintained open-source tools**, so it keeps working when YouTube changes.

### Use cases

- **AI & LLM workflows** — feed transcripts into ChatGPT, Claude or your RAG pipeline for summaries, Q\&A and research.
- **Content repurposing** — turn videos into blog posts, newsletters, threads and captions.
- **SEO & research** — analyze what competitors and creators talk about.
- **Education & accessibility** — study notes, subtitles and translations.
- **Market research** — collect opinions from reviews and interviews at scale.

### How to use

1. Paste one or more **YouTube URLs**: videos, Shorts, channels (like `@TED`) or playlists.
2. Optionally add **search queries** to get transcripts for the top search results.
3. Choose your **preferred languages** (e.g. `en`, `ar`) and, if you like, a language to **translate to**.
4. Click **Start** and download results as JSON, CSV, Excel, or connect them to your apps and AI agents.

### Input example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "https://www.youtube.com/@TED"
  ],
  "maxVideosPerSource": 10,
  "languages": ["en"],
  "includeTimestamps": true,
  "includeSrt": false
}
```

### Output example

```json
{
  "videoId": "jNQXAC9IVRw",
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "title": "Me at the zoo",
  "channel": "jawed",
  "language": "English",
  "languageCode": "en",
  "isGenerated": false,
  "isTranslated": false,
  "transcript": "All right, so here we are in front of the elephants...",
  "wordCount": 34,
  "segments": [
    { "start": 1.2, "duration": 2.16, "text": "All right, so here we are, in front of the elephants" }
  ],
  "availableLanguages": [
    { "languageCode": "en", "language": "English", "isGenerated": false }
  ]
}
```

Videos without a transcript look like this and are **not charged**:

```json
{
  "videoId": "abc123def45",
  "error": "This video has no captions (subtitles are turned off).",
  "noTranscript": true
}
```

### Pricing

Pay per event: **one "transcript" event for each video that returns a transcript.** Platform and proxy usage are included. Videos without captions, private or unavailable videos and failed requests are free.

### Good to know

- Transcripts come from YouTube's own captions (human-made or auto-generated). Videos with captions turned off have no transcript.
- Age-restricted and members-only videos are not public, so their transcripts can't be collected.
- For channels and playlists, the latest videos are taken first, up to your **Max videos** setting.

### Is it legal?

This Actor collects publicly available captions only. It does not log in or collect personal data. You are responsible for using transcripts in line with copyright law and YouTube's terms.

### Feedback

Found a problem or want a feature? Open an issue on the **Issues** tab — it gets answered quickly.

# Actor input Schema

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

Video, Shorts, channel (e.g. https://www.youtube.com/@mkbhd) or playlist links. Plain video IDs also work.

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

Optional. Get transcripts for the top videos of a YouTube search, e.g. 'how to start a podcast'.

## `maxVideosPerSource` (type: `integer`):

How many of the latest videos to take from each channel, playlist or search. Single video links are always included.

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

Language codes in order of preference, e.g. en, ar, es, fr, de. The first available one is used.

## `anyLanguageFallback` (type: `boolean`):

If none of your preferred languages exist, return the video's own transcript instead of nothing.

## `translateTo` (type: `string`):

Language code to translate every transcript into using YouTube's built-in translation, e.g. en or ar. Leave empty to keep the original language.

## `preferManualCaptions` (type: `boolean`):

Use captions written by the creator when they exist, and fall back to YouTube's automatic captions.

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

Add each caption line with its start time and duration.

## `includeSrt` (type: `boolean`):

Add the transcript in SRT subtitle format, ready to save as a .srt file.

## `maxConcurrency` (type: `integer`):

How many videos to process at once.

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

Proxy servers used to reach YouTube. YouTube blocks datacenter IPs, so residential proxies are used by default.

## `residentialFallback` (type: `boolean`):

If YouTube blocks the default proxies, automatically retry through residential proxies. Recommended.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "https://www.youtube.com/@TED"
  ],
  "searchQueries": [],
  "maxVideosPerSource": 20,
  "languages": [
    "en"
  ],
  "anyLanguageFallback": true,
  "preferManualCaptions": true,
  "includeTimestamps": true,
  "includeSrt": false,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "residentialFallback": true
}
```

# Actor output Schema

## `results` (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=jNQXAC9IVRw"
    ]
};

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

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

```

## MCP server setup

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