# YouTube Transcript Scraper: Subtitles, Channels, Search (`zhtech/youtube-transcript-scraper`) Actor

Extract YouTube transcripts and subtitles in bulk from videos, Shorts, playlists, channels and search. Timestamped segments, plain text, SRT and VTT, auto-generated flag, all caption languages, plus title, channel, publish date, views and duration. Only successful transcripts are charged.

- **URL**: https://apify.com/zhtech/youtube-transcript-scraper.md
- **Developed by:** [ZH Tech](https://apify.com/zhtech) (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 $1.10 / 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 Scraper: Subtitles, Channels, Search

Extract **YouTube transcripts, subtitles and captions in bulk**: single videos, Shorts, whole playlists, entire channels and YouTube search results, in one run. Every row comes with timestamped segments, clean plain text, optional SRT and VTT subtitle files, the caption language, whether it is auto-generated, every caption language the video offers, and full video metadata including the **exact publish date**, duration, views and likes.

You only pay for transcripts that were actually delivered. Videos without captions, private or deleted videos and anything else that fails come back as free rows with a clear error code, so you always know why.

Built and maintained by **ZH Tech**.

### What can this YouTube Transcript Scraper do?

- **Every kind of input in one field**: watch links, youtu.be links, Shorts, live and embed links, bare video IDs, playlists, channels (`@handle`, `/channel/UC...`, `/c/`, `/user/`, or a channel tab such as `/@name/shorts`) and YouTube search URLs. Add plain search queries in a separate field. Duplicates are removed.
- **Channels and playlists**: set how many videos to take per source, choose regular videos, Shorts and past live streams, and filter by **publish date** (absolute dates or relative periods like "30 days"). Channel listings stop early once older videos are reached, so you never pay for videos outside your range.
- **YouTube search**: get transcripts for the top results of any query, sorted by relevance or popularity (view count).
- **Auto-generated and human captions**: prefer human-written captions, require them, or always use YouTube's speech recognition track.
- **Smart language handling**: list languages in order of preference (`en`, `es`, `pt-BR`). Base codes match regional tracks (`pt` matches `pt-BR`). If none exists, the actor falls back to the language the video was actually spoken in, detected from YouTube's audio track data, so you do not get an auto-dubbed Arabic transcript for an English video.
- **Every caption track listed**: each row includes `availableLanguages`, so you can see what else a video offers.
- **Many formats**: timestamped segments, plain text, timestamped paragraphs for LLM citations, SRT, WebVTT, and optional **word-level timestamps**.
- **Clean text option**: strip `[Music]`, `[Applause]` and music notes.
- **Scheduled monitoring**: "Only new videos" remembers what was already transcribed, so a daily schedule on a channel returns only fresh uploads.
- **Built to avoid blocking**: Apify Proxy with session rotation, retries, and automatic escalation from datacenter to residential IPs only for the requests YouTube blocks. Several extraction methods are tried before a video is given up on, and "no captions" is double checked from a second IP before it is reported.
- **Fast**: a few videos per second with default settings, hundreds of videos in a couple of minutes.
- **Never crashes on a bad video**: each problem becomes a free row with an `errorCode`.

### Use cases

- **AI, RAG and LLM pipelines**: feed transcripts into a vector database, chatbot knowledge base or fine-tuning dataset. The `timestampedText` format keeps `[m:ss]` markers so an LLM can cite the exact moment in a video.
- **Content repurposing**: turn videos into blog posts, newsletters, social threads, show notes and quote cards.
- **Research and analysis**: study what creators, experts or competitors say across hundreds of videos. Filter a channel by date and compare topics over time.
- **SEO and marketing**: find the keywords and questions the top videos in your niche talk about.
- **Accessibility and localization**: download SRT or VTT subtitles to edit, translate or re-upload.
- **Monitoring**: schedule a daily run on a list of channels with "Only new videos" and push new transcripts to Slack, Google Sheets, Notion or your own API.

### How to use it

1. Click **Try for free**.
2. Paste YouTube URLs (videos, Shorts, playlists or channels) into **YouTube URLs or IDs**, and/or add **Search queries**.
3. Optionally set **Max videos per channel, playlist or search**, a **Published after** date and your **Preferred transcript languages**.
4. Click **Start**. Results appear in the **Output** tab within seconds. Download them as JSON, CSV, Excel, XML or HTML, or fetch them via the API.

### Input examples

Transcripts of a few videos:

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://youtu.be/dQw4w9WgXcQ",
    "https://www.youtube.com/shorts/V_uq3v6xK-4"
  ]
}
```

The last 30 days of a channel, regular videos only, as plain text and SRT:

```json
{
  "urls": ["https://www.youtube.com/@3blue1brown"],
  "channelContentTypes": ["videos"],
  "publishedAfter": "30 days",
  "maxVideosPerSource": 50,
  "outputFormats": ["text", "srt"]
}
```

Top 20 search results in Spanish, falling back to the original language when Spanish is missing:

```json
{
  "searchQueries": ["receta de pan casero"],
  "maxVideosPerSource": 20,
  "languages": ["es"],
  "fallbackToAnyLanguage": true
}
```

Daily channel monitoring (schedule this input; each run returns only new uploads):

```json
{
  "urls": ["https://www.youtube.com/@veritasium", "https://www.youtube.com/@mkbhd"],
  "maxVideosPerSource": 10,
  "onlyNewVideos": true,
  "stateKey": "tech-channels"
}
```

#### All input options

| Field | Description | Default |
|---|---|---|
| `urls` | Videos, Shorts, playlists, channels, search URLs or bare IDs | |
| `searchQueries` | YouTube search queries | |
| `maxVideosPerSource` | Videos per channel, playlist or search (0 = no limit) | 20 |
| `maxTranscripts` | Stop after this many successful transcripts (0 = no limit) | 0 |
| `channelContentTypes` | `videos`, `shorts`, `streams` | all three |
| `publishedAfter` / `publishedBefore` | Date (`2026-01-31`) or relative (`30 days`). Applies to channels, playlists and searches | |
| `searchSort` | `relevance` or `views` (popularity). YouTube no longer sorts searches by upload date or rating: old inputs with `date` run as `relevance`, `rating` as `views`, with a log note. For recent videos use `publishedAfter` | `relevance` |
| `languages` | Preferred caption languages in order | `["en"]` |
| `fallbackToAnyLanguage` | Return the original spoken language when none of yours exist | `true` |
| `captionType` | `any` (prefer human), `manual`, `auto` | `any` |
| `translateTo` | Ask YouTube for a machine translation (best effort, see limitations) | |
| `outputFormats` | `segments`, `text`, `timestampedText`, `srt`, `vtt` | `segments`, `text` |
| `includeWordTimestamps` | Per-word start times inside segments | `false` |
| `removeSoundTags` | Remove `[Music]`, `[Applause]` and similar | `false` |
| `includeDescription` | Add description and tags | `false` |
| `includeErrorItems` | Add free rows for videos without a transcript | `true` |
| `onlyNewVideos` / `stateKey` | Skip videos transcribed in earlier runs | `false` / `default` |
| `proxyConfiguration` | Apify Proxy or your own proxies | Apify Proxy |
| `residentialFallback` | Retry blocked requests through residential IPs | `true` |
| `maxConcurrency` | Videos processed in parallel | 10 |
| `maxRetries` | Retries per blocked request | 5 |

### Output example

```json
{
  "videoId": "aircAruvnKk",
  "url": "https://www.youtube.com/watch?v=aircAruvnKk",
  "status": "success",
  "errorCode": null,
  "title": "But what is a neural network? | Deep learning chapter 1",
  "channelName": "3Blue1Brown",
  "channelId": "UCYO_jab_esuFRV4b17AJtAw",
  "channelHandle": "@3blue1brown",
  "channelUrl": "https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw",
  "publishedAt": "2017-10-05T08:11:25-07:00",
  "durationSeconds": 1120,
  "duration": "18:40",
  "viewCount": 25275345,
  "likeCount": 570600,
  "category": "Education",
  "isShort": false,
  "isLiveContent": false,
  "isFamilySafe": true,
  "thumbnailUrl": "https://i.ytimg.com/vi/aircAruvnKk/hqdefault.jpg",
  "videoLanguage": null,
  "language": "en",
  "languageName": "English",
  "isAutoGenerated": false,
  "isLanguageFallback": false,
  "isFromAutoDub": false,
  "isTranslated": false,
  "translatedFrom": null,
  "translationStatus": null,
  "availableLanguages": [
    { "code": "en", "name": "English", "isAutoGenerated": false, "isTranslatable": true },
    { "code": "en", "name": "English (auto-generated)", "isAutoGenerated": true, "isTranslatable": true },
    { "code": "es", "name": "Spanish", "isAutoGenerated": false, "isTranslatable": true }
  ],
  "segmentCount": 286,
  "wordCount": 3357,
  "text": "This is a 3. It's sloppily written and rendered at an extremely low resolution of 28x28 pixels, but your brain has no trouble recognizing it as a 3. ...",
  "segments": [
    { "start": 4.22, "end": 5.4, "duration": 1.18, "text": "This is a 3." },
    { "start": 6.06, "end": 10.713, "duration": 4.653, "text": "It's sloppily written and rendered at an extremely low resolution of 28x28 pixels," }
  ],
  "extractionMethod": "innertube-android",
  "input": "https://www.youtube.com/watch?v=aircAruvnKk",
  "source": "video:aircAruvnKk",
  "scrapedAt": "2026-11-16T02:37:12+00:00"
}
```

`videoLanguage` is the original spoken language when YouTube reports it (videos with several audio tracks), otherwise `null`. `isFromAutoDub` is `true` when the transcript comes from one of YouTube's AI-dubbed audio tracks rather than the original audio.

A video without a transcript (free row):

```json
{
  "videoId": "8plwv25NYRo",
  "url": "https://www.youtube.com/watch?v=8plwv25NYRo",
  "status": "error",
  "errorCode": "NO_CAPTIONS",
  "errorMessage": "This video has no captions or auto-generated transcript on YouTube. Not charged.",
  "title": "10 Hours of Rain Sound Relaxation / Ultimate Stress Relief",
  "availableLanguages": []
}
```

#### Error codes

| Code | Meaning |
|---|---|
| `NO_CAPTIONS` | The video has no captions and no auto-generated transcript (common for music, ambient videos, very new uploads and many Shorts) |
| `LANGUAGE_NOT_AVAILABLE` | Captions exist but not in your languages, and fallback is off. See `availableLanguages` |
| `VIDEO_UNAVAILABLE` | Deleted, removed or never existed |
| `PRIVATE_VIDEO` | Private video |
| `AGE_RESTRICTED` | Requires a signed-in adult account. This actor never logs in |
| `MEMBERS_ONLY` | Channel membership content |
| `LIVE_NOT_FINISHED` | Live stream in progress, upcoming premiere, or a stream without a recording |
| `GEO_BLOCKED` | Not available in the proxy's country. Choose a proxy country where it is available |
| `BLOCKED` | YouTube kept blocking even after rotating IPs. Rare. Run again or use the RESIDENTIAL proxy group |
| `FETCH_FAILED` | Unexpected download error |
| `LISTING_FAILED`, `CHANNEL_NOT_FOUND` | A channel, playlist or search could not be listed |
| `INVALID_INPUT` | The input is not a YouTube URL or ID |

Each run also saves a `RUN_SUMMARY` record in its key-value store with counts per error code, time taken and proxy statistics.

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

This actor uses **pay per event** pricing:

- **Transcript**: charged once per video for which a transcript is returned (`status: "success"`). Rows with an error code are free.
- **Actor start**: a tiny fixed fee per run.

The exact prices are on the **Pricing** tab. Platform usage (compute and proxy) is included, so the price you see is the price you pay. You can cap your spend with the "Maximum cost per run" setting: the actor checks the remaining budget before each transcript and stops cleanly instead of overspending.

Tips to keep costs low:

- Use `maxVideosPerSource` and `publishedAfter` for channels. Old videos are skipped during listing and never charged.
- Use `onlyNewVideos` for scheduled runs so you never pay twice for the same video.
- Put many videos into one run instead of starting one run per video, to save the start fee.

### Use with the API, integrations, LLMs and MCP

#### API

Run the actor and get the results in one request (replace `YOUR_TOKEN`):

```bash
curl -X POST "https://api.apify.com/v2/acts/zhtech~youtube-transcript-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://www.youtube.com/watch?v=aircAruvnKk"], "outputFormats": ["text"]}'
```

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("zhtech/youtube-transcript-scraper").call(run_input={
    "urls": ["https://www.youtube.com/@3blue1brown"],
    "maxVideosPerSource": 10,
    "outputFormats": ["text"],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item["status"] == "success":
        print(item["title"], len(item["text"]))
```

