# YouTube Transcript Scraper: Merged Transcript Export (`scraper-engine/youtube-transcript-scraper`) Actor

YouTube Transcript Scraper extracts full transcripts from public YouTube videos with ease. Quickly retrieve spoken content for research, summarization, SEO, or accessibility—just enter a video URL and get clean, structured text. No login or API key required.

- **URL**: https://apify.com/scraper-engine/youtube-transcript-scraper.md
- **Developed by:** [Scraper Engine](https://apify.com/scraper-engine) (community)
- **Categories:** Social media, Videos
- **Stats:** 274 total users, 8 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### YouTube Transcript Scraper — Captions, Timestamps and Video Titles

YouTube Transcript Scraper: Merged Transcript Export pulls the full spoken-word transcript from any public YouTube video, or bulk-discovers videos from a channel, playlist, or keyword search first. Each result returns `videoTitle`, `id`, `url`, and `transcripts` — every caption language and format merged into one array — as clean, structured JSON with no HTML parsing and no manual copy-pasting. Open the Actor's page on Apify Store and start a run to see transcripts land in your dataset within minutes.

### What is YouTube Transcript Scraper: Merged Transcript Export?

It's an Apify Actor that extracts spoken-word transcripts from YouTube videos, either one URL at a time or in bulk by expanding a channel, playlist, or search query into its videos first. No YouTube account or login is required — it reads only what a public visitor can already see. It's built for content teams, researchers, and AI/RAG engineers who need video transcript text as data rather than a video to watch.

### What YouTube transcript data is publicly available to scrape?

Anyone with the video link can view a public YouTube video's captions without signing in — that's exactly what this Actor reads.

| Data Category | Publicly Available | Restricted |
| --- | --- | --- |
| Manually-created captions | Yes, if uploaded | No, if never added |
| Auto-generated captions | Yes, for most spoken videos | No — some videos lack an ASR track |
| Additional caption languages | Yes, any track YouTube exposes | Limited to tracks YouTube or the uploader provided |
| Video title, ID, and URL | Yes | — |
| Channel's uploaded videos | Yes, via the channel's videos page | — |
| Playlist's video list | Yes, via the public playlist page | — |
| Search results for a keyword | Yes, via the public search page | — |
| Private or unlisted videos | No | Restricted — needs the direct authenticated link, not accessible to this Actor |

YouTube Transcript Scraper: Merged Transcript Export only returns publicly visible data — what any visitor sees. Nothing behind a login wall.

### What data can I extract with YouTube Transcript Scraper: Merged Transcript Export?

Every run returns one JSON object per video, combining discovery context with the full transcript content for that video.

| Field Name | Description |
| --- | --- |
| `id` | YouTube video ID |
| `url` | Canonical video watch URL |
| `input` | The raw input value that produced this row — a URL you supplied, or a video ID discovered from a channel/playlist/search |
| `videoTitle` | Video title, captured at discovery time (channel/playlist/search modes) |
| `type` | Always `"video"` in the main dataset |
| `isChild` | `true` when the video was discovered from a channel/playlist/search query; `false` for a direct URL |
| `discoveryMode` | The mode used for the run: `urls`, `channel`, `playlist`, or `search` |
| `containerType` | `direct`, `channel`, `playlist`, or `search` |
| `sourceContainer` | The channel URL, playlist URL, or search query this video came from (`null` for direct URLs) |
| `scrapedAt` | ISO timestamp of when the run collected this row |

#### Transcript content

| Field Name | Description |
| --- | --- |
| `transcripts` | Array holding every matching transcript track found for the video — this is the "merged" part: all languages and generation types the run was configured to include, in one field |
| `transcripts[].language` | Human-readable transcript language/label (e.g. "English (auto-generated)") |
| `transcripts[].languageCode` | Short language code (e.g. `en`) |
| `transcripts[].isGenerated` | `true` if the track is YouTube's auto-generated captions, `false` if manually created |
| `transcripts[].content` | The transcript text — a single string in `text` mode, or an array of timed cues (`startMs`, `endMs`, `startTime`, `text`) in `timestamp` mode |
| `transcripts[].wordCount` | Word count for that transcript track |
| `transcripts[].charCount` | Character count for that transcript track |

#### 🤖 Add-on: Need additional YouTube data?

Pair this Actor with [YouTube Scraper](https://apify.com/scraper-engine/youtube-scraper) for view counts, likes, comment counts, and full video/Shorts/channel metadata beyond transcripts. Use [YouTube Channel Finder](https://apify.com/scraper-engine/youtube-channel-finder) to discover channel URLs by keyword before feeding them into this Actor's `channel` discovery mode. For comment-level insight, [YouTube Comments Scraper: AI Sentiment Analytics](https://apify.com/scraper-engine/youtube-comments-scraper-ai-sentiment-analytics) extracts comments alongside AI sentiment scoring.

### How does YouTube Transcript Scraper differ from the official YouTube API?

YouTube Data API v3 lets you list a video's available caption tracks (`captions.list`), but its `captions.download` endpoint requires OAuth 2.0 authorization as the video's own channel owner (or a Creative Commons-licensed video) — it does not hand back transcript text for an arbitrary third-party video the way this Actor does.

| Feature | YouTube Data API v3 | This Actor |
| --- | --- | --- |
| Transcript/caption text for any public video | Requires OAuth as the video owner (or CC license) | Returns transcript text directly, no ownership or OAuth needed |
| Authentication | Google Cloud API key + OAuth for captions | None — no YouTube account or login required |
| Channel/playlist video expansion | `playlistItems.list` / `search.list`, subject to Google Cloud API quota | `channel`/`playlist` discovery modes, capped by `maxVideosPerContainer` |
| Keyword search | `search.list`, quota-metered per call | `search` discovery mode built in |
| Multi-language transcripts | Track metadata available; downloading needs owner auth per track | `includeNonEnglishTranscripts` returns any exposed language track directly |
| Setup | Google Cloud project, API key, OAuth consent screen | Apify account, no credentials to provision |

Use the official API if you already have OAuth access to your own channel's captions. Use this Actor when you need transcript text from videos you don't own, or want channel/playlist/search discovery without managing API quota.

### How to use YouTube Transcript Scraper: Merged Transcript Export

Run it directly on Apify — no separate signup or API key needed beyond your Apify account.

1. Open the Actor's page on Apify Store (`scraper-engine/youtube-transcript-scraper-merged-transcript-export`) and click **Try for free**.
2. Add one or more links to `directVideoUrls` for single/multiple videos — this is the only input most runs need.
3. Optionally set `transcriptOutputFormat` (`text` or `timestamp`), `includeAutoGeneratedCaptions`, or `includeNonEnglishTranscripts` to control what's returned.
4. Start the run.
5. Download the dataset as JSON, CSV, or Excel, or pull it via the Apify API.

#### How to scale to bulk YouTube transcript extraction

Set `discoveryMode` to `channel`, `playlist`, or `search` and list channel/playlist URLs in `containerUrls` (or keywords in `searchQueries`) instead of individual video links. Each entry is expanded into its own videos, capped by `maxVideosPerContainer` (up to 500 per container), so multiple channels or queries in one run each contribute their own batch of transcripts — no need to loop runs manually for bulk collection.

### What can you do with YouTube transcript data?

- A **content strategist** repurposing video into blog posts uses `transcripts[].content` and `videoTitle` to draft written articles from spoken video content without manual transcription.
- An **SEO researcher** mapping a competitor's content uses `transcripts[].content` together with `sourceContainer` (a whole channel) to find topic and keyword gaps across every video at once.
- An **AI/RAG engineer** building a searchable video knowledge base uses `transcripts[].content`, `videoTitle`, and `id` as chunk text and metadata to index videos into a vector store for retrieval-augmented generation.
- A **localization or QA team** auditing caption coverage uses `transcripts[].languageCode` and `transcripts[].isGenerated` to see which languages are auto-generated versus manually created before ordering translations.
- An **archivist or educator** uses `discoveryMode: "playlist"` to pull every lecture transcript from a course playlist into one searchable dataset instead of pasting each URL by hand.

### How does YouTube Transcript Scraper handle rate limits and blocking?

The Actor routes both transcript fetches and discovery requests (channel/playlist/search page loads) through Apify Proxy, defaulting to the residential proxy group when `proxyConfiguration.useApifyProxy` is enabled, to reduce the chance of YouTube blocking the requesting IP. Each video is processed independently in a try/except loop, so one video that errors out (missing captions, a dead link, a parsing failure) is logged and skipped without stopping the rest of the run. Channel and search discovery follow YouTube's own pagination/continuation tokens with a bounded retry loop, so a single stuck continuation can't loop forever. The Actor does not solve CAPTCHAs — if YouTube presents one, that request will fail and get logged rather than silently retried indefinitely.

### ⬇️ Input

| Parameter | Required | Type | Description | Example Value |
| --- | --- | --- | --- | --- |
| `discoveryMode` | No | String | How videos are gathered: `urls` (default, individual links), `channel`, `playlist`, or `search` (bulk expansion) | `"channel"` |
| `containerUrls` | No | Array | Channel or playlist URLs to expand, used when `discoveryMode` is `channel` or `playlist` | `["https://www.youtube.com/@GoogleDevelopers"]` |
| `searchQueries` | No | Array | Keyword queries to expand into matching videos, used when `discoveryMode` is `search` | `["apify web scraping tutorial"]` |
| `maxVideosPerContainer` | No | Integer | Caps how many videos are expanded from each channel/playlist/query (default 10, 1–500) | `10` |
| `sortBy` | No | String | Order to expand discovered videos in: `date` (newest first, default) or `popularity` (most viewed first) | `"date"` |
| `minDurationSeconds` | No | Integer | Skip discovered videos shorter than this many seconds; discovery modes only (default 0 = no minimum) | `0` |
| `maxDurationSeconds` | No | Integer | Skip discovered videos longer than this many seconds; discovery modes only (default 0 = no maximum) | `0` |
| `minViews` | No | Integer | Skip discovered videos with fewer views than this; discovery modes only (default 0 = no minimum) | `0` |
| `publishedAfter` | No | String | Only keep discovered videos published after this date — absolute (`2024-01-01`) or relative (`30 days`, `6 months`) | `"30 days"` |
| `directVideoUrls` | No | Array | YouTube video links to extract transcripts from directly, used when `discoveryMode` is `urls` | `["https://www.youtube.com/watch?v=4KbrxIpQgkM"]` |
| `includeAutoGeneratedCaptions` | No | Boolean | Include YouTube's auto-generated English captions when no manual English transcript exists | `true` |
| `includeNonEnglishTranscripts` | No | Boolean | Include transcripts in languages other than English | `false` |
| `transcriptOutputFormat` | No | String | Transcript style: `timestamp` (time-coded cues) or `text` (plain text) | `"text"` |
| `proxyConfiguration` | No | Object | Proxy setup; uses Apify Residential Proxy by default when needed | `{"useApifyProxy": true}` |

#### Example input

```json
{
  "discoveryMode": "channel",
  "containerUrls": ["https://www.youtube.com/@GoogleDevelopers"],
  "searchQueries": [],
  "maxVideosPerContainer": 10,
  "sortBy": "date",
  "minDurationSeconds": 0,
  "maxDurationSeconds": 0,
  "minViews": 0,
  "publishedAfter": "30 days",
  "directVideoUrls": ["https://www.youtube.com/watch?v=4KbrxIpQgkM"],
  "includeAutoGeneratedCaptions": true,
  "includeNonEnglishTranscripts": false,
  "transcriptOutputFormat": "text",
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### ⬆️ Output

Every run writes typed, consistent JSON to the default dataset — one item per video, exportable as JSON, CSV, Excel, or via the Apify API. Each pushed row corresponds to exactly one billed `row_result` event; failed videos are logged and skipped, not pushed as unbilled rows.

#### Example output

```json
{
  "id": "4KbrxIpQgkM",
  "url": "https://www.youtube.com/watch?v=4KbrxIpQgkM",
  "input": "https://www.youtube.com/@GoogleDevelopers",
  "transcripts": [
    {
      "language": "English",
      "languageCode": "en",
      "isGenerated": false,
      "content": "Welcome back to another episode of Google Developers...",
      "wordCount": 481,
      "charCount": 2604
    },
    {
      "language": "English (auto-generated)",
      "languageCode": "en",
      "isGenerated": true,
      "content": "welcome back to another episode of google developers...",
      "wordCount": 476,
      "charCount": 2571
    }
  ],
  "type": "video",
  "isChild": true,
  "discoveryMode": "channel",
  "containerType": "channel",
  "sourceContainer": "https://www.youtube.com/@GoogleDevelopers",
  "videoTitle": "Building with the Gemini API",
  "scrapedAt": "2026-07-25T00:00:00Z"
}
```

### How does it work?

For direct video URLs, the Actor calls the video's caption API directly to pull every matching transcript track. For channel, playlist, and search discovery, it requests YouTube's own public channel/playlist/search pages and the same internal endpoints YouTube's front end uses, parsing the embedded video listing data to find matching videos — supporting both YouTube's older and newer page-data formats so discovery keeps working as YouTube updates its UI. Discovered videos are then filtered by duration, views, and publish date before their transcripts are fetched the same way as direct URLs. Requests route through Apify Proxy to reduce blocking. Only publicly visible video and caption data is returned, and the output schema (the same set of fields per row) stays stable regardless of how YouTube's own page layout changes.

### Integrations

YouTube Transcript Scraper: Merged Transcript Export runs on Apify, so it works with anything that can call an HTTP API or an Apify client library — no proprietary SDK required.

#### Calling YouTube Transcript Scraper: Merged Transcript Export programmatically

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_API_TOKEN>")

run = client.actor("scraper-engine/youtube-transcript-scraper-merged-transcript-export").call(run_input={
    "discoveryMode": "urls",
    "directVideoUrls": ["https://www.youtube.com/watch?v=4KbrxIpQgkM"],
    "transcriptOutputFormat": "text",
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["videoTitle"], item["transcripts"][0]["wordCount"])
```

Works in Go, Ruby, Node.js, cURL — any language that can make an HTTP request.

#### MCP integration for AI agents

This Actor is reachable through Apify's Actors MCP Server, which exposes Actors on Apify Store as callable tools for MCP-compatible clients such as Claude Desktop and Claude Code. Register it by connecting from this Actor's page in Apify Console, or by running `npx @apify/actors-mcp-server` configured with this Actor's store ID.

#### No-code tools (n8n, Make, LangChain)

In n8n, use the HTTP Request node (or the community Apify node) pointed at this Actor's run endpoint, passing `directVideoUrls` or `containerUrls` in the request body. In Make, use the Apify app's "Run Actor and get dataset items" module and map `discoveryMode` and `containerUrls` from an earlier scenario step. In LangChain, call the same Apify API endpoint from a custom Tool, or load results with the community Apify dataset loader, so an agent can pull fresh video transcripts mid-conversation.

### Is it legal to scrape YouTube transcripts?

Scraping publicly visible video transcripts is generally lawful in most jurisdictions, since this Actor only returns captions a viewer with the video's public link can already see or read on the page — nothing behind a private or members-only wall. Transcript text is typically not personal data on its own; it only becomes subject to GDPR/CCPA-style rules if the spoken content is about, or identifies, a real person (an interview, a personal vlog, named individuals discussed on camera). YouTube's Terms of Service also restrict automated data collection independent of privacy law. Consult legal counsel if your use case involves bulk storage of personal data.

### Frequently asked questions

#### What YouTube transcript fields does this Actor return?

It returns `id`, `url`, `videoTitle`, and `transcripts` (with `language`, `content`, `wordCount`, and more per track) for every video, plus discovery context like `discoveryMode` and `sourceContainer`. See the [data fields section](#what-data-can-i-extract-with-youtube-transcript-scraper-merged-transcript-export) above for the full list.

#### What does "merged" actually mean for the transcript export?

It means every available transcript track for a single video — manual captions, auto-generated captions, and any additional languages you enable — is combined into one `transcripts` array on that video's single output row, instead of splitting each language or caption type into its own dataset item. It does not merge multiple different videos into one document; each video always gets its own row.

#### Does this Actor require a YouTube account or login?

No. It only reads publicly visible video pages and caption data — no YouTube account, cookies, or session ID are needed for any input mode.

#### How many videos can I extract in one run?

There's no fixed cap in the input schema — direct mode processes however many links you list in `directVideoUrls`, and discovery mode processes up to `maxVideosPerContainer` (max 500) videos for each entry in `containerUrls` or `searchQueries`, so a run with multiple container entries can cover several hundred videos.

#### What happens if a video has no transcript available?

That video's `transcripts` array comes back empty rather than failing the run — the Actor logs that no caption track was found and continues to the next video, so one uncaptioned video doesn't stop the rest of the batch.

#### Can I scrape multiple YouTube videos at once?

Yes — list multiple links in `directVideoUrls` for direct mode, or use `discoveryMode: "channel"`, `"playlist"`, or `"search"` with multiple entries in `containerUrls`/`searchQueries` to bulk-expand many videos in a single run.

#### Does this Actor work with Claude, ChatGPT, and other AI agent tools?

Yes — it's reachable through Apify's Actors MCP Server for MCP-compatible clients like Claude Desktop and Claude Code, and callable as a plain HTTP API by any agent framework that can make a request.

#### Does this Actor return data in a format LLMs can use directly?

Yes. Typed, normalized JSON with consistent field names across runs — no HTML parsing or CSS selectors needed. Pass `transcripts[].content` directly to an LLM, index it into a vector store, or feed it to an agent tool.

#### What happens when YouTube changes its page layout?

The Actor is maintained to keep pace with YouTube's front-end changes — it already supports both YouTube's legacy and current video-listing data formats for channel, playlist, and search discovery, so the output schema stays stable even when YouTube updates its UI.

#### Can I use this Actor without managing proxies or browser infrastructure?

Yes — proxying (residential by default) is handled internally through `proxyConfiguration`, and no browser automation setup is required on your end.

#### Which fields work best for AI training data and RAG indexing?

For RAG, index `transcripts[].content` as the searchable text with `videoTitle`, `id`, and `url` as metadata for citations. For structured training data, `transcripts[].wordCount`, `charCount`, `languageCode`, and `isGenerated` return as consistent typed primitives across every record.

### Related scrapers

| Scraper Name | What it extracts |
| --- | --- |
| [YouTube Scraper](https://apify.com/scraper-engine/youtube-scraper) | Video, Shorts, channel, and search metadata — views, likes, comments, subscribers, duration, and more |
| [YouTube Channel Finder](https://apify.com/scraper-engine/youtube-channel-finder) | Discovers YouTube channels by keyword or URL |
| [YouTube Comments Scraper: AI Sentiment Analytics](https://apify.com/scraper-engine/youtube-comments-scraper-ai-sentiment-analytics) | Video comments enriched with AI-driven sentiment analysis |

### Your feedback

Found a bug or missing a field? Let us know so we can fix it. Reach out through the Actor's Issues tab on Apify Console, or contact Scraper Engine support directly — active maintenance keeps this Actor working as YouTube changes.

# Actor input Schema

## `discoveryMode` (type: `string`):

'urls' = use the YouTube Video URLs list below (default, base behavior). 'channel' = expand each entry in Container URLs into that channel's videos. 'playlist' = expand each entry in Container URLs into that playlist's videos. 'search' = expand each entry in Search Queries into matching videos. Default: urls.

## `containerUrls` (type: `array`):

Used when discoveryMode is 'channel' or 'playlist'. Add one or more channel URLs (e.g. https://www.youtube.com/@channelname) or playlist URLs (e.g. https://www.youtube.com/playlist?list=...). Each is expanded to its member videos, capped by Max Videos Per Container.

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

Used when discoveryMode is 'search'. Add one or more keyword/search queries (e.g. 'apify web scraping tutorial'). Each query is expanded into matching videos, capped by Max Videos Per Container.

## `maxVideosPerContainer` (type: `integer`):

Caps how many videos are expanded from EACH channel/playlist/search query (parents are the containers, not counted against this; this bounds the children per container). Example: 2 container URLs + maxVideosPerContainer=10 -> up to 20 videos total. Default is 10.

## `sortBy` (type: `string`):

Order videos are expanded in for channel/search discovery before filters/cap are applied. 'date' = most recent first. 'popularity' = most viewed first. Playlists keep their own owner-defined order for 'date' and are re-sorted locally for 'popularity'. Default: date.

## `minDurationSeconds` (type: `integer`):

Only applies to discovery modes (channel/playlist/search) — direct URL mode ignores this. Skip discovered videos shorter than this many seconds. 0 = no minimum. Default: 0.

## `maxDurationSeconds` (type: `integer`):

Only applies to discovery modes (channel/playlist/search). Skip discovered videos longer than this many seconds. 0 = no maximum. Default: 0.

## `minViews` (type: `integer`):

Only applies to discovery modes (channel/playlist/search). Skip discovered videos with fewer views than this. 0 = no minimum. Default: 0.

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

Only applies to discovery modes (channel/playlist/search). Only keep discovered videos published after this date. Accepts an absolute date (e.g. 2024-01-01) or a relative window (e.g. '30 days', '6 months'). Leave blank for no date filter.

## `directVideoUrls` (type: `array`):

Used when discoveryMode is 'urls' (default). Add one or more YouTube links to extract transcripts from directly. Each completed video appears in your dataset automatically. (Also accepts the base actor's `urls` field name for backward compatibility.) ⚡

## `includeAutoGeneratedCaptions` (type: `boolean`):

Include YouTube's auto-generated English captions when a manually-created English transcript isn't available. Default is true. (Also accepts the base field name `includeEnglishAG`.)

## `includeNonEnglishTranscripts` (type: `boolean`):

Include transcripts in languages other than English. Default is false. (Also accepts the base field name `includeNonEnglish`.)

## `transcriptOutputFormat` (type: `string`):

Choose transcript style: 'timestamp' includes time markers, while 'text' returns clean plain text. Default is 'text'. (Also accepts the base field name `outputFormat`.)

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

Optional proxy setup for stable access. Uses Apify Residential Proxy by default when needed.

## Actor input object example

```json
{
  "discoveryMode": "urls",
  "containerUrls": [],
  "searchQueries": [],
  "maxVideosPerContainer": 10,
  "sortBy": "date",
  "minDurationSeconds": 0,
  "maxDurationSeconds": 0,
  "minViews": 0,
  "publishedAfter": "",
  "directVideoUrls": [
    "https://www.youtube.com/watch?v=4KbrxIpQgkM"
  ],
  "includeAutoGeneratedCaptions": true,
  "transcriptOutputFormat": "text",
  "proxyConfiguration": {}
}
```

# Actor output Schema

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

All scraped videos with their merged transcripts, in the Actor's default dataset.

# 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 = {
    "containerUrls": [],
    "searchQueries": [],
    "directVideoUrls": [
        "https://www.youtube.com/watch?v=4KbrxIpQgkM"
    ],
    "includeAutoGeneratedCaptions": true,
    "includeNonEnglishTranscripts": false,
    "transcriptOutputFormat": "text"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraper-engine/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 = {
    "containerUrls": [],
    "searchQueries": [],
    "directVideoUrls": ["https://www.youtube.com/watch?v=4KbrxIpQgkM"],
    "includeAutoGeneratedCaptions": True,
    "includeNonEnglishTranscripts": False,
    "transcriptOutputFormat": "text",
}

# Run the Actor and wait for it to finish
run = client.actor("scraper-engine/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 '{
  "containerUrls": [],
  "searchQueries": [],
  "directVideoUrls": [
    "https://www.youtube.com/watch?v=4KbrxIpQgkM"
  ],
  "includeAutoGeneratedCaptions": true,
  "includeNonEnglishTranscripts": false,
  "transcriptOutputFormat": "text"
}' |
apify call scraper-engine/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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