# YouTube Transcript Master Lite \[EASY] (`zerohour/yt-transcript-lite`) Actor

Pay per result! Get YouTube transcripts and captions by bulk via channel, playlist, and video URLs. A "lite" version of YouTube Transcript Master.

- **URL**: https://apify.com/zerohour/yt-transcript-lite.md
- **Developed by:** [Zerohour](https://apify.com/zerohour) (community)
- **Categories:** Automation, Videos, Developer tools
- **Stats:** 29 total users, 15 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 transcripts

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

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

## 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 Master (Lite)

#### Pay Per Results

This Lite Actor extracts **plain text transcripts** from YouTube videos using a mix of sources like: channel URLs, playlist URLs, and video URLs. It fetches video metadata (title, duration, upload date) alongside the text transcript.

⭐ **This is the Lite version of [YouTube Transcript Master](https://apify.com/zerohour/yt-transcript)**

***

<h2 id="features">🌟 Features</h2>

- Retrieve **plain text transcripts in bulk** with a mix of inputs like: YouTube channels, playlists, or individual video links.
- Extracts video title, duration, and upload date.
- Supports specifying the desired transcript **language**.
- Uses **efficient** HTML scraping minimizing CPU usage.
- Includes enhanced retry logic for network requests to improve **reliability**.
- Optionally uses Apify's residential proxies for **consistent results**.
- Allows setting a **maximum number of videos** to process.

***

<h2 id="input-schema">⚙️ Input</h2>

The actor takes a JSON object as input with the following properties:

| Field                | Type      | Description                                                                                                                                 | Required | Default |
| :------------------- | :-------- | :------------------------------------------------------------------------------------------------------------------------------------------ | :------- | :------ |
| `sources`            | `Array`   | A list of YouTube URLs. Can include video URLs (`watch?v=`), playlist URLs (`playlist?list=`), or channel URLs (`@handle`, `/c/`, `/user/`). | Yes      | `[]`    |
| `maxVideos`          | `Integer` | Optional. Limit the number of videos processed. If set, the actor stops after processing this many videos. Leave empty or set to 0 for no limit. | No       | `0`     |
| `language`           | `String`  | The two-letter language code for the desired transcript (e.g., `en`, `es`, `de`).                                                           | No       | `"en"`  |
| `useApifyProxy`      | `Boolean` | If `true`, uses Apify's residential proxies for fetching. Highly recommended to avoid blocks. If `false`, uses the container's direct IP.   | No       | `true`  |
| `delayBetweenVideos` | `Integer` | An optional delay in milliseconds to wait between processing each video. Useful for mitigating rate limits on very large lists.               | No       | `3000`  |

#### Input Example

```json
{
    "sources": [
        "https://www.youtube.com/watch?v=b_nep8vMnkc",
        "https://www.youtube.com/@Apify",
        "https://www.youtube.com/playlist?list=PLObrtcm1Kw6PEnu5BpeEFb8XEoQXMw0g7"
    ],
    "maxVideos": 100, // Optional limit
    "language": "en", // Two letter language codes: 'es', 'fr', 'pl', etc.
    "useApifyProxy": true,
    "delayBetweenVideos": 3000 // Milliseconds
}
```

***

<h2 id="output-example">📥 Output</h2>

The actor outputs data to the default Apify dataset. Each item in the dataset represents a processed video and has the following structure:

| Field       | Type            | Description                                                                                     |
| :---------- | :-------------- | :---------------------------------------------------------------------------------------------- |
| `url`       | `String`        | The original YouTube video URL processed.                                                       |
| `language`  | `String`        | The language code requested for the transcript.                                                 |
| `title`     | `String`        | The title of the video (`N/A` or 'Processing Error' if extraction failed).                      |
| `duration`  | `Integer`       | The duration of the video in seconds (`0` or `-1` if extraction failed).                        |
| `videoLink` | `String`        | Same as `url`, provided for convenience.                                                        |
| `uploadDate`| `String`|`null` | The publication date of the video (YYYY-MM-DD format), if found.                              |
| `text`      | `String`|`null` | The plain text transcript, if found (with improved handling for `\"`).                         |
| `error`     | `String`|`null` | An error message if processing the video or fetching the transcript failed for this video.     |
| `details`   | `String`|`null` | Additional error details (like HTTP status code or stack trace) if an error occurred.        |

#### Output Example (Success)

```json
{
  "url": "https://www.youtube.com/watch?v=b_nep8vMnkc",
  "language": "en",
  "title": "Example Video Title",
  "duration": 123,
  "videoLink": "https://www.youtube.com/watch?v=b_nep8vMnkc",
  "uploadDate": "2023-10-27",
  "text": "This is the extracted plain text transcript...",
  "error": null,
  "details": null
}
```

#### Output Example (Failure - general processing error)

```json
{
  "url": "https://www.youtube.com/watch?v=invalidVideoId",
  "language": "en",
  "title": "Processing Error",
  "duration": -1,
  "videoLink": "https://www.youtube.com/watch?v=invalidVideoId",
  "uploadDate": null,
  "text": null,
  "error": "Failed to process: Failed to extract valid playerResponse from HTML after 2 attempts.",
  "details": "Error: Failed to extract valid playerResponse from HTML after 2 attempts.\n    at processVideos (/actor/main.js:266:23)\n    at ..."
}
```

***

<h2 id="usage-notes">📝 Usage Notes</h2>

- **Recent Uploads:** Recently uploaded videos may not have transcripts available immediately.
- **Private or Deleted Videos:** Attempting to process these videos will result in errors.
- **Live Streams:** Processing live or upcoming streams may result in errors or incomplete data, as transcripts are generated after the stream concludes.

***

<h2 id="support">💬 Support</h2>

If you encounter issues or have questions, please refer to the actor's logs or contact me @ https://x.com/t\_zerohour.

***

# Actor input Schema

## `sources` (type: `array`):

List of YouTube channels, playlists, and/or video URLs

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

Optional. Limit the number of videos processed. If set, the actor will stop after processing this many videos, even if more were found. Leave empty or set to 0 for no limit.

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

Two-letter language code (e.g., 'en' for English, 'es' for Spanish) for the desired transcript.

## `useApifyProxy` (type: `boolean`):

Enable Apify's residential proxy for best results. If disabled, requests will use the container's direct IP and are more likely to be blocked.

## `delayBetweenVideos` (type: `integer`):

Delay between processing each video in milliseconds to avoid rate limiting.

## Actor input object example

```json
{
  "sources": [
    "https://www.youtube.com/watch?v=Ncj9673eF0E"
  ],
  "maxVideos": 0,
  "language": "en",
  "useApifyProxy": true,
  "delayBetweenVideos": 3000
}
```

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

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

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

```

## MCP server setup

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

```

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/hsSCn9sjguCdd5492/builds/dFlGswA9j2AvcDgnP/openapi.json
