# YouTube Transcript Scraper: Bulk Captions with Timestamps (`ensorcelling_melilot/youtube-transcripts`) Actor

Transcripts of many YouTube videos in one run: title, full text, timestamped segments, optional SRT and WebVTT, any caption language with optional translation. Videos without captions are free. $4 per 1,000 transcripts.

- **URL**: https://apify.com/ensorcelling_melilot/youtube-transcripts.md
- **Developed by:** [ensorcelling \_melilot](https://apify.com/ensorcelling_melilot) (community)
- **Categories:** Videos
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 transcript fetcheds

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 Scraper: Bulk Captions with Timestamps

Paste a list of YouTube videos and get a clean transcript for each one:

- **Full text** and **timestamped segments** (start and end in seconds)
- **SRT and WebVTT** text, ready to save as subtitle files
- **Any caption language**, with optional auto-translation
- Video title, word count and duration on every row
- Watch, youtu.be, Shorts, embed and live links, or plain video ids

No YouTube login, no API key, no proxies and no blocks to deal with. You pay only for transcripts returned: videos without captions appear in the output with a note and are free.

### Input

| Field | What to put |
|---|---|
| **Videos** | Up to 1,000 links or ids, one per line |
| **Caption language** | Two-letter code such as `en`, `de`, `es` (default English) |
| **Translate to** | Optional two-letter code to auto-translate the transcript |
| **Timestamped segments / SRT / WebVTT** | Switch the extra formats on or off |

### Output

One row per video:

```json
{
  "videoId": "jNQXAC9IVRw",
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "title": "Me at the zoo",
  "language": "en",
  "segmentCount": 6,
  "wordCount": 39,
  "durationSeconds": 18.88,
  "text": "All right, so here we are, in front of the elephants the cool thing ...",
  "segments": [{ "start": 1.2, "end": 3.36, "text": "All right, so here we are, in front of the elephants" }]
}
```

A run summary (saved, without captions, failed) is stored under the `OUTPUT` key of the key-value store.

### Pricing

$0.004 per transcript saved ($4 per 1,000). Videos with no captions, private or removed videos are not charged. Set a maximum cost per run and the Actor stops cleanly when it is reached.

### Notes

- Captions are what YouTube shows for the video: uploaded captions or YouTube's automatic ones. Videos with captions turned off have no transcript.
- Results come from a commercial data provider, not from your IP address, so large batches do not get blocked.
- Use transcripts in line with the video owner's rights and YouTube's terms.

# Actor input Schema

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

YouTube video links or 11-character video ids, one per line (up to 1,000). Watch, youtu.be, Shorts, embed and live links all work. Each video becomes one result row.

## `languageCode` (type: `string`):

Two-letter language code of the captions you want, such as en, de, es or fr. Leave empty for English.

## `translateTo` (type: `string`):

Two-letter language code to translate the transcript into using YouTube's auto-translation, such as es or ja. Leave empty to keep the original language.

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

Add a list of caption segments with start and end time in seconds. Turn off if you only need the full text.

## `includeSrt` (type: `boolean`):

Add the transcript in SRT format as a text field, ready to save as a .srt file.

## `includeVtt` (type: `boolean`):

Add the transcript in WebVTT format as a text field, ready to save as a .vtt file.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "languageCode": "en",
  "includeSegments": true,
  "includeSrt": false,
  "includeVtt": false
}
```

# Actor output Schema

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

One row per video: title, language, full text, word count and timestamped segments.

## `summary` (type: `string`):

How many transcripts were saved, how many videos had no captions or failed, and whether the run stopped at your cost limit.

# 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=jNQXAC9IVRw"
    ],
    "languageCode": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ensorcelling_melilot/youtube-transcripts").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=jNQXAC9IVRw"],
    "languageCode": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("ensorcelling_melilot/youtube-transcripts").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=jNQXAC9IVRw"
  ],
  "languageCode": "en"
}' |
apify call ensorcelling_melilot/youtube-transcripts --silent --output-dataset

```

## MCP server setup

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

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/DTwwjfL4ywcVzQFhj/builds/N0gMdx03ZzNS67eNP/openapi.json
