# YouTube Transcript Extractor — Manual & Auto Captions (`muhammadafzal/youtube-transcript-extractor`) Actor

Extract YouTube transcripts from video links or IDs: timed segments and full text, manual or auto-generated captions, any language. $2.50 per 1,000 transcripts.

- **URL**: https://apify.com/muhammadafzal/youtube-transcript-extractor.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** Videos, Social media, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.40 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Extractor — Manual & Auto Captions

YouTube Transcript Extractor returns the transcript of YouTube videos from their links or IDs: every caption line with its start time, the full plain text, and optional SRT subtitles, from manual or auto-generated captions in the language you choose. It costs USD 3.00 per 1,000 transcripts plus USD 0.005 per run, and videos without captions in your language are not charged.

Use it as a bulk YouTube transcript API for research, AI and RAG pipelines, content repurposing, SEO, accessibility checks and video analytics. One run handles 1 to 500 videos.

### What does YouTube Transcript Extractor return?

One record per video that has captions in the chosen language. Each record holds:

| Field | What it contains | Example |
|---|---|---|
| `position` | Position of the video in your list; records are written in this order | `1` |
| `videoId` | 11-character YouTube video ID | `jNQXAC9IVRw` |
| `videoUrl` | Watch link of the video | `https://www.youtube.com/watch?v=jNQXAC9IVRw` |
| `input` | Your entry, exactly as given | `https://youtu.be/jNQXAC9IVRw` |
| `language` | Caption language code as YouTube serves it | `en`, `pt-BR`, `zh-CN` |
| `languageName` | English name of that language | `Brazilian Portuguese` |
| `requestedLanguage` | The language you asked for, normalized | `pt` |
| `captionSource` | `manual` (uploaded by the creator) or `auto-generated` (YouTube speech captions) | `manual` |
| `manualLanguages` | Every language the video has manual captions in | `["de", "en"]` |
| `autoGeneratedLanguages` | Every language the video has auto-generated captions in | `["en"]` |
| `segmentCount`, `wordCount`, `characterCount` | Size of the transcript | `6`, `39`, `217` |
| `text` | Full transcript as plain text | `All right, so here we are…` |
| `segments` | Timed caption lines: `start` and `duration` in seconds, `text` | `[{"start": 1.2, "duration": 2.16, "text": "…"}]` |
| `srt` | SubRip (.srt) subtitle text, when `includeSrt` is on | `1\n00:00:01,200 --> …` |
| `extractedAt` | When the transcript was read (UTC) | `2026-11-08T07:00:00.000Z` |

### How do I get a YouTube transcript with timestamps?

Paste video links or IDs into **YouTube video links or IDs** and start the run. Timed segments are on by default.

| Input | Description | Default |
|---|---|---|
| `videoUrls` | 1 to 500 YouTube links or IDs: `watch?v=` links, `youtu.be` links, Shorts, embed and live links, or bare IDs. Playlist and channel links are not expanded. | required |
| `language` | Caption language code: `en`, `es`, `de`, `fr`, `hi`, `ja`, `pt-BR`, `zh-Hans`… | `en` |
| `captionSource` | `manualFirst`, `autoFirst`, `manualOnly` or `autoOnly` | `manualFirst` |
| `includeTimestamps` | Return the `segments` array with start times | `true` |
| `includeSrt` | Also return the transcript as SRT subtitle text | `false` |

Example input:

```json
{
    "videoUrls": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw",
        "https://youtu.be/iG9CE55wbtY"
    ],
    "language": "en",
    "captionSource": "manualFirst",
    "includeTimestamps": true,
    "includeSrt": false
}
```

Duplicates are removed before any work, so the same video listed twice is read and charged once. Records come out in the order of your list.

### Which caption languages and sources does it support?

Any language YouTube has captions in. A plain code also matches regional tracks: `pt` finds `pt-BR` or `pt-PT`, `en` finds `en-GB` when there is no plain `en` track, `zh-Hant` finds `zh-TW`, and `he` finds Hebrew tracks that YouTube still files under `iw`. The record's `language` field shows the exact track you got.

- **Manual captions** are uploaded by the creator and are usually punctuated and accurate.
- **Auto-generated captions** come from YouTube's speech recognition, in the spoken language, without punctuation in most languages.
- `manualFirst` (default) returns manual captions and falls back to auto-generated ones in the same language; `autoFirst` does the reverse; `manualOnly` and `autoOnly` never fall back.

The Actor reads the captions YouTube already has. It does not translate and does not transcribe audio, so a video without captions returns no transcript.

### What does the output look like?

```json
{
    "position": 1,
    "videoId": "jNQXAC9IVRw",
    "videoUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "input": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "language": "en",
    "languageName": "English",
    "requestedLanguage": "en",
    "captionSource": "manual",
    "manualLanguages": ["de", "en"],
    "autoGeneratedLanguages": [],
    "segmentCount": 6,
    "wordCount": 39,
    "characterCount": 217,
    "text": "All right, so here we are …",
    "segments": [
        { "start": 1.2, "duration": 2.16, "text": "All right, so here we are …" }
    ],
    "srt": null,
    "extractedAt": "2026-11-08T08:13:58.067Z"
}
```

Every run also writes an `OUTPUT` record to the key-value store: the run status (`SUCCEEDED`, `PARTIAL`, `EMPTY`, `FAILED`), counts, and one line per input with its outcome and reason.

### How much does YouTube Transcript Extractor cost?

You pay per transcript delivered, plus a small start fee per run. Videos without a transcript are free.

