# YouTube Transcript — Captions & AI Speech to Text (`andronixmd/youtube-transcript`) Actor

Get a YouTube transcript from any public video: its own captions for $0.005, or AI speech-to-text when it has none. Get text with timestamps, SRT/VTT subtitles, word timing, speaker labels and RAG-ready JSONL. Caption transcripts for videos up to 8 hours. No login, no cookies, no API key.

- **URL**: https://apify.com/andronixmd/youtube-transcript.md
- **Developed by:** [Sergey Andronik](https://apify.com/andronixmd) (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 $5.00 / 1,000 caption 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

Get a **YouTube transcript** from any public YouTube video, with timestamps, as JSON,
SRT or VTT. YouTube Transcript reads the video's own captions when it has them, which is
the cheapest and fastest route at $0.005 per video. When a video has no captions, or you
need speaker labels, it transcribes the audio with AI speech-to-text instead. Paste one
link or a list of up to 1,000 and get one result per video: the full text, timed
segments, subtitles, optional word timing and optional RAG-ready passages for search,
summaries or an AI pipeline. No YouTube login, cookies or speech-provider API key are
needed.

### What you get for each YouTube video

- **Transcript text** in `text`, plus `transcript_llm` with one line per segment for LLM
  prompts.
- **Where it came from:** `transcript_source` is `captions` or `asr`, and `caption_kind`
  is `manual` (uploaded by the creator) or `auto` (generated by YouTube).
- **Timestamps** per segment (`t0`, `t1` in seconds), or per word with
  `timestamps: "word"`.
- **SRT and VTT subtitles** in the result and as downloads in the run's key-value store
  (`transcript-000.srt`, `transcript-000.vtt`, numbered by input position).
- **Readable paragraphs** in `paragraphs` (`start_s`, `end_s`, `speaker`, `text`) and as
  `transcript-000.txt` and `transcript-000.md` downloads, at no extra charge. See
  [Readable output](#readable-output).
- **Speaker labels** (S1, S2, …) with `diarize: true`, through AI speech-to-text.
- **RAG passages** with source URL and original-video seconds, inline as `rag_chunks` and
  as a `transcript-000.rag.jsonl` download, with `exportRag: true`.
- **Part of a video:** `startTime` and `endTime` in seconds; timestamps stay relative to
  the full video.
- **Billing per item:** every row shows which events were charged.

### How to get a YouTube transcript

1. **Paste your video URLs.** Watch links, `youtu.be` short links, Shorts, live replays
   and embed links work. For a whole channel or playlist, use `channelUrls` instead.
2. **Pick the transcript source.** Keep **Auto** (captions first, AI speech-to-text when
   there are none), or choose **Captions only** or **AI speech-to-text only**.
3. **Add options if you need them:** a language, word timestamps, speaker labels, RAG
   passages or a time range.
4. **Set a run budget** in the run options, then start the run. Each URL becomes one row
   in the Dataset. Export it as JSON, CSV or Excel, or read it through the API.

### Input

```json
{
  "urls": ["https://www.youtube.com/watch?v=zjkBMFhNj_g"],
  "transcriptSource": "auto",
  "timestamps": "segment"
}
```

| Field | What it does |
|---|---|
| `urls` | Up to 1,000 public YouTube video URLs. Required unless you set `datasetId`. |
| `datasetId` | Read URLs from another run's dataset. See [Chain from another Actor](#chain-from-another-actor). |
| `datasetUrlField`, `maxItems` | The dataset field that holds the URL (detected when empty), and how many rows to read (default 100, at most 1,000). |
| `transcriptSource` | `auto` (default): captions first, AI speech-to-text when there are none. `captions`: captions only; a video without a usable caption track returns an error and is not charged. `asr`: always AI speech-to-text. |
| `language` | Optional language code such as `en`, `es` or `pt-BR`. With captions it picks the caption track; with AI speech-to-text it guides recognition. |
| `timestamps` | `none` (text only: no `segments`, `words`, SRT or VTT), `segment` (default) or `word`. Word timing comes from YouTube's auto-generated captions when they carry it, otherwise from AI speech-to-text. |
| `diarize` | Speaker labels. Needs AI speech-to-text and is billed at the speaker-label rate. |
| `exportRag` | Adds `rag_chunks` and a `.rag.jsonl` download. Needs segment or word timestamps. |
| `startTime`, `endTime` | Transcribe only this part of the video, in seconds. |

### Start from a channel or playlist

Put channel or playlist URLs in **YouTube channels and playlists** (`channelUrls`) to transcribe their newest videos:

```json
{
  "channelUrls": ["https://www.youtube.com/@TED", "https://www.youtube.com/playlist?list=PLe3qqz7JaEDM"],
  "maxItemsPerSource": 10,
  "transcriptSource": "captions"
}
```

- Channel URLs: `/@handle`, `/channel/UC…`, `/c/…` and `/user/…`, optionally with a `/videos`, `/shorts` or `/streams` tab. Without one, **Channel tab** (`channelTab`, default `videos`) decides. Playlist URLs: `/playlist?list=…`, in playlist order.
- Each row adds `source_url`, `source_type` (`youtube_channel` or `youtube_playlist`) and `source_title`.
- `publishedAfter` (YYYY-MM-DD) is approximate on YouTube: channel and playlist pages show only a relative age such as "3 weeks ago", so videos up to one such unit older can be included. Shorts have no date at all, so `publishedAfter` cannot be combined with the Shorts tab.
- `publishedAfter` filters only the entries that were listed. A channel tab lists newest first, `maxItemsPerSource` deep, so it finds every recent video. A playlist keeps its creator's order, which can be oldest first; with `publishedAfter` it is listed up to 200 entries deep, and the first `maxItemsPerSource` entries on or after the date are kept. Newer videos further down a longer playlist are not found.
- The listing request goes from Apify's servers directly to YouTube, not through the residential proxy that video data uses.
- Listed videos follow `transcriptSource` like any other: captions first by default.
- `maxItemsPerSource` (default 20, at most 200) limits how many of the newest items each source contributes. A run holds at most 1,000 items in total, counting `urls` and dataset rows.
- Each listed item is processed and charged exactly like a URL you submit. Listing itself is free.
- The example link in the URL list is processed and charged too: remove it when you want only listed items.
- Listed items run after `urls` and dataset rows, source by source in input order; an item already in the run is skipped.
- A source that cannot be listed becomes one error row with `source_url` and an `error` naming it (for example `channelUrls[1]: …`), and it is not charged. The other sources continue. If no source lists anything, the run fails before any charge.
- The listing is saved when the run starts, so a restarted run keeps the same items even if the source changed meanwhile.

### Scheduled runs: only new items

Turn on **Skip items processed by earlier runs** (`skipPreviouslyProcessed`) and run the
Actor on a [schedule](https://docs.apify.com/platform/schedules) to get only what is new
since the last run.

- The Actor keeps a key-value store named `polyglot-processed-youtube` in your Apify
  account, or `polyglot-processed-youtube--<memoryKey>` when you set **Memory name**
  (`memoryKey`), so separate schedules can keep separate memories. Other Actors keep
  their own stores, even with the same `memoryKey`. It records each item after the item
  is delivered and charged; failed items are tried again next time.
- It applies to every URL in the run: listed ones, dataset rows and the items listed
  from sources.
- When nothing is new, the run ends without any charge. Only error rows appear then, for
  sources or dataset rows that could not be used.
- If the store cannot be opened or read, the run stops before any charge, and the next
  scheduled run tries again. If an item's record cannot be written, the item is still
  delivered and the log says so; a later run may process and charge it again.
- Delete the store in Apify Console (Storage → Key-value stores) to start over. Do not run
  two runs with the same memory at the same time: both would process the same new items.

### Chain from another Actor

Run a YouTube scraper, such as YouTube Scraper by this publisher first, then paste the dataset ID of that run into **Dataset ID**
(`datasetId`) to transcribe every one of its YouTube videos:

```json
{ "datasetId": "<dataset ID from the other run>", "maxItems": 200 }
```

- The Actor reads up to `maxItems` rows (default 100) with your own run's Apify token and
  takes each row's URL from `webVideoUrl`, `url`, `postUrl`, `videoUrl`, `inputUrl` or `link`, or from the field you name in `datasetUrlField`.
- Dataset URLs run after any `urls` you list, in dataset order; a dataset URL that is
  already in the run is skipped. A run takes at most 1,000 URLs in total.
- A row without a usable URL becomes an error item with its `dataset_row` index, and it is
  not charged. Items from the dataset also carry `dataset_row`, so you can join the results
  back to the source rows.
- The example link in the URL list is processed and charged too: remove it when you want only the dataset's items.

### Output example

An illustrative result, built with this Actor's caption parser from the real English
caption track of "Me at the zoo" (19 seconds). It is not a recorded Apify run; the SRT
and VTT fields are shortened.

```json
{
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "transcript_source": "captions",
  "caption_kind": "manual",
  "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",
  "language": "en",
  "duration_s": 19,
  "segments": [
    { "t0": 1.2, "t1": 3.36, "text": "All right, so here we are, in front of the elephants" },
    { "t0": 5.318, "t1": 7.974, "text": "the cool thing about these guys is that they have really..." },
    { "t0": 7.974, "t1": 12.616, "text": "really really long trunks" },
    { "t0": 12.616, "t1": 14.367, "text": "and that's cool" },
    { "t0": 14.421, "t1": 15.733, "text": "(baaaaaaaaaaahhh!!)" },
    { "t0": 16.881, "t1": 18.881, "text": "and that's pretty much all there is to say" }
  ],
  "srt": "1\n00:00:01,200 --> 00:00:03,360\n…",
  "billing": {
    "status": "paid",
    "events": [{ "event": "caption-transcript", "requested_count": 1, "charged_count": 1, "state": "confirmed" }]
  }
}
```

Results also contain `vtt`, `transcript_llm`, `source_duration_s`, `start_time_s` and
`end_time_s`. Results from AI speech-to-text also contain `engine` and `usage`. A URL
that fails returns a row with `url` and `error`. Very large results may carry
`result_record_key` instead of inline text; read that key from the run's key-value
store.

#### Video data in transcript rows

Every caption transcript, and every AI speech-to-text row, also carries the video's data at
no extra charge. Caption rows and rows that followed a caption attempt take it from that
attempt's lookup. Other speech-to-text rows (`transcriptSource: asr`, speaker labels) take it from
the audio download's own video info, with no extra request:
`video_id`, `title`, `author_name`, `author_id`, `author_url`, `author_username`,
`published_at`, `upload_date`, `view_count`, `like_count`, `comment_count`,
`thumbnail_url`, `tags`, `categories`, `availability` and `live_status`. The names match
YouTube Video Scraper. A field is left out when YouTube does not show it, and all of them
are left out when the download's video info was reduced or unreadable (the transcript is
still returned). The description is not included; use YouTube Video Scraper for it.

Two more fields come from the same lookup:

- `video_chapters`: the chapters the creator defined, as `[{ "title", "start_s", "end_s" }]`.
  Absent when the video has none. These are not the AI `chapters` of the text add-ons.
- `available_caption_languages`: the caption tracks YouTube lists in the video's own
  languages, as `[{ "language", "kind": "manual" | "auto", "name" }]`. YouTube's
  machine translations of those tracks are not listed, and the list stops at 100
  entries. A row for a video without a caption track in the `language` you asked for
  (`captions` mode, not charged) still carries this list and `video_chapters`, so you can
  see which languages exist.

### Readable output

Every transcript row has `paragraphs`: the transcript in order, grouped into blocks you can
read. A paragraph starts at a speaker change, after a pause of 2 seconds or more, and
before it would pass 800 characters or 90 seconds. Once it holds 400 characters, the next
sentence end closes it. No text is dropped or reordered, and a segment is never split in
timed output. Each paragraph is `{ "start_s", "end_s", "speaker", "text" }`; `speaker` appears
only with `diarize: true`, and with `timestamps: "none"` there are no times and paragraphs
are cut at sentence ends by length alone. A caption transcript is grouped the same way as AI speech-to-text. Rows without speech have no `paragraphs`.

The same paragraphs are saved to the run's key-value store, numbered by input position:

- `transcript-000.txt`: paragraphs separated by blank lines, with `S1:` style speaker labels.
- `transcript-000.md`: a title (the video title), a list with the source URL, language and duration (and the channel name), then
  each paragraph with its `[mm:ss]` (or `[h:mm:ss]`) start time and bold speaker label.

When a row would pass the Dataset size limit, `paragraphs` is left out of the row first
(the text stays) and the downloads still hold it. Both downloads are free, like SRT and VTT.

### How YouTube data is fetched

- On Apify, the video's metadata and its caption track are requested through Apify's
  residential proxy, with a traffic limit for each video. That cost is included in the
  per-video price.
- The Actor uses no YouTube login and no cookies.
- For AI speech-to-text, the audio is downloaded from Apify's servers without that
  proxy. YouTube refuses some of these downloads.
- When YouTube blocks a request or the video is unavailable, the item returns an error.
  A failed caption request or a failed download is not charged. When YouTube returns
  incomplete video data, the item fails without a charge and without falling back to AI
  speech-to-text; retry it later.

### Length limits

| Request | Caption transcripts | Longer videos |
|---|---|---|
| Segment timestamps or none | Up to 8 hours | `captions`: an error, not charged. `auto`: AI speech-to-text, billed at its prices. |
| Word timestamps | Up to 2 hours | `captions`: an error, not charged. `auto`: AI speech-to-text, billed at its prices. |

AI speech-to-text handles recordings up to 4 hours. A longer video fails after its audio
download and is not charged. Selecting a time range still downloads the whole audio.

### How much does a YouTube transcript cost?

Pay per event, with no subscription. These are the Free-plan prices; paid Apify plans
get lower per-minute prices for AI speech-to-text. The
[Pricing tab](https://apify.com/andronixmd/youtube-transcript/pricing) shows the current
prices for your plan.

| Event | Price | When |
|---|---:|---|
| Run setup | $0.005 | Once per run. |
| Caption transcript | $0.005 | Per video whose transcript comes from its captions, at any length up to the limits above. |
| Audio download for AI speech-to-text | $0.02 | Per video whose audio was downloaded. Not charged for caption transcripts. |
| Audio minute | $0.01 | Per started minute of AI speech-to-text, after it succeeds. |
| Diarized audio minute | $0.02 | Per started minute with speaker labels, instead of the audio minute. |

Worked examples:

| Video | 1 URL in a run | 100 URLs in a run |
|---|---:|---:|
| With captions, any length | $0.005 + $0.005 = **$0.010** | $0.005 + 100 × $0.005 = **$0.505** |
| No captions, 1 minute | $0.005 + $0.02 + $0.01 = **$0.035** | $0.005 + 100 × $0.03 = **$3.005** |
| No captions, 3 minutes | $0.005 + $0.02 + 3 × $0.01 = **$0.055** | $0.005 + 100 × $0.05 = **$5.005** |
| No captions, 10 minutes | $0.005 + $0.02 + 10 × $0.01 = **$0.125** | $0.005 + 100 × $0.12 = **$12.005** |

With speaker labels, a 10-minute video costs $0.005 + $0.02 + 10 × $0.02 = $0.225.

- In `auto` mode you pay the caption price only for videos that have usable captions,
  and the AI speech-to-text prices for the rest.
- Minutes are rounded up once per video, and silence counts.
- A video with no detected speech (only music, silence or noise) returns
  `no_speech: true` with empty text and is not charged minutes, up to 30 such minutes per
  run; after that its minutes are charged. The audio download fee still applies.
- A successful audio download stays charged if the transcription fails afterwards. A
  download that is not playable audio, or is longer than 4 hours, is not charged.
- Apify's own small run-start event is separate and is shown on the Pricing tab.

### Use it from the API

Start a run with the [Apify API client for JavaScript](https://docs.apify.com/api/client/js/)
and read the results:

```js
import { ApifyClient } from 'apify-client'

const client = new ApifyClient({ token: process.env.APIFY_TOKEN })
const run = await client.actor('andronixmd/youtube-transcript').call(
  { urls: ['https://www.youtube.com/watch?v=zjkBMFhNj_g'], transcriptSource: 'captions' },
  { maxTotalChargeUsd: 0.1 },
)
const { items } = await client.dataset(run.defaultDatasetId).listItems()
for (const item of items) console.log(item.url, item.error ?? item.text)
```

Or start one run over HTTP:

```sh
curl -X POST \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"urls":["https://www.youtube.com/watch?v=zjkBMFhNj_g"]}' \
  'https://api.apify.com/v2/actors/andronixmd~youtube-transcript/runs?maxTotalChargeUsd=0.1'
```

The Actor also works from n8n and other automation tools through Apify's integrations.

#### Use it from an AI agent (MCP)

Connect your agent to `https://mcp.apify.com`. It can find this Actor with `search-actors`, or
call it by name, `andronixmd/youtube-transcript`, with `call-actor`. Use `fetch-actor-details` first for the
input schema and pricing. Every call starts a new paid run, so always set
`callOptions.maxTotalChargeUsd` and keep the `urls` list short:

```json
{ "actor": "andronixmd/youtube-transcript", "input": { "urls": ["https://www.youtube.com/watch?v=zjkBMFhNj_g"], "transcriptSource": "auto", "timestamps": "segment" }, "callOptions": { "maxTotalChargeUsd": 0.1 } }
```

`call-actor` returns the run status and storage IDs, not the results. Read the rows with
`get-dataset-items` and the run's dataset ID. The fields to use are `title`, `text`, `paragraphs` and `error`.

With an Apify account, use your API token or MCP OAuth. Without one, an agent can buy a prepaid token from [Apify AGI](https://agi.apify.com) over
x402 or MPP and use it as the Bearer token. It starts at $1, the balance is a hard spending cap,
and the token expires after 14 days. This is experimental; see
[agentic payments](https://docs.apify.com/agents/payments).

### Limitations

- **Public videos only.** Private, members-only, age-restricted, region-blocked and
  DRM-protected videos, and anything that needs a login, are not supported.
- **Videos, channels and playlists.** Search URLs are not accepted. One URL in a wrong
  format rejects the whole input before the run starts. Channel listing from Apify's
  servers has not been tested at scale; a channel that cannot be listed becomes an error
  row that is not charged.
- **Not every video works.** YouTube can block requests or serve incomplete data, so
  some URLs return an error row. Check each row's `error` and `billing` fields and retry
  failed URLs in a later run.
- **Restarted runs.** If a run is restarted or resurrected, the remaining videos fail
  without a charge; start a new run for them. A run that Apify moves to another server
  continues normally. After 20 videos in a row fail without a
  charge, the run stops requesting YouTube data and the rest fail the same way.
- **Live streams** have no complete caption track until they end.

### FAQ

**Captions or AI speech-to-text: which should I use?**
Captions are cheaper and quicker, and exact when the creator wrote them. YouTube's
auto-generated captions can contain errors, and `caption_kind` tells you which you got.
AI speech-to-text works from the audio, so it covers videos without captions and gives
speaker labels. **Auto** uses captions where they exist and AI speech-to-text elsewhere.
It also uses AI speech-to-text when you ask for speaker labels, or for word timestamps
on a caption track without word timing.

**Which languages are supported?**
For captions, any language the video has a caption track in. Without `language`, the
Actor picks the track in the video's spoken language, else English. If YouTube does not
say which language is spoken and the creator captions include neither English nor a
single track, set `language` to choose one. The result's `language` names the track
used. For AI speech-to-text, the language is detected automatically, and support
depends on the speech engine.

**Can I download YouTube subtitles as SRT?**
Yes. With segment or word timestamps (segment is the default), each result contains
`srt` and `vtt`, and the files are saved in the run's key-value store.

**Can I get transcripts of a whole channel or playlist?**
Yes. Put it in `channelUrls` and set `maxItemsPerSource` (up to 200 per source). With
`skipPreviouslyProcessed` on a schedule, each run picks up only new uploads.

**Do you store my transcripts or audio?**
Results stay in your Apify run storage, under your account's access and retention
settings. With AI speech-to-text, the audio is sent to the speech-to-text provider. With
captions, no audio is processed. Only submit videos you are allowed to process.

### Related Actors

- [YouTube Video Scraper](https://apify.com/andronixmd/youtube-scraper): title, channel,
  views, likes, tags and caption text for the same URLs, for $0.005 per video or less.
- [TikTok Video Transcript](https://apify.com/andronixmd/tiktok-video-transcript) and
  [Instagram Reel Transcript](https://apify.com/andronixmd/instagram-reel-transcript):
  the same transcript output for short vertical video.
- [Audio & Video Transcriber](https://apify.com/andronixmd/speech-to-text-transcriber):
  podcasts, audio and video files and other sites.

# Actor input Schema

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

Public YouTube video links, one transcript per URL. Accepted forms: youtube.com/watch?v=…, youtu.be/…, youtube.com/shorts/…, /live/… and /embed/… (also m.youtube.com and music.youtube.com watch links). Channel and playlist URLs go in YouTube channels and playlists below; search and private video URLs are rejected. Submit up to 1,000 URLs, or leave this list empty and fill in channels and playlists or Dataset ID below.

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

Auto uses the video's own captions when it has them (lowest price) and falls back to AI speech-to-text when it has none. Captions only never uses AI speech-to-text; a video without a usable caption track then returns an error and is not charged. AI speech-to-text always transcribes the audio, for example when you need speaker labels or word timestamps.

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

Optional BCP-47 language code, for example en, ru or pt-BR. With captions it selects the caption track; with AI speech-to-text it guides recognition. Omit it for automatic selection and detection; an empty string is invalid.

## `timestamps` (type: `string`):

Choose no timestamps, segment timestamps (subtitle-style lines) or word timestamps. Word timestamps and RAG passages need segment or word timing. Word timing comes from YouTube's auto-generated captions when they carry it, otherwise from AI speech-to-text. Timed lines are in the segments array (word timing in words): read the whole field (fields=segments), because dotted paths such as segments.t0 return nothing.

## `diarize` (type: `boolean`):

Identify speakers (S1, S2, …). This needs AI speech-to-text and is billed at the premium per-minute rate. Whole-video labels are S1/S2; independently processed chunks use C1_S1/C2_S1, so read speaker_scope in each result.

## `exportRag` (type: `boolean`):

Return rag_chunks and transcript-NNN.rag.jsonl with passage text, original-video seconds, source URL and versioned document identity. Requires segment or word timestamps. Embeddings and indexing remain downstream steps.

## `startTime` (type: `number`):

Start time in seconds, including zero. Output timestamps stay relative to the original video.

## `endTime` (type: `number`):

Optional exclusive end time in seconds. Must be positive and greater than startTime; this relationship is validated at runtime. Omit it to transcribe to the end of the video.

## `channelUrls` (type: `array`):

Channel URLs such as https://www.youtube.com/@TED, /channel/UC…, /c/… or /user/…, optionally ending in /videos, /shorts or /streams, and playlist URLs such as https://www.youtube.com/playlist?list=PL…. Each listed video is processed exactly like a video URL above, and each row names the channel or playlist it came from. Up to 100 sources. The example URL above is processed and charged too: remove it if you want only listed videos.

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

Which tab of a channel to list when its URL names none. Playlists ignore it.

## `maxItemsPerSource` (type: `integer`):

List at most this many of the newest videos from each source (up to 200). Each listed item is processed and billed like a URL you submit; listing itself is free. A run holds at most 1,000 items in total, counting URLs and dataset rows.

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

Optional date as YYYY-MM-DD (UTC); videos published before it are left out. Approximate: YouTube shows only relative ages ("3 weeks ago") on channel and playlist pages, so videos up to one such unit older can pass. Shorts carry no date and cannot be filtered. Only listed entries are filtered: a channel tab lists newest first, maxItemsPerSource deep; a playlist keeps its creator's order and is listed up to 200 entries deep, so newer videos further down are not found.

## `datasetId` (type: `string`):

The example URL above is processed and charged too: remove it if you want only the dataset's items. Pick the dataset, or paste its ID, from a YouTube scraper run, such as YouTube Scraper by this publisher, to transcribe every video it found. The Actor reads the rows with your run's own token and processes each row's URL like a URL above, after the listed URLs. Rows without a usable URL become uncharged error items. A named dataset works as username~dataset-name.

## `datasetUrlField` (type: `string`):

Optional. The row field that holds the URL, for example webVideoUrl, or a dotted path such as video.url. Leave it empty to use the first accepted URL from webVideoUrl, url, postUrl, videoUrl, inputUrl or link.

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

Read at most this many dataset rows, in dataset order. A run processes at most 1,000 URLs in total, counting the list above.

## `skipPreviouslyProcessed` (type: `boolean`):

Remember every item that was delivered and charged, in a key-value store in your Apify account, and skip those items in later runs. Use it with a schedule to get only new videos or episodes. Items that failed are tried again next time. When every item was already processed, the run ends without any charge. If the store cannot be read, the run stops before any charge and the next run tries again.

## `memoryKey` (type: `string`):

Optional. Keeps a separate memory for this schedule, for example my-weekly-podcasts. The store is named polyglot-processed-youtube--<name>, and other Actors never share it; without a name every run of this Actor shares polyglot-processed-youtube. Delete the store in Apify Console (Storage, Key-value stores) to start over. Used only with the option above.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=zjkBMFhNj_g"
  ],
  "transcriptSource": "auto",
  "timestamps": "segment",
  "diarize": false,
  "exportRag": false,
  "startTime": 0,
  "channelTab": "videos",
  "maxItemsPerSource": 20,
  "maxItems": 100,
  "skipPreviouslyProcessed": false
}
```

# Actor output Schema

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

One Dataset item per processed URL, with transcript text, source timestamps, conditional products, confirmed billing and errors. Oversized items link to their full saved result via result_record_key.

## `downloads` (type: `string`):

Plain-text (.txt) and Markdown (.md) transcripts in paragraphs, SRT/VTT files when timed cues are available, subtitle-qa.json when subtitleProfile is selected and JSONL when exportRag is enabled. Keys use the zero-based input position, for example transcript-000.txt. Unavailable downloads are reported in artifact_errors.

## `savedResults` (type: `string`):

The item- collection includes signed item-NNN-result records and processing journals. A result record wraps the complete item in value; use result_record_key when a Dataset row contains only metadata. Access follows run-storage permissions.

# 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=zjkBMFhNj_g"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("andronixmd/youtube-transcript").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=zjkBMFhNj_g"] }

# Run the Actor and wait for it to finish
run = client.actor("andronixmd/youtube-transcript").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=zjkBMFhNj_g"
  ]
}' |
apify call andronixmd/youtube-transcript --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,andronixmd/youtube-transcript"
        }
    }
}
```

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/KlpKuF6x8Q75ZQ4Ao/builds/K5eDw8C3SLmUf27N9/openapi.json
