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

Transcripts of YouTube videos, Shorts, whole channels and playlists, with timestamps. AI transcription when a video has no captions. Failed videos are free.

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

## Pricing

Pay per event

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

Get the transcript of any public YouTube video or Short, or of a whole channel or playlist, as plain text and as timestamped segments. When a video has no captions, this actor can transcribe its audio with AI, so you are not stuck with "no transcript available". Use it to summarize videos, research a niche, repurpose content, build datasets or feed an AI pipeline.

### What you get

- **Video links in, transcripts out.** Paste video or Shorts links, or 11-character video ids, and get each video's full text.
- **Whole channels.** Add a channel (`@handle`, link or `UC…` id) and pick the tab (videos, Shorts or live streams) and the order (newest, most popular or oldest). The actor transcribes up to the number of videos you set.
- **Playlists.** Add a playlist link or `PL…` id to transcribe its videos.
- **AI transcription when there are no captions.** Or choose **Captions only** to skip those videos and never pay for AI transcription.
- **Long videos are fine.** Multi-hour podcasts and streams come back whole.
- **Timestamps.** Each line comes with its start time and length, or turn them off and keep just the text.
- **Failed videos are free.** Private, deleted or members-only videos come back as a row that says why, at no charge.

### Input

| Field | What it is |
| --- | --- |
| `videoUrls` | YouTube video or Shorts links, or video ids. |
| `channels` | Channels, as `@handle`, channel link or `UC…` id. |
| `channelTab` | `videos` (default), `shorts` or `live`. |
| `channelSort` | `newest` (default), `popular` or `oldest`. |
| `playlists` | Playlist links or `PL…` ids. |
| `maxVideosPerSource` | How many videos to transcribe from each channel or playlist (default 10). |
| `transcriptSource` | `auto` (captions, else AI transcription), `captions` (captions only), or `audio` (always AI). |
| `includeTimestamps` | Adds timestamped `segments` next to the full `text` (default on). |

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
  "channels": ["@veritasium"],
  "channelTab": "videos",
  "channelSort": "newest",
  "maxVideosPerSource": 10,
  "transcriptSource": "auto",
  "includeTimestamps": true
}
```

### Output

One row per video. A real row, shortened:

```json
{
  "inputUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "platform": "youtube",
  "videoId": "jNQXAC9IVRw",
  "title": "Me at the zoo",
  "author": "jawed",
  "publishedAt": null,
  "plays": null,
  "durationSeconds": 19,
  "language": "en",
  "transcriptSource": "captions",
  "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 …",
  "segments": [
    { "start": 1.2, "duration": 2.16, "text": "All right, so here we are, in front of the\nelephants" },
    { "start": 5.318, "duration": 2.656, "text": "the cool thing about these guys is that they\nhave really..." }
  ],
  "status": "ok"
}
```

Videos that came from a channel or playlist also carry their view count in `plays`, and `publishedAt` when YouTube's listing shows a date (approximate for older videos, since YouTube only says "2 years ago"). A video that could not be transcribed has `"status": "failed"` with an `errorCode` (for example `private`, `members_only` or `no_captions`) and an `errorMessage`, and costs nothing. Export the dataset as JSON, CSV or Excel, or read it through the Apify API.

### Pricing

Pay per event, only for transcripts you receive:

- **Transcript**: one per video whose transcript came from its captions. Most YouTube videos have captions, so this is what you will mostly pay.
- **AI transcription**: one per started 5 minutes of audio, only for videos without captions (or every video, if you choose "Always AI transcription"). A 20-minute video is four.

Failures, channel and playlist listings, and links that are not YouTube videos are never charged. Set a maximum charge for a run in its options and the actor stops before going over it.

### Other platforms

- [TikTok Transcript Scraper](https://apify.com/transcriptfetch/tiktok-transcript-scraper): videos and whole profiles.
- [Instagram Transcript Scraper](https://apify.com/transcriptfetch/instagram-transcript-scraper): Reels and profiles.

### Using it from code or an AI assistant

This actor runs on [TranscriptFetch](https://transcriptfetch.com), a transcript API for YouTube, TikTok and Instagram. If you would rather call it directly, TranscriptFetch has a REST API, an MCP server for Claude and ChatGPT, and a no-code dashboard: see [transcriptfetch.com/docs](https://transcriptfetch.com/docs).

### FAQ

**Which languages are supported?** Captions come in the language of the caption track YouTube serves for the video. AI transcription detects the spoken language by itself.

**How long does it take?** Caption transcripts take a few seconds each, and the actor works on several videos at once. AI transcription of a long video takes a few minutes.

**Do I need a YouTube API key or account?** No. The actor reads only public videos and needs nothing from you.

**Is scraping YouTube transcripts legal?** The actor reads only public videos. How you use the transcripts is up to you: respect copyright and the creators' rights, and check with a lawyer if you are unsure about your use.

**Something went wrong?** Open an issue on this actor's Issues tab and include the run's link.

# Actor input Schema

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

YouTube video or Shorts links (youtube.com/watch?v=…, youtu.be/…, /shorts/…) or 11-character video ids.

## `channels` (type: `array`):

YouTube channels as @handles, channel links or UC… ids. Each channel's videos are transcribed, up to the limit below.

## `channelTab` (type: `string`):

Which tab of each channel to read.

## `channelSort` (type: `string`):

Which videos of each channel come first.

## `playlists` (type: `array`):

Playlist links or PL… ids. Each playlist's videos are transcribed, up to the limit below.

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

How many videos to transcribe from each channel or playlist.

## `transcriptSource` (type: `string`):

Most YouTube videos have captions, which are the cheapest. When one has none, the default transcribes its audio with AI. 'Captions only' skips those videos and never charges for AI transcription.

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

Adds `segments` (start, duration and text of each line) next to the full `text`.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "channelTab": "videos",
  "channelSort": "newest",
  "maxVideosPerSource": 10,
  "transcriptSource": "auto",
  "includeTimestamps": true
}
```

# Actor output Schema

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

One row per YouTube video: url, title, author, publishedAt, durationSeconds, language, transcriptSource (captions or ai_transcription), text, segments (start, duration, text) and status; failed rows carry errorCode and errorMessage.

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

```

## MCP server setup

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