| Event | Free plan | Bronze | Silver | Gold |
|---|---|---|---|---|
| Transcript (one dataset record) | USD 0.003 | USD 0.002925 | USD 0.00285 | USD 0.0024 |
| Actor start (per run) | USD 0.005 | USD 0.005 | USD 0.005 | USD 0.005 |

The start fee is charged once per started GB of allocated memory, so one event at the default 256 MB. Worked examples on the Free plan price: 1 video costs USD 0.008; 100 videos with captions cost USD 0.305; 500 cost USD 1.505. Platform usage is included in these prices.

### What happens when a video has no captions?

You are not charged for it. The `OUTPUT` record lists each such video with the reason:

- `language-not-available`: the video has captions, but not in your language. The record lists the languages it does have, so you can run again with one of them.
- `no-captions`: the video has no captions at all.
- `unavailable`: the video is deleted, private, age-restricted or otherwise not public.
- `invalid-input`: the entry is not a YouTube video link or ID (for example a playlist link).
- `duplicate`: the same video appears earlier in the list.

A run where no video has a transcript ends as `EMPTY` with that explanation instead of failing.

### How do I use it from the API or an AI assistant?

Call it like any Apify Actor. JavaScript:

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('muhammadafzal/youtube-transcript-extractor').call({
    videoUrls: ['https://www.youtube.com/watch?v=jNQXAC9IVRw'],
    language: 'en',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].text);
```

Python (apify-client 3.x):

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("muhammadafzal/youtube-transcript-extractor").call(
    run_input={"videoUrls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"], "language": "en"}
)
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item["language"], item["text"][:200])
```

**Use it from an AI assistant.** The Actor works from Claude, ChatGPT, Cursor or any MCP client through Apify's MCP server. Add `https://mcp.apify.com/?tools=muhammadafzal/youtube-transcript-extractor` as an MCP server, then ask, for example: "Get the English transcripts of these three YouTube videos and summarize each one."

### When should I use a different tool?

- **Video titles, view counts, channel details or search results:** use a YouTube video or channel data Actor. This Actor returns transcripts only.
- **Videos without any captions:** this Actor reads existing captions and does not run speech-to-text.
- **A whole channel or playlist:** list the video links first, then pass them here (up to 500 per run).
- **Translated captions:** the Actor returns the languages a video already has; it does not machine-translate.

### FAQ

**Is this a YouTube transcript API?**
Yes. Every run can be started from the Apify API, the JavaScript or Python client, or an MCP client, and returns JSON records with the transcript text and timed segments.

**Does it work with YouTube Shorts and live streams?**
Yes for Shorts and finished live streams that have captions; pass their links as they are. A live stream that is still running has no captions yet and is reported in `OUTPUT` without a charge.

**Can I get transcripts in other languages?**
Yes, set `language` to any language code. You get the transcript when the video has captions in that language; otherwise `OUTPUT` lists the languages it has.

**What is the difference between manual and auto-generated captions?**
Manual captions are uploaded by the creator. Auto-generated captions come from YouTube's speech recognition. The `captionSource` field of every record says which one you got.

**How many videos can I process in one run?**
Up to 500. Lists longer than 30 videos are sent as batch jobs instead of one request per video.

**Am I charged for videos without captions, private videos or bad links?**
No. Only delivered transcripts are charged, plus the start fee once per run.

**Can I export transcripts as SRT or plain text?**
Yes. `text` is plain text, `segments` holds the timestamps, and `includeSrt` adds SubRip subtitle text. Datasets also export to JSON, CSV, Excel and other formats.

### Limits and data use

Public videos only: private, members-only, age-restricted and deleted videos are reported as unavailable, and nothing behind a sign-in is read. Captions belong to the video creators; make sure your use of transcripts respects their copyright and YouTube's terms. The Actor stores no personal data beyond what the captions themselves contain.

Questions or a video that should work but does not? Open an issue on the Actor's Issues tab with the video link and the run ID.

Last verified: 2026-11-09

# Actor input Schema

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

Use this for the videos whose transcripts you want, one per line. Accepts watch links (https://www.youtube.com/watch?v=jNQXAC9IVRw), youtu.be links, Shorts, embed and live links, or the bare 11-character video ID (jNQXAC9IVRw). Playlist, channel and search links are not expanded: list the videos themselves. Duplicates are removed before any work. 1 to 500 entries.

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

Use this to choose the transcript language, as a language code: en, es, de, fr, hi, ja, pt-BR, zh-Hans. A plain code also matches regional tracks (pt finds pt-BR or pt-PT; en finds en-GB). When a video has no captions in this language, the OUTPUT record lists the languages it does have. Default: en.

## `captionSource` (type: `string`):

Use this to choose between captions uploaded by the creator (manual) and YouTube's automatic speech captions (auto-generated). The first-choice options fall back to the other source in the same language; the only options never do. Default: manual captions first.

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

Use this to get the segments array: each caption line with its start time and duration in seconds. Turn it off when you only need the full plain text. Default: on.

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

Use this to also get the transcript as SubRip (.srt) subtitle text in the srt field, ready to save as a file. Default: off.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "language": "en",
  "captionSource": "manualFirst",
  "includeTimestamps": true,
  "includeSrt": false
}
```

# Actor output Schema

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

Dataset of transcripts: video ID and link, caption language and source, timed segments and full text.

## `summary` (type: `string`):

OUTPUT record: status, counts, and per-video outcome with the reason when no transcript was delivered.

# 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"
    ],
    "language": "en"
};

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

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

```

## MCP server setup

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

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/p9MFacGHIdlA1se0h/builds/CjVQLfN08OgY2DhQ1/openapi.json
