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

Get YouTube video transcripts with timestamps plus video and channel metadata, for single videos, lists of videos, or a whole channel within a date range. No API key needed. You only pay for videos that return a transcript.

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

## Pricing

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

Get the full transcript of any YouTube video, with a timestamp on every line, plus the video's and channel's details. Works on single videos, lists of videos, or a whole channel within a date range. No YouTube API key, no Google account, no setup.

**You only pay for videos that return a transcript.** Videos without captions, private or removed videos, and bad URLs still appear in your results so you know what happened, but they are free.

#### What you get for each video

- **Transcript** as timed segments (`text`, `start`, `end` in seconds), and optionally as one plain-text block
- **Caption details**: which language you got, whether it is auto-generated, and every language the video offers
- **Video details**: title, description, publish date and time (UTC), duration, views, likes, comment count, thumbnail
- **Channel details**: name, ID, handle, subscriber count, channel picture

#### How to use it

1. Paste a video URL into **Video URL**, or several into **Video URLs (bulk)**. Watch links, `youtu.be` links, Shorts, live and embed links, and bare video IDs all work.
2. Or paste a channel into **Channel URL** (`https://www.youtube.com/@handle`, `/channel/UC…`, `/c/…` or `/user/…`), and set **Max videos** and a **Start date** / **End date**. Without dates you get the last 30 days.
3. Optionally set **Transcript language** (for example `en`, `es`, `de`).
4. Click **Start**. Results appear in the **Output** tab and can be downloaded as JSON, CSV, Excel or HTML.

##### Example input

```json
{
    "youtube_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "language": "en",
    "include_transcript_text": true
}
```

```json
{
    "channel_url": "https://www.youtube.com/@taostats",
    "max_videos": 20,
    "start_date": "2026-01-01",
    "end_date": "2026-06-30"
}
```

#### How the language is chosen

- With a language set: manual captions in that language first, then auto-generated captions in it.
- If the video has no captions in that language, the row has `error_code` `language_unavailable`. Another language is never substituted, and captions are never machine-translated.
- With no language set: the track YouTube shows by default.

#### Example output

```json
{
    "video_id": "sGYS42SjRkg",
    "url": "https://www.youtube.com/watch?v=sGYS42SjRkg",
    "title": "This Bitcoin developer is on a power trip",
    "channel_name": "CoinDesk",
    "channel_id": "UC7TghOL755nBk7HelHoi9LQ",
    "channel_username": "CoinDesk",
    "channel_thumbnail": "https://yt3.ggpht.com/…=s800-c-k-c0x00ffffff-no-rj",
    "subscriber_count": 196000,
    "timestamp": 1759059043,
    "published_at": "2025-09-28T11:30:43Z",
    "view_count": 921,
    "like_count": 17,
    "comment_count": null,
    "duration_seconds": 86,
    "description": "Catch the latest episode of 'BITCOIN SEASON 2' …",
    "thumbnail": "https://i.ytimg.com/vi/sGYS42SjRkg/maxresdefault.jpg",
    "language": "en",
    "selected_language": "English (auto-generated)",
    "available_languages": ["English (auto-generated)"],
    "is_auto_generated": true,
    "geo_restrict": null,
    "transcript": [
        { "text": "Then the last one which is kind of the", "start": 0.56, "end": 2.639 },
        { "text": "one that I kind of but my head against", "start": 2.639, "end": 4.64 }
    ],
    "transcript_text": "Then the last one which is kind of the one that I kind of but my head against …",
    "status": "success",
    "error_code": null,
    "message": "Successfully fetched the transcript for the video with ID 'sGYS42SjRkg'"
}
```

When a video has no transcript, the row has `"status": "error"`, an `error_code`, and a readable `message`. The codes are:

| `error_code` | Meaning |
|---|---|
| `transcripts_disabled` | The video has no captions at all. Video details are still filled in. |
| `transcript_unavailable` | A caption track is listed but YouTube returned it empty. |
| `language_unavailable` | Captions exist, but not in the requested language. |
| `video_unavailable`, `private_video`, `members_only`, `age_restricted`, `login_required`, `live_stream_offline` | The video can't be watched without an account, or doesn't exist. |
| `invalid_url`, `channel_not_found` | The input couldn't be matched to a video or channel. |
| `blocked`, `rate_limited`, `timeout`, `network_error`, `server_error`, `http_error`, `unexpected_response` | YouTube refused or failed on every retry. Running again usually works. |

#### Notes on the numbers

- **Subscriber count** is what YouTube displays, so it is rounded (for example 196K becomes 196000).
- **Comment count** is exact when YouTube provides it. Otherwise it comes from the comments panel, which is exact below 1,000 and rounded above (2.4M becomes 2400000). It is `null` when YouTube shows no count.
- **Like count** is `null` when the uploader hides likes.
- **`geo_restrict`** is always `null`; the field is kept so that existing integrations don't break.

#### Channel mode

Channel mode reads the channel's **Videos** tab (long-form uploads; Shorts and live streams are not included), newest first, and stops when it reaches `max_videos` or videos older than the start date.

#### Proxies

YouTube blocks most cloud IP addresses, so the default proxy setting is Apify **Residential**. Each video uses roughly 100 KB of proxy traffic. You can switch to another proxy group or your own proxies under **Advanced**, but datacenter proxies are usually blocked.

#### Using it from code

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('adaptable_wheelhouse/youtube-transcript-scraper').call({
    youtube_urls: ['https://www.youtube.com/watch?v=dQw4w9WgXcQ'],
    include_transcript_text: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

#### Is it legal to scrape YouTube transcripts?

This actor reads only public data that anyone can see on youtube.com without logging in. Results may still contain personal data, which is protected by laws such as GDPR. Only collect personal data if you have a legitimate reason, and check with a lawyer if you are unsure.

# Actor input Schema

## `youtube_url` (type: `string`):

A single YouTube video URL. Accepts watch, youtu.be, shorts, live and embed links, or a bare 11-character video ID.

## `youtube_urls` (type: `array`):

Several video URLs or IDs. Combined with 'Video URL'; duplicates are fetched once.

## `channel_url` (type: `string`):

A channel URL (https://www.youtube.com/@handle, /channel/UC…, /c/name or /user/name). Fetches the channel's newest long-form videos published between the start and end date.

## `max_videos` (type: `integer`):

Maximum number of channel videos to fetch. Only used with 'Channel URL'.

## `start_date` (type: `string`):

Only channel videos published on or after this date (YYYY-MM-DD). Defaults to 30 days before the end date. Only used with 'Channel URL'.

## `end_date` (type: `string`):

Only channel videos published on or before this date (YYYY-MM-DD, inclusive). Defaults to today. Only used with 'Channel URL'.

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

ISO 639-1 code such as 'en' or 'fr'. Manual captions in that language are preferred, then auto-generated ones. Captions are never machine-translated: if the language is missing, the video's default track is returned and 'message' says so. Leave empty for the video's default language.

## `include_transcript_text` (type: `boolean`):

Also return the whole transcript as one string in 'transcript_text'.

## `max_concurrency` (type: `integer`):

How many videos to fetch in parallel.

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

YouTube blocks most datacenter IPs. Residential proxies are strongly recommended.

## Actor input object example

```json
{
  "youtube_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "max_videos": 10,
  "include_transcript_text": false,
  "max_concurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All videos with their transcripts and metadata.

# 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 = {
    "youtube_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("adaptable_wheelhouse/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 = {
    "youtube_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("adaptable_wheelhouse/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 '{
  "youtube_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call adaptable_wheelhouse/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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