# YouTube Transcript Scraper - Pay Only for Success (`mazzino_ains/youtube-transcript-reliable`) Actor

Extract YouTube transcripts, captions and subtitles in bulk as plain text, timestamped JSON or SRT. Works with videos, Shorts and past live streams, falls back across languages, and never charges for videos without captions. Use it from the API, n8n, Make or AI agents.

- **URL**: https://apify.com/mazzino_ains/youtube-transcript-reliable.md
- **Developed by:** [Niteesh Balajee](https://apify.com/mazzino_ains) (community)
- **Categories:** Videos, AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.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

Extract YouTube transcripts, captions and subtitles in bulk as plain text, timestamped JSON segments or SRT files. You pay only for videos that return a transcript. Videos with no captions, private or deleted videos and bad links are reported with a clear reason and cost nothing.

### What is YouTube Transcript Scraper?

Give it a list of YouTube video links and it returns one result per video:

- **The full transcript** as clean plain text, ready for an LLM, a search index or a document.
- **Timestamped segments** (start time and duration for every line), and optionally a ready-to-use **SRT subtitle file**.
- **Video details at no extra cost:** title, channel name, channel id, video length and view count.
- **Language details:** which language was returned, whether the captions are human-written or auto-generated, and every other caption language the video offers.

It works with regular videos, YouTube Shorts and finished live streams, and accepts every link format: `watch?v=`, `youtu.be`, `/shorts/`, `/live/`, `/embed/`, YouTube Music links, or a bare 11-character video id.

### What data can you extract from YouTube videos?

| Data | Field |
|---|---|
| Full transcript as plain text | `text` |
| Timestamped caption lines | `segments` (text, start, duration) |
| SRT subtitle file | `srt` |
| Video title | `title` |
| Channel name and id | `channelName`, `channelId` |
| Video length and view count | `videoLengthSeconds`, `viewCount` |
| Transcript language, and whether it is auto-generated | `language`, `languageCode`, `isGenerated` |
| All caption languages the video has | `availableLanguages` |
| Word count and line count | `wordCount`, `segmentCount` |

### Why use this YouTube transcript scraper?

- **No charge for failures.** Many videos have no captions at all. Here those cost nothing, so a list of 1,000 links where 300 have no captions is billed as 700.
- **Every failure is explained.** Each video gets a `status` (`ok`, `no_captions`, `unavailable`, `invalid_input`, `blocked` or `error`) and a plain-language reason, instead of one failed run and no data.
- **Built to get through YouTube's blocking.** Requests go through residential proxies, and a blocked request is retried with a fresh IP address.
- **Language fallback.** Ask for English and get English when it exists; otherwise get the language the video does have, clearly labelled. Human-written captions are preferred over auto-generated ones.
- **No duplicate charges.** The same video listed twice, even in two different link formats, is fetched and billed once.
- **Spending limit respected.** Set a maximum charge for a run and the Actor stops as soon as it is reached.
- **Fast.** Videos are processed in parallel. In our tests a batch of 8 videos finished in about 17 seconds.

### What can you do with YouTube transcripts?

- Feed video content to ChatGPT, Claude or another LLM to summarise, translate or answer questions.
- Build a RAG knowledge base or search index from talks, courses, podcasts and tutorials.
- Turn videos into blog posts, show notes, newsletters and social posts.
- Research what competitors, creators or experts say across many videos.
- Produce SRT subtitle files for editing or re-publishing your own videos.
- Collect text data for analysis, such as topics, keywords and sentiment.

### How to scrape YouTube transcripts

1. Click **Try for free** and sign in to Apify.
2. Paste your YouTube links into **YouTube videos**, one per line.
3. Choose your **Preferred languages** (the default is English) and turn on **Include SRT subtitles** if you need subtitle files.
4. Click **Start**.
5. Download the results as JSON, CSV, Excel or HTML, or read them through the API.

### How much will it cost to scrape YouTube transcripts?

**$5 per 1,000 transcripts ($0.005 each), charged only for videos that return a transcript.**

| Transcripts returned | Price |
|---|---|
| 100 | $0.50 |
| 1,000 | $5 |
| 10,000 | $50 |

There is no start fee and no separate bill for compute or proxies; platform usage is included in the price. Videos that fail for any reason are free. Apify's free plan includes $5 of credit every month, which covers up to about 1,000 transcripts, so you can try it without paying.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `videoUrls` | array | required | YouTube URLs or video ids |
| `languages` | array | `["en"]` | Language codes in order of preference, for example `["en", "es"]` |
| `fallbackToAnyLanguage` | boolean | `true` | Return any available language if none of the preferred ones exist |
| `translateTo` | string | empty | Experimental: translate using YouTube's own caption translation |
| `includeSegments` | boolean | `true` | Add timestamped segments |
| `includeSrt` | boolean | `false` | Add the transcript as an SRT subtitle file |
| `maxConcurrency` | integer | `5` | Videos processed in parallel |
| `maxRetries` | integer | `4` | Retries per video when YouTube blocks a request |
| `proxyConfiguration` | object | Residential | YouTube blocks datacenter IPs; keep residential proxies on |

```json
{
    "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ", "https://youtu.be/jNQXAC9IVRw"],
    "languages": ["en"],
    "includeSrt": true
}
```

### Output

One item per video. A successful item looks like this:

```json
{
    "input": "https://youtu.be/jNQXAC9IVRw",
    "videoId": "jNQXAC9IVRw",
    "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "status": "ok",
    "title": "Me at the zoo",
    "channelName": "jawed",
    "channelId": "UC4QobU6STFB0P71PMvOGN5A",
    "videoLengthSeconds": 19,
    "viewCount": 448265044,
    "isLiveContent": false,
    "language": "English",
    "languageCode": "en",
    "isGenerated": false,
    "isTranslated": false,
    "availableLanguages": [{ "languageCode": "en", "language": "English", "isGenerated": false }],
    "text": "All right, so here we are, in front of the elephants...",
    "wordCount": 39,
    "segmentCount": 6,
    "transcriptDurationSeconds": 18.881,
    "segments": [{ "text": "All right, so here we are, in front of the elephants", "start": 1.2, "duration": 2.16 }]
}
```

A video that could not be transcribed is still listed, so your results line up with your input:

```json
{
    "input": "https://www.youtube.com/watch?v=aaaaaaaaaaa",
    "videoId": "aaaaaaaaaaa",
    "url": "https://www.youtube.com/watch?v=aaaaaaaaaaa",
    "status": "unavailable",
    "error": "This video is private, deleted, or does not exist."
}
```

#### Status values

| Status | Meaning | Charged |
|---|---|---|
| `ok` | Transcript returned | Yes |
| `no_captions` | The video has no captions, or none in the requested languages | No |
| `unavailable` | Private, deleted, age-restricted, or a live stream that has not finished processing | No |
| `invalid_input` | The value is not a YouTube video link or id | No |
| `blocked` | YouTube blocked every retry | No |
| `error` | Anything else; the `error` field has details | No |

### Use it as a YouTube transcript API

Every Apify Actor has an API. This call runs the Actor and returns the transcripts in one request:

```bash
curl -X POST "https://api.apify.com/v2/acts/mazzino_ains~youtube-transcript-reliable/run-sync-get-dataset-items" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["https://youtu.be/jNQXAC9IVRw"], "includeSegments": false}'
```

The same call in Python:

```python
import requests

resp = requests.post(
    "https://api.apify.com/v2/acts/mazzino_ains~youtube-transcript-reliable/run-sync-get-dataset-items",
    headers={"Authorization": "Bearer YOUR_APIFY_TOKEN"},
    json={"videoUrls": ["https://youtu.be/jNQXAC9IVRw"], "includeSegments": False},
    timeout=300,
)
for video in resp.json():
    if video["status"] == "ok":
        print(video["title"], "-", video["wordCount"], "words")
    else:
        print(video["input"], "failed:", video["error"])
```

Open the **API** menu at the top of this page for ready-made examples in JavaScript and other languages.

### Use it in n8n, Make and Zapier

**n8n:** add an **HTTP Request** node with method `POST`, the URL from the example above, a **Header Auth** credential (name `Authorization`, value `Bearer YOUR_APIFY_TOKEN`) and a JSON body with your `videoUrls`. The node returns one item per video, so you can send `text` straight to an AI node, Google Sheets or Notion. It works on n8n Cloud because the Actor handles the proxies.

**Make and Zapier:** use the same HTTP call, or the Apify app's action for running an Actor and pick this Actor by name.

Add a filter on `status` equal to `ok` so videos without captions do not break the rest of your workflow.

### Use it with AI agents and LLM apps

- **MCP clients (Claude, Cursor, VS Code and others):** connect Apify's MCP server at `https://mcp.apify.com` and ask your assistant to use `mazzino_ains/youtube-transcript-reliable`. The agent can then fetch a video's transcript by itself.
- **RAG and summarisation:** use `text` when you want the whole video as one document. Use `segments` when you need timestamps, for example to split long videos into chunks or to link an answer back to the moment in the video.
- **Agent-friendly output:** every field has a description, and failed videos come back as normal items with a `status` and `error`, so an agent can tell "no captions" from a real error.

### Coming from youtube-transcript-api? RequestBlocked and IpBlocked

The Python library `youtube-transcript-api` works on a laptop and then fails with `RequestBlocked` or `IpBlocked` on AWS, Google Cloud and other servers, because YouTube blocks cloud IP addresses. This Actor is a hosted way around that:

| Error you get from the library | What this Actor does |
|---|---|
| `RequestBlocked`, `IpBlocked` | Sends requests through residential proxies and retries with a new IP address. If every retry fails, the video returns `blocked` and is not charged. |
| `TranscriptsDisabled`, `NoTranscriptFound` | Returns `no_captions` with the reason. Not charged. |
| `VideoUnavailable`, `VideoUnplayable`, `AgeRestricted` | Returns `unavailable` with the reason. Not charged. |
| `InvalidVideoId` | Returns `invalid_input`. Not charged. |

### Frequently asked questions

**Does it work on videos without captions?**
No. This Actor reads the captions YouTube already has, including auto-generated ones. It does not run speech-to-text on the audio. A video with no captions returns `no_captions` and is not charged.

**Does it work with YouTube Shorts and live streams?**
Shorts work like any other video. Live streams work after they end and YouTube finishes processing their captions.

**Which languages are supported?**
Any caption language the video has. List your preferred language codes in order; if none exist, the Actor returns whatever language is available unless you turn `fallbackToAnyLanguage` off.

**Can I scrape a whole channel or playlist?**
Not directly. This Actor takes video links. Collect the links with a YouTube channel or playlist scraper first, then pass them in.

**Can I download subtitles as SRT?**
Yes. Turn on `includeSrt` and each item gets an `srt` field you can save as a `.srt` file.

**Why was a video not transcribed?**
Check the item's `status` and `error` fields. The most common reasons are that the uploader disabled captions, or the video is private, deleted or age-restricted.

**Does YouTube have an official transcript API?**
Only for your own videos. The official YouTube Data API can download a caption track when the video's owner authorises it. For other public videos there is no official transcript API, which is why tools like this one read the captions the YouTube player shows.

**Can I download a transcript as a text or subtitle file?**
Yes. Export the results as JSON, CSV or Excel from the run's Output tab, or read the `text` field for plain text and the `srt` field for a subtitle file.

**Can I scrape many videos at once?**
Yes. Paste as many links as you like. Videos are processed in parallel and duplicates are removed before anything is charged.

**Is it legal to scrape YouTube transcripts?**
The Actor only reads captions that are publicly available on YouTube. Transcripts can be protected by copyright, so you are responsible for how you use and share them. If you are unsure, get legal advice for your case.

### Limits

- Videos without captions cannot be transcribed; this Actor does not run speech-to-text.
- Age-restricted videos need a signed-in viewer and are not supported.
- Translation depends on YouTube's translation endpoint, which is heavily rate-limited. When it fails you get the original language with a `note`.

### Support

Found a video that should work but does not? Open a ticket in the **Issues** tab with the video link and it will be looked at.

# Actor input Schema

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

YouTube URLs or 11-character video ids. Any format works: watch links, youtu.be, Shorts, /live/, /embed/, music.youtube.com.

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

Language codes in order of preference, for example en, hi, es. Human-written captions are preferred over auto-generated ones.

## `fallbackToAnyLanguage` (type: `boolean`):

If none of the preferred languages exist, return whichever captions the video has instead of failing.

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

Language code to translate into using YouTube's own caption translation, for example en. YouTube often rate-limits translation; when it does, you get the original language with a note. Leave empty for no translation.

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

Add a 'segments' array with text, start and duration for every caption line.

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

Add an 'srt' field with the transcript as an SRT subtitle file.

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

How many videos to process at the same time.

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

How many times to retry a video with a new IP address when YouTube blocks the request.

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

YouTube blocks datacenter IPs, so residential proxies are strongly recommended.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "https://youtu.be/dQw4w9WgXcQ"
  ],
  "languages": [
    "en"
  ],
  "fallbackToAnyLanguage": true,
  "includeSegments": true,
  "includeSrt": false,
  "maxConcurrency": 5,
  "maxRetries": 4,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `transcripts` (type: `string`):

All results, including videos that returned no transcript (those are not charged).

# 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",
        "https://youtu.be/dQw4w9WgXcQ"
    ],
    "languages": [
        "en"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("mazzino_ains/youtube-transcript-reliable").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",
        "https://youtu.be/dQw4w9WgXcQ",
    ],
    "languages": ["en"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("mazzino_ains/youtube-transcript-reliable").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",
    "https://youtu.be/dQw4w9WgXcQ"
  ],
  "languages": [
    "en"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call mazzino_ains/youtube-transcript-reliable --silent --output-dataset

```

## MCP server setup

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

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/qA5YZWPxsBSovebvf/builds/F6n3Wm9Qygcc2syrS/openapi.json
