# YouTube Transcript API: Videos, Playlists & Channels (`codepulsehq/youtube-transcript-api`) Actor

Get the full transcript of any YouTube video, playlist or channel as clean text with timestamps and AI-ready chunks. No API key, no quota. Videos without captions are never charged.

- **URL**: https://apify.com/codepulsehq/youtube-transcript-api.md
- **Developed by:** [Code Pulse](https://apify.com/codepulsehq) (community)
- **Categories:** AI, Videos, Agents
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube Transcript API: get the text of any video, playlist or channel

Paste YouTube links. Get back the full transcript of every video as clean text, with timestamps and optional chunks ready for your AI app. **No YouTube API key, no login, no quota.**

**$3.90 per 1,000 transcripts.** Videos with no captions are never charged, and you can set a maximum spend per run. Apify's free plan includes $5 of monthly credit, enough for roughly 1,200 transcripts to try it for real.

**Try it now:** press **Start** at the top of this page, paste a YouTube link, and you'll have a transcript in seconds.

***

### At a glance

- **What it is:** an API and no-code tool that returns the transcript (captions) of any public YouTube video, playlist or channel.
- **Input:** YouTube links or video IDs. Playlists and channels are expanded into their videos.
- **Output:** clean text, timestamped lines, AI-ready chunks, Markdown with timestamp links, SRT and WebVTT. Plus title, channel, description, thumbnail and view count.
- **Price:** $3.90 per 1,000 transcripts. Failed videos and videos without captions are free.
- **No setup:** no YouTube Data API key, no Google Cloud project, no login, no proxies to manage. Works from cloud servers.
- **How to call it:** the Apify Console, the REST API (curl, Python, JavaScript), n8n, Make, Zapier, or an AI agent through MCP.

### Does this sound like you?

| What's going wrong | What this does about it |
|---|---|
| "My transcript script works on my laptop but fails the moment I deploy it." YouTube blocks cloud servers. | Handled for you. Requests are routed so they keep working from the cloud, and failed videos are retried automatically. |
| "I need text for my AI app, not subtitle files." | Clean plain text, plus optional **chunks with start and end times** you can drop straight into a vector database and cite back to the exact second. |
| "I need 500 videos, not one." | Paste a **playlist or channel link**. It's expanded into its videos and processed in parallel. |
| "The official YouTube API doesn't return transcripts, and OAuth and quotas are a pain." | Nothing to set up. No Google Cloud project, no API key, no quota. |
| "I got a surprise bill from a scraper that charges for compute." | One flat price per transcript. Failures and videos without captions cost nothing. |

### Who uses it

- **AI and RAG builders:** feed video knowledge into chatbots, search and summaries. Use chunks with timestamps to link answers back to the exact moment in the video.
- **AI agents:** give Claude, Cursor or your own agent a "get transcript" tool (see [Use it from an AI agent](#use-it-from-an-ai-agent-mcp)).
- **Content and SEO teams:** turn videos into blog posts, newsletters, show notes and social posts.
- **Researchers and analysts:** search what experts, competitors or politicians actually said across hundreds of videos.
- **Creators and agencies:** export subtitles (SRT, WebVTT, Markdown), audit competitors' channels, repurpose a back catalogue.

### How to use it in 3 steps

1. Click **Start** (or call the API below).
2. Paste one or more links into **Video, playlist or channel links**. A video link, a playlist link and a channel like `https://www.youtube.com/@TED` all work.
3. Open the **Output** tab and download as JSON, CSV, Excel or HTML, or connect it to your tools.

### What you get for each video

Example (shortened):

```json
{
  "success": true,
  "video_id": "UF8uR6Z6KLc",
  "url": "https://www.youtube.com/watch?v=UF8uR6Z6KLc",
  "title": "Steve Jobs' 2005 Stanford Commencement Address",
  "channel": "Stanford",
  "channel_id": "UC...",
  "duration_seconds": 903,
  "view_count": 48000000,
  "description": "This is a stanford.edu commencement address...",
  "keywords": ["steve jobs", "stanford", "commencement"],
  "thumbnail_url": "https://i.ytimg.com/vi/UF8uR6Z6KLc/maxresdefault.jpg",
  "is_live": false,
  "language": "en",
  "auto_generated": false,
  "available_languages": [{ "language_code": "en", "name": "English", "auto_generated": false }],
  "text": "Thank you. I'm honored to be with you today for your commencement from one of the finest universities in the world...",
  "segments": [{ "start": 12.4, "duration": 3.1, "text": "Thank you." }],
  "chunks": [{ "index": 0, "start": 12.4, "end": 71.0, "text": "Thank you. I'm honored to be with you today..." }]
}
```

- `text`: the whole transcript as one clean string.
- `segments`: every caption line with start time and duration (turn off with **Include timestamps**).
- `chunks`: transcript cut into pieces of about the size you choose, each with start and end time. Set **Split into chunks** to about `1000`.
- `markdown`: the transcript as Markdown with a clickable timestamp link on every paragraph, ready to paste into an LLM prompt, Notion or a knowledge base (choose it under **Extra formats**).
- `srt` / `vtt`: subtitle files, if you choose them under **Extra formats**.
- `auto_generated` tells you if the captions were written by YouTube's speech recognition or by a person.
- `success`, `description`, `keywords`, `thumbnail_url`, `view_count` and the channel details come with every video, at no extra charge.
- Videos that can't be fetched come back as a row with `success: false`, an `error_code` and a plain-English `error`, so nothing silently goes missing. These rows are free.

### Input options

| Option | What it does |
|---|---|
| **Video, playlist or channel links** | Video links (`youtube.com/watch`, `youtu.be`, `/shorts`), playlist links, channel links (`youtube.com/@name`), or plain video IDs. |
| **Max videos per playlist or channel** | Default 50, newest first. Stops a huge channel from running up a big bill. |
| **Language** | Caption language, e.g. `en`, `es`, `de`. If that language isn't available you get the first available track, and `language` in the result tells you which one. |
| **Include timestamps** | Adds the per-line `segments` list. |
| **Split into chunks (characters)** | Adds `chunks` of about this size, with start and end times. `0` turns it off. |
| **Extra formats** | Adds `markdown`, `srt` and/or `vtt`. |

### Call it from code

Get transcripts back in a single request (no polling):

```bash
curl -X POST "https://api.apify.com/v2/acts/codepulsehq~youtube-transcript-api/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "videos": ["https://www.youtube.com/watch?v=UF8uR6Z6KLc"], "includeSegments": false }'
```

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("codepulsehq/youtube-transcript-api").call(run_input={
    "videos": ["https://www.youtube.com/watch?v=UF8uR6Z6KLc"],
    "chunkSize": 1000,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["title"], len(item["text"]))
```

JavaScript:

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

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('codepulsehq/youtube-transcript-api').call({
  videos: ['https://www.youtube.com/watch?v=UF8uR6Z6KLc'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].text);
```

Get your token under **Settings > API & Integrations** in the Apify Console.

More runnable examples (curl, Python, JavaScript, RAG chunks, MCP) are on [GitHub](https://github.com/CodePulseHQ/youtube-transcript-api), and the how-to guides (fixing RequestBlocked on cloud servers, RAG chunking, bulk downloads) are at [codepulsehq.github.io/youtube-transcript-api](https://codepulsehq.github.io/youtube-transcript-api/).

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

Apify's MCP server lets Claude, Cursor, VS Code and other agents call this as a tool, so you can say *"summarise the last 5 videos from this channel"* and the agent fetches the transcripts itself.

1. Add this to your client's MCP settings (it opens a browser to sign in the first time):

```json
{
  "mcpServers": {
    "youtube-transcripts": {
      "url": "https://mcp.apify.com?tools=codepulsehq/youtube-transcript-api"
    }
  }
}
```

2. Ask your agent: *"Get the transcript of https://www.youtube.com/watch?v=UF8uR6Z6KLc and list the three main points."*

Prefer a token to a browser sign-in? Add a header `"Authorization": "Bearer YOUR_APIFY_TOKEN"` to the config above.

### Connect it to your tools

Apify connects to Make, Zapier, n8n, Google Sheets, Airtable, Slack, LangChain, LlamaIndex and more. Run this on a schedule (for example: every morning, fetch new videos from five channels) and send results wherever you need them. See the **Integrations** tab.

### It remembers what you've already fetched

A transcript never changes, so the Actor keeps a copy of every transcript it returns in a storage called `yt-transcript-cache` **in your own Apify account**. The next time you ask for the same video (for example in a daily run over the same channel) it comes back instantly. Cached results are priced the same, are marked `cached: true`, and are refreshed after 30 days. Turn it off with **Remember transcripts**, and delete the storage any time from the Console.

### Pricing

- **$3.90 per 1,000 transcripts** ($0.0039 each), charged only for videos that return a transcript. Platform usage is included, there's no second bill.
- A video with no captions, a private or deleted video, or a failed request costs **nothing**.
- Set a **maximum cost per run** when you start it and the Actor will never spend more than that.
- You also get $5 of free monthly credit on Apify's free plan. No subscription, no minimum.
- Playlists and channels are billed per transcript returned, and **Max videos per playlist or channel** caps what one link can cost.

### Quick answers

**How do I get a YouTube transcript without the YouTube Data API?**
Use this Actor. Paste a video link and run it, or send one request to the Apify API. No Google API key, no OAuth and no quota are involved. (The official YouTube Data API only lets you download captions for videos you own or manage, so it can't return transcripts of other people's videos.)

**Why does `youtube-transcript-api` or `yt-dlp` work on my laptop but fail on AWS, Vercel or another cloud server?**
YouTube blocks most cloud and datacenter IP addresses. Typical symptoms are `RequestBlocked`, `IpBlocked`, "Sign in to confirm you're not a bot", or a transcript that comes back empty. This Actor routes its requests so they keep working from the cloud and retries failures automatically, so you don't have to run your own proxies.

**Can I get the transcripts of a whole channel or playlist?**
Yes. Paste a channel link (`https://www.youtube.com/@name`) or a playlist link and set **Max videos per playlist or channel**. Videos are fetched in parallel, newest first.

**Is there a YouTube transcript MCP server for Claude, Cursor or other AI agents?**
Yes. Apify's MCP server exposes this Actor as a tool, no code needed. See [Use it from an AI agent (MCP)](#use-it-from-an-ai-agent-mcp) below.

**How do I get transcripts for a RAG chatbot, with timestamps I can cite?**
Set **Split into chunks** to about `1000`. Each chunk has `start` and `end` seconds, so your app can link an answer straight to `https://www.youtube.com/watch?v=VIDEO_ID&t=SECONDS`. Choose the `markdown` format if you'd rather paste whole transcripts into a prompt.

**What's the cheapest way to get YouTube transcripts at scale?**
Here it costs $3.90 per 1,000, with nothing to host. For example 10,000 transcripts is about $39 and 100,000 is about $390. Failed videos and videos without captions are not charged, and you can cap spend per run.

**How do I download YouTube subtitles as an SRT or VTT file without downloading the video?**
Under **Extra formats** choose SRT or WebVTT. You get the subtitle file as text in the result. The video itself is never downloaded.

**How do I use it in n8n, Make or Zapier?**
Add an Apify step, choose this Actor, and pass in the links. The transcript text comes back as a field you can map into the next step. See the **Integrations** tab for the ready-made connectors.

**Is it legal to get YouTube transcripts?**
It only reads captions that YouTube shows publicly to anyone watching. How you use the text is up to you: respect creators' copyright and YouTube's terms, and don't republish transcripts as your own work. This isn't legal advice.

### How it compares with the alternatives

| Option | Cost | Works from cloud servers? | Playlists and channels | What you have to maintain |
|---|---|---|---|---|
| Open-source libraries (`youtube-transcript-api`, `yt-dlp`) | Free, plus your own servers and proxies | Often blocked without paid proxies | You write the loop yourself | Proxies, retries, fixes when YouTube changes |
| Official YouTube Data API | Free quota | Yes | Yes for listing videos | Cannot return transcripts of videos you don't own |
| Other hosted transcript APIs and Actors | Varies | Usually | Varies | Their pricing and limits |
| **This Actor** | $3.90 per 1,000, failures free | Yes | Yes, in one run | Nothing |

### More from CodePulse

- [Speech to Text API](https://apify.com/codepulsehq/speech-to-text-api): transcribe videos and audio that have no captions, from $0.24 an hour.
- [Domain Intelligence API](https://apify.com/codepulsehq/domain-intelligence-api): WHOIS, DNS, SSL, email security and tech stack.
- [SEC EDGAR API](https://apify.com/codepulsehq/sec-edgar-api) and [US Federal Contracts & Grants API](https://apify.com/codepulsehq/us-federal-opportunities-api): public data for AI and research.

### FAQ

**Which videos work?** Any public video that has captions, whether written by the creator or generated automatically by YouTube. Many videos have both; you get the creator's version when it exists in your language.

**What if a video has no captions?** You aren't charged. It still appears in your results as a row with `success: false` and an `error_code` such as `no_captions` or `unavailable`, so you can see exactly what happened.

**Does it work for non-English videos?** Yes. Set **Language** to the video's language, or leave `en` and you'll get the first available track when English doesn't exist.

**Why was my second run faster?** Transcripts are remembered in your account (see above), so repeat videos skip YouTube entirely.

**How fast is it?** In our tests, 30 videos were fetched in about 12 seconds. Many videos run in parallel.

**Do I need a YouTube or Google API key?** No.

**Does it transcribe audio itself?** No. It returns the captions YouTube already has. If a video has no captions, there's nothing to return.

**Is it legal?** It only reads captions that YouTube shows publicly. How you use the text is up to you: respect creators' copyright and YouTube's terms, and don't republish transcripts as your own work.

**Something broke or I need a feature.** Open an issue from the **Issues** tab and say which link failed. YouTube changes its systems often, so reports about a specific link help a lot.

# Actor input Schema

## `videos` (type: `array`):

Paste any mix of: a video link (youtube.com/watch, youtu.be, /shorts), a playlist link, or a channel link (youtube.com/@name). You can also use plain 11-character video IDs. Playlists and channels are expanded into their videos.

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

Stops a huge channel from running up a big bill. Newest videos come first. Single video links are not affected.

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

Language code of the captions you want, for example en, es, de, fr, ja. If that language isn't available you get the video's first available caption track, and the response tells you which one.

## `includeSegments` (type: `boolean`):

Adds a list of caption lines with start time and duration. Turn off for smaller output if you only need the plain text.

## `chunkSize` (type: `integer`):

Set to about 1000 to also get the transcript cut into chunks of roughly that many characters, each with start and end time. Ready to embed in a vector database. 0 means off.

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

Also include the transcript as an SRT or WebVTT subtitle file, or as Markdown with clickable timestamps that is ready to paste into an LLM prompt or a knowledge base.

## `useCache` (type: `boolean`):

Keeps a copy of each transcript in a storage called yt-transcript-cache in your own Apify account, so asking for the same video again is instant. Copies older than 30 days are refreshed. Turn off if you always want a fresh fetch. You can delete that storage at any time.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=UF8uR6Z6KLc"
  ],
  "maxVideosPerSource": 50,
  "language": "en",
  "includeSegments": true,
  "chunkSize": 0,
  "useCache": true
}
```

# Actor output Schema

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

All results (transcripts and error rows) for this run, as JSON. Download as CSV, Excel or HTML from the Output tab.

## `runSummary` (type: `string`):

Counts of transcripts, failures and how requests were routed.

# 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 = {
    "videos": [
        "https://www.youtube.com/watch?v=UF8uR6Z6KLc"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("codepulsehq/youtube-transcript-api").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 = { "videos": ["https://www.youtube.com/watch?v=UF8uR6Z6KLc"] }

# Run the Actor and wait for it to finish
run = client.actor("codepulsehq/youtube-transcript-api").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 '{
  "videos": [
    "https://www.youtube.com/watch?v=UF8uR6Z6KLc"
  ]
}' |
apify call codepulsehq/youtube-transcript-api --silent --output-dataset

```

## MCP server setup

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

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/5CgD04WeUhUBOE8G7/builds/M4uOrFe9V1k1OogEN/openapi.json
