# YouTube Transcript Scraper (`xanthic_polygon/youtube-transcript-scraper`) Actor

YouTube Transcript Scraper turns YouTube video URLs into transcripts with timestamps, taken from the captions YouTube publishes. One row per video: full text, timestamped segments and available languages. Pay per transcript: videos without captions are never charged.

- **URL**: https://apify.com/xanthic_polygon/youtube-transcript-scraper.md
- **Developed by:** [Fuat Sezer](https://apify.com/xanthic_polygon) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

Learn more: https://docs.apify.com/actors/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** turns a list of YouTube video URLs into transcripts with timestamps, for teams that feed video content into AI pipelines, search indexes, research or content workflows. Paste the URLs, press Start, and download one transcript per video as JSON, CSV or a spreadsheet file. No API key, no login, no browser extension.

### What can YouTube Transcript Scraper do?

- 📝 Return the full transcript of a YouTube video as one text, plus every segment with its start time and duration in seconds.
- 🌍 Tell you which caption languages a video has, and return the one you ask for.
- 🏷️ Mark each transcript as written by hand or auto-generated by YouTube, so you know how much to trust the wording.
- 📦 Process many videos in one run. Watch links, short links, Shorts, embeds and live links of the same video are recognised and processed once.
- 💸 Charge only for transcripts. A video without captions is reported with a clear error code and is never charged.
- 🔁 Run on a schedule, from the API or from an integration, with a predictable cost per run.

### What is YouTube Transcript Scraper used for?

- **AI and search pipelines.** Load video transcripts into embeddings, summaries or a retrieval index without writing a scraper. The timestamps let you link every answer back to the exact moment in the video.
- **Content repurposing.** Turn talks, podcasts and tutorials into articles, newsletters, show notes or social posts.
- **Research and monitoring.** Collect what was said in a set of videos, search it for brands, topics or quotes, and repeat the run on a schedule for new videos.
- **Subtitles and accessibility checks.** See which languages a video is captioned in and whether the captions were written by hand.

### How to use YouTube Transcript Scraper

1. Open YouTube Transcript Scraper in Apify Console and go to the Input tab.
2. Paste your links into **YouTube video URLs**, one per line.
3. Optionally set **Transcript language** (for example `en` or `es`) and **Maximum videos per run**.
4. Press **Start**. A run with a few videos finishes in seconds.
5. Open the Output tab and export the transcripts as JSON, CSV, a spreadsheet file or HTML.

### Input example

```json
{
    "videoUrls": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw",
        "https://www.youtube.com/watch?v=CvFH_6DNRCY"
    ],
    "maxItems": 10
}
```

### Output example

Each video with captions becomes one row in the dataset:

```json
{
    "videoId": "jNQXAC9IVRw",
    "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "title": "Me at the zoo",
    "language": "en",
    "isAutoGenerated": false,
    "availableLanguages": [
        { "languageCode": "en", "isAutoGenerated": false },
        { "languageCode": "de", "isAutoGenerated": false }
    ],
    "text": "All right, so here we are, in front of the elephants the cool thing about these guys is that they have really... really really long trunks and that's cool (baaaaaaaaaaahhh!!) and that's pretty much all there is to say",
    "segments": [
        { "start": 1.2, "duration": 2.16, "text": "All right, so here we are, in front of the elephants" },
        { "start": 5.318, "duration": 2.656, "text": "the cool thing about these guys is that they have really..." },
        { "start": 7.974, "duration": 4.642, "text": "really really long trunks" },
        { "start": 12.616, "duration": 1.751, "text": "and that's cool" },
        { "start": 14.421, "duration": 1.312, "text": "(baaaaaaaaaaahhh!!)" },
        { "start": 16.881, "duration": 2, "text": "and that's pretty much all there is to say" }
    ]
}
```

A video without a transcript gets its own row with an error instead. These rows are free:

```json
{
    "input": "https://www.youtube.com/watch?v=CvFH_6DNRCY",
    "error": {
        "code": "NO_DATA",
        "message": "This video has no captions, so there is no transcript to return. You were not charged."
    }
}
```

### How much does YouTube Transcript Scraper cost?

YouTube Transcript Scraper uses pay-per-event pricing. You pay for transcripts, not for compute time.

| Event | When it is charged | Price |
| --- | --- | --- |
| Result | Once for every transcript that was saved to the dataset | $0.006 |
| Actor start | Once per run | $0.00005 |

- **1,000 transcripts cost $6**, plus $0.00005 for each run.
- Bronze, Silver and Gold plans get a lower price per transcript: $5, $4.50 and $4 per 1,000 transcripts.
- **You are not charged for failed videos**: videos without captions, private or removed videos, invalid URLs, empty responses and timeouts are all free.
- Set **Maximum cost per run** in the run options to cap your spending. YouTube Transcript Scraper stops cleanly when the limit is reached and does not start work it cannot deliver.

#### Is YouTube Transcript Scraper free to try?

Yes. On the Apify Free plan you can run YouTube Transcript Scraper with your monthly platform credit. **Runs on the Free plan process up to 50 videos per run**; start another run for the next 50. Paid plans are limited only by **Maximum videos per run**.

### Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `videoUrls` | array of strings | yes | YouTube video URLs, one transcript per video. Accepted links: `youtube.com/watch?v=`, `youtu.be/`, `/shorts/`, `/embed/` and `/live/`. Different links to the same video are processed once. |
| `language` | string | no | Language code such as `en`, `es` or `pt-BR`. The transcript is returned in this language only. Empty: the language spoken in the video. |
| `maxItems` | integer | no | Maximum videos per run, in the order given. Default 10, maximum 1000. |

### Output fields

| Field | Description |
| --- | --- |
| `videoId` | YouTube video ID. |
| `url` | YouTube video URL in its standard form. |
| `title` | Title of the video, or `null` when YouTube did not return one. |
| `language` | Language code of the transcript. |
| `isAutoGenerated` | `true` when YouTube generated the captions automatically, `false` when they were written by hand. |
| `availableLanguages` | Caption languages the video has, each with `languageCode` and `isAutoGenerated`. |
| `text` | The whole transcript as one text. |
| `segments` | The transcript in parts, each with `start` and `duration` in seconds and its `text`. |
| `input` | The YouTube video URL as given in the input. Only on failed videos. |
| `error` | Error `code` and `message`. Only on failed videos. |

#### Error codes

| Code | Meaning |
| --- | --- |
| `INPUT_INVALID` | The value is not a YouTube video URL. |
| `NOT_FOUND` | The video does not exist or was removed. |
| `NO_DATA` | The video exists but has no transcript to return: no captions, no captions in the requested language, or a private, age-restricted, members-only or still-live video. The message says which. |
| `UPSTREAM_EMPTY` | YouTube listed captions but returned an empty caption file, even after retries. |
| `UPSTREAM_ERROR` | YouTube refused the request, even after retries. |
| `RATE_LIMITED` | Too many requests right now. Try again later. |
| `TIMEOUT` | No response in time, even after retries. |

### Limits and honest notes

- YouTube Transcript Scraper returns the captions that YouTube publishes for a video, written by hand or auto-generated. It does not do speech-to-text and it does not translate. A video without captions produces a free `NO_DATA` row, not an invented transcript.
- With **Transcript language** set, you get that language or nothing. If the video is not captioned in it, the free `NO_DATA` row lists `availableLanguages`, so you can run those videos again with a language they have.
- With **Transcript language** empty, you get the language spoken in the video, not a dubbed or translated version. When YouTube gives no hint about the spoken language (one audio track and no auto-generated captions), you get English captions if the video has them, otherwise the first language listed.
- Auto-generated captions come without punctuation and can contain recognition mistakes. Check `isAutoGenerated` before you quote them.
- Private, age-restricted and members-only videos, and live streams that are still running, cannot be read.
- Temporary failures are retried up to two times before a video is reported as failed. One video gets at most 60 seconds, retries included.
- **Run status.** A run succeeds when it saved at least one transcript. It also succeeds when it saved none but your videos got an answer: a video that does not exist (`NOT_FOUND`), has no transcript to return (`NO_DATA`) or is not a valid URL (`INPUT_INVALID`) is an answer, not a failure of the run. The status message then says what happened, for example `0 transcripts saved. 3 inputs had no transcript to return or were not found`. A run is marked as failed only when it saved no transcript and every failure came from the network or from YouTube refusing the requests (`TIMEOUT`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `UPSTREAM_EMPTY`). The log lists the failures by error code.

### Use YouTube Transcript Scraper with the API, schedules and integrations

YouTube Transcript Scraper runs on the Apify platform, so you get the platform features with it:

- **API.** Start runs and fetch transcripts with the [Apify API](https://docs.apify.com/api/v2) from Python, JavaScript or any HTTP client.
- **Schedules.** Run YouTube Transcript Scraper every hour, day or week from Apify Console.
- **Integrations.** Send transcripts to spreadsheets, chat tools and automation workflows with Apify integrations, or call a webhook when a run finishes.
- **AI agents.** Use YouTube Transcript Scraper as a tool through the Apify MCP server.

### FAQ

#### Do I need an API key or an account on another service?

No. YouTube Transcript Scraper needs nothing but your YouTube video URLs.

#### Why did a video fail?

Open the **Failed videos** view of the dataset. Every failed video has an error code and a short message, and none of them is charged. The most common reason is `NO_DATA`: the video simply has no captions.

#### Which language do I get when I leave the language empty?

The language spoken in the video. Captions written by hand in that language are preferred over auto-generated ones. Dubbed audio tracks, including YouTube's automatic dubbing, and translated captions are not used unless you ask for their language.

#### Does it work for YouTube Shorts and live streams?

Shorts work like any other video. A live stream works once it has ended and YouTube has published captions for the recording.

#### Can I get transcripts for thousands of videos?

Yes. Raise **Maximum videos per run** up to 1000 and split larger lists across several runs or a schedule.

#### Something is wrong. How do I report it?

Open the **Issues** tab of YouTube Transcript Scraper and describe the run. Include the run ID and the video URL that failed. Issues are answered within a few days.

# Actor input Schema

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

YouTube video URLs, one per line. YouTube Transcript Scraper returns one transcript per video. Accepted links: youtube.com/watch?v=, youtu.be/, /shorts/, /embed/ and /live/. Different links to the same video are processed once.

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

Optional language code such as en, es or pt-BR. The transcript is returned in this language only: a video that has no captions in it gets a free NO_DATA row that lists the languages it does have. Leave empty to get the language spoken in the video.

## `maxItems` (type: `integer`):

YouTube Transcript Scraper processes at most this many YouTube video URLs in one run, in the order given. Use it to keep the cost of a run predictable. Runs on the Apify Free plan process up to 50 videos.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "maxItems": 10
}
```

# Actor output Schema

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

Every row of the run. A transcript row has videoId, url, title, language, isAutoGenerated, availableLanguages, text and the timestamped segments. A failed video has input and error instead.

# 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("xanthic_polygon/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("xanthic_polygon/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 xanthic_polygon/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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