JavaScript:

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

const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('zhtech/youtube-transcript-scraper').call({
    urls: ['https://youtu.be/dQw4w9WgXcQ'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].text);
```

#### Integrations

Connect the actor to Make, Zapier, n8n, Google Sheets, Slack, Airtable, Google Drive, webhooks and more from the **Integrations** tab. A typical flow: schedule a daily run with `onlyNewVideos`, then send each new transcript to an LLM step that writes a summary into Notion or Slack.

#### Using it with LLMs and AI agents (MCP)

The actor works as a tool for AI agents through the Apify MCP server (mcp.apify.com). Add `zhtech/youtube-transcript-scraper` as a tool in Claude, Cursor, VS Code or any other MCP client, then ask things like "Summarize the last five videos of @veritasium" or "What does this video say about pricing?". For LLM prompts, request `outputFormats: ["timestampedText"]`: it is compact and keeps `[m:ss]` markers so the model can cite moments in the video.

For RAG, use the `segments` array to chunk by time (for example 60 second windows) and store `videoId`, `start` and `url` as metadata, so every answer can link to `https://www.youtube.com/watch?v=VIDEO_ID&t=START`.

### FAQ

**Does it work for videos with only auto-generated captions?**
Yes. Most YouTube videos only have auto-generated captions, and they are returned with `isAutoGenerated: true`. Set `captionType` to `manual` if you only want human-written captions.

**Can I get transcripts for an entire channel?**
Yes. Paste the channel URL and set `maxVideosPerSource` to 0 for no limit, or to the number of newest videos you want. Choose videos, Shorts and past live streams with `channelContentTypes`.

**Does it support YouTube Shorts?**
Yes, both single Shorts links and the Shorts tab of a channel. Rows include `isShort`. Note that many Shorts have no captions at all; those return a free `NO_CAPTIONS` row.

**Which languages are supported?**
Every language YouTube has captions for. Each row lists all available tracks in `availableLanguages`.

**What happens when a video has no transcript?**
You get a free row with `errorCode: "NO_CAPTIONS"`. Nothing is charged. This actor reads YouTube's own captions and does not run speech-to-text on the audio.

**Can it translate transcripts?**
If the video already has a track in your `translateTo` language, that track is used. Otherwise the actor asks YouTube for its automatic translation. At the time of writing YouTube refuses most automated translation requests, so treat this as best effort: you always get the original transcript, and `translationStatus` tells you what happened (`translated`, `refused_by_youtube` or `not_offered`).

**Why are some requests retried?**
YouTube limits requests from datacenter IPs. The actor rotates IPs and switches individual requests to residential IPs when needed. You do not need to configure anything.

**Can I scrape private, members-only or age-restricted videos?**
No. The actor never logs in to YouTube and only reads publicly available captions. Those videos return a free error row.

**Is it legal to scrape YouTube transcripts?**
The actor only collects publicly available data. Transcripts can be protected by copyright, so check how you plan to use them and respect YouTube's terms and the rights of creators. If you are unsure, consult a lawyer.

### Limitations

- Only captions that exist on YouTube are returned. There is no speech-to-text for videos without captions.
- YouTube machine translation (`translateTo`) is usually refused for automated clients. Native tracks in your language always work.
- Live streams can be transcribed only after they end and YouTube has processed the captions. Very recent uploads may not have auto captions yet; with `onlyNewVideos` they are retried on the next run.
- Age-restricted, private and members-only videos are not supported (no login).
- `publishedAfter` and `publishedBefore` apply to channels, playlists and searches. Videos you list explicitly are always processed.
- View and like counts are a snapshot at the time of the run.

### Support

Found a problem or need a feature? Open an issue on the **Issues** tab with the run ID and the video URL.

# Actor input Schema

## `urls` (type: `array`):

Paste any mix of YouTube links, one per line: videos (watch, youtu.be, embed, live), Shorts, playlists, channels (@handle, /channel/UC..., /c/, /user/, or a channel tab like /@handle/shorts) and search result URLs. Bare 11 character video IDs and @handles also work. Channels and playlists are expanded into their videos. Duplicates are removed automatically.

## `searchQueries` (type: `array`):

Search YouTube and get transcripts of the results. One query per line. Use "Max videos per channel, playlist or search" to control how many results per query.

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

How many videos to take from each channel, playlist or search query. Channels are read newest first. Set 0 for no limit. Single video URLs are not affected.

## `maxTranscripts` (type: `integer`):

Stop the run after this many successful transcripts across all inputs. 0 means no limit (the run still respects your maximum cost per run).

## `channelContentTypes` (type: `array`):

Which uploads to take from channel URLs: regular videos, Shorts and past live streams. A channel URL that already points at a tab (for example /@name/shorts) uses only that tab.

## `publishedAfter` (type: `string`):

Only videos published on or after this date. Use a date (2026-01-31) or a relative period such as "30 days". Channel listings stop early once older videos are reached, so you do not pay for them.

## `publishedBefore` (type: `string`):

Only videos published before this date. Same formats as "Published after".

## `searchSort` (type: `string`):

Sort order for search queries. These are the only two orders YouTube still applies. YouTube removed sorting by upload date and rating in 2025 (it silently ignores them): for recent videos use "Published after". Old saved inputs with "date" run in relevance order and "rating" runs as popularity, with a note in the log.

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

Language codes in order of preference, for example en, es, pt-BR. The first one the video has is used. A base code matches regional variants (en matches en-US and en-GB).

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

If none of your preferred languages exist, return the transcript in the language the video was spoken in (marked with isLanguageFallback). Turn off to return a free LANGUAGE_NOT_AVAILABLE row instead.

## `captionType` (type: `string`):

Any: human-written captions when available, otherwise YouTube's auto-generated transcript. Manual only: skip videos that only have auto captions. Auto-generated only: always use the speech recognition track.

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

Optional language code, for example es or de. If the video already has a track in this language it is used directly. Otherwise the actor asks YouTube for its machine translation. YouTube often refuses automated translation requests; in that case you still get the original transcript and translationStatus explains what happened.

## `outputFormats` (type: `array`):

Which transcript fields each row should contain. segments: timestamped list of {start, end, duration, text}. text: one plain string. timestampedText: paragraphs prefixed with \[m:ss], ideal for LLM citations. srt and vtt: ready subtitle files.

## `includeWordTimestamps` (type: `boolean`):

Add a words array with the start time of every word to each segment. Available for auto-generated captions; human-written captions give one entry per line.

## `removeSoundTags` (type: `boolean`):

Remove non-speech markers like \[Music], \[Applause] and music notes from the transcript.

## `includeDescription` (type: `boolean`):

Add the full video description and keywords to each row.

## `includeErrorItems` (type: `boolean`):

Add a free row with an errorCode (NO_CAPTIONS, PRIVATE_VIDEO, VIDEO_UNAVAILABLE and so on) for every video that has no transcript. These rows are never charged.

## `onlyNewVideos` (type: `boolean`):

Skip videos that were already transcribed successfully in earlier runs with the same state key. Perfect for daily channel monitoring: each run returns only fresh uploads. Videos that had no captions yet are retried next time.

## `stateKey` (type: `string`):

Name of the memory used by "Only new videos". Use a different key per schedule or task if you want them tracked separately.

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

YouTube blocks many datacenter IPs. The default Apify Proxy setting works for most runs, and the actor automatically switches to residential IPs only when YouTube blocks a request. You can also pick RESIDENTIAL directly or use your own proxies.

## `residentialFallback` (type: `boolean`):

When YouTube blocks the datacenter proxy, retry that request through Apify residential proxy. Recommended.

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

How many videos are processed at the same time.

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

How many times a blocked or failed request is retried with a new IP before the video is reported as BLOCKED.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://youtu.be/dQw4w9WgXcQ",
    "https://www.youtube.com/shorts/V_uq3v6xK-4",
    "https://www.youtube.com/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi",
    "https://www.youtube.com/@3blue1brown",
    "jNQXAC9IVRw"
  ],
  "searchQueries": [
    "how large language models work",
    "home espresso tutorial"
  ],
  "maxVideosPerSource": 20,
  "maxTranscripts": 0,
  "channelContentTypes": [
    "videos",
    "shorts",
    "streams"
  ],
  "searchSort": "relevance",
  "languages": [
    "en"
  ],
  "fallbackToAnyLanguage": true,
  "captionType": "any",
  "outputFormats": [
    "segments",
    "text"
  ],
  "includeWordTimestamps": false,
  "removeSoundTags": false,
  "includeDescription": false,
  "includeErrorItems": true,
  "onlyNewVideos": false,
  "stateKey": "default",
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "residentialFallback": true,
  "maxConcurrency": 10,
  "maxRetries": 5
}
```

# Actor output Schema

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

No description

# 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 = {
    "urls": [
        "https://www.youtube.com/watch?v=aircAruvnKk",
        "https://www.youtube.com/shorts/V_uq3v6xK-4"
    ],
    "maxVideosPerSource": 20,
    "languages": [
        "en"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("zhtech/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 = {
    "urls": [
        "https://www.youtube.com/watch?v=aircAruvnKk",
        "https://www.youtube.com/shorts/V_uq3v6xK-4",
    ],
    "maxVideosPerSource": 20,
    "languages": ["en"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("zhtech/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 '{
  "urls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://www.youtube.com/shorts/V_uq3v6xK-4"
  ],
  "maxVideosPerSource": 20,
  "languages": [
    "en"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call zhtech/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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