# YouTube Transcript & Subtitle Extractor (AI Markdown) (`abzalp/youtube-transcript-extractor`) Actor

Extract clean YouTube video transcripts, subtitles, and chapters in formatted Markdown and JSON. Ready for ChatGPT, Claude, and LLMs with language fallback.

- **URL**: https://apify.com/abzalp/youtube-transcript-extractor.md
- **Developed by:** [Abdul Basit](https://apify.com/abzalp) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 transcript extracteds

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/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 Clean Transcript & Chapter Extractor

[![Apify Store](https://img.shields.io/badge/Apify%20Store-Run%20Actor-FF9800?style=for-the-badge\&logo=apify\&logoColor=white)](https://apify.com/abzalp/youtube-transcript-extractor)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)](LICENSE)
[![Free Tier Supported](https://img.shields.io/badge/Free%20Tier-5%20USD%20Monthly-brightgreen?style=for-the-badge)](https://apify.com/abzalp/youtube-transcript-extractor)

> 🚀 **[Run this Actor on Apify Store](https://apify.com/abzalp/youtube-transcript-extractor)** — Instant cloud execution with zero setup, zero proxies needed, and free monthly credits.

Extract clean, structured video transcripts, timestamps, and chapters from any YouTube video in seconds. Formatted in beautiful **Markdown** ready to feed directly into **ChatGPT, Claude, NotebookLM, or RAG AI pipelines**, with full raw JSON data included.

***

### ⚡ Why Use This Instead of Other Transcript Scrapers?

Most YouTube transcript scrapers dump thousands of lines of unformatted, broken text with missing timestamps and fail on non-English subtitles.

- **✨ Formatted Markdown for AI:** Outputs structured Markdown with video metadata, chapter headings, and timestamps. Perfect for one-click pasting into LLMs.
- **📑 Chapter Detection:** Automatically parses video chapters from the description and groups the transcript under each chapter title.
- **🌐 Multi-Language with Fallback:** Select your preferred language (English, Spanish, German, etc.). If manual subtitles are unavailable, it automatically falls back to auto-generated captions.
- **⚡ Blazing Fast & Lightweight:** Fetches subtitles directly via lightweight HTTP requests without running slow, memory-heavy browsers. Runs in 1–2 seconds per video.
- **💰 Cost-Effective:** Charges only **$0.005 per transcript** ($5 per 1,000 videos).

***

### 📥 Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `videoUrls` | Array | `["https://www.youtube.com/watch?v=jNQXAC9IVRw"]` | List of YouTube URLs (standard, youtu.be, shorts, embeds) or video IDs. |
| `preferredLanguage` | String | `"en"` | Subtitle language code (e.g., `en`, `es`, `fr`, `de`, `ja`, `pt`). |
| `includeTimestamps` | Boolean | `true` | Include `[MM:SS]` timestamps in the Markdown transcript text. |
| `maxVideos` | Integer | `100` | Maximum number of videos to process in one run. |

***

### 📤 Output Dataset Format

For each video, the Actor outputs:

```json
{
  "videoId": "jNQXAC9IVRw",
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "title": "Me at the zoo",
  "author": "jawed",
  "channelUrl": "https://www.youtube.com/channel/UC4QobU6ST3KWwg8C2YLn5vg",
  "duration": 19,
  "language": {
    "code": "en",
    "name": "English"
  },
  "chaptersCount": 0,
  "chapters": [],
  "wordCount": 54,
  "segmentsCount": 6,
  "markdown": "# Me at the zoo\n- **Channel:** jawed\n- **Duration:** 00:19\n- **Language:** English\n- **URL:** https://www.youtube.com/watch?v=jNQXAC9IVRw\n\n## Transcript\n[00:01] All right, so here we are, in front of the elephants...\n[00:05] the cool thing about these guys is that they have really...\n[00:07] really really long trunks...",
  "plainText": "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...",
  "segments": [
    {
      "startMs": 1200,
      "durationMs": 4118,
      "timestamp": "00:01",
      "text": "All right, so here we are, in front of the elephants"
    }
  ],
  "extractedAt": "2026-11-28T14:40:00.000Z"
}
```

***

### 💡 How to Use the Markdown with AI

Simply export the dataset as Markdown or copy the `markdown` field and paste it directly into your prompt:

> *"Here is the transcript of a video I watched. Please summarize the key takeaways and list the action items: \n\n\[PASTE MARKDOWN HERE]"*

***

### ⚖️ Legal & Privacy Notice

This Actor extracts publicly available captions and subtitle tracks provided by content creators and YouTube. It does not access private videos or collect personal user data. Users are responsible for complying with applicable copyright and local data privacy laws (e.g. GDPR).

***

### 🔗 Related Developer Tools & Ecosystem

Extend your automation workflows with our companion tools on the Apify Store:

- 📄 **[YouTube Transcript & Subtitle Extractor](https://apify.com/abzalp/youtube-transcript-extractor)** — Extract clean video transcripts in Markdown & JSON for AI and LLMs.
- 📊 **[Google Sheets Sync & Importer](https://apify.com/abzalp/google-sheets-sync)** — Automatically export and append Apify dataset rows directly to Google Sheets.
- 📑 **[Dataset to Excel Report Generator](https://apify.com/abzalp/dataset-to-excel-report)** — Convert raw scraping datasets into styled, formatted Excel (.xlsx) reports with auto-filters.
- 📸 **[Website Screenshot & PDF Capture API](https://apify.com/abzalp/website-screenshot)** — Capture full-page screenshots and PDFs with mobile/retina presets and ad-blocking.
- 🖼️ **[AI Image Upscaler & Enhancer](https://apify.com/abzalp/ai-image-upscaler)** — Upscale low-resolution photos and images to 4K Ultra HD.
- 🎥 **[Video Compressor & Audio Extractor](https://apify.com/abzalp/video-compressor-converter)** — Fast video compression, format conversion, and clean MP3 audio extraction.

# Actor input Schema

## `videoUrls` (type: `array`):

Enter YouTube video URLs (standard, youtu.be, shorts, embed) or raw 11-character video IDs.

## `preferredLanguage` (type: `string`):

Language code for subtitles (e.g., 'en', 'es', 'de', 'fr', 'pt', 'ja'). If the preferred language is not available, it automatically falls back to available captions.

## `includeTimestamps` (type: `boolean`):

Whether to prefix transcript segments with timestamps like \[01:25]. Keep enabled for AI referencing and timestamps.

## `maxVideos` (type: `integer`):

Safety limit for total videos processed in a single run.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "preferredLanguage": "en",
  "includeTimestamps": true,
  "maxVideos": 100
}
```

# Actor output Schema

## `transcripts` (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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ]
};

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

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

```

## MCP server setup

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

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/YUFkJgx4fLFE3KX8E/builds/0kFeEA5OBcYEk7k5Y/openapi.json
