# YouTube Transcript Scraper (`guirie92/youtube-transcript-reliable`) Actor

Extract YouTube video transcripts (captions, subtitles) in bulk as text or timestamped JSON. No API key. Auto-retries around YouTube bot blocks. Pay only for successful transcripts.

- **URL**: https://apify.com/guirie92/youtube-transcript-reliable.md
- **Developed by:** [Guille Sanchez](https://apify.com/guirie92) (community)
- **Categories:** Videos, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$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/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: captions and subtitles to text or JSON

Extract the transcript (captions, subtitles) of any YouTube video as clean text, with optional timestamped segments. Works in bulk: paste a list of video URLs or IDs and get one result per video. No YouTube API key needed.

### Why use this one

- **Retries automatically.** YouTube often blocks cloud IPs with "confirm you're not a bot". Each failed request is retried on a fresh IP session (up to 6 times) instead of failing your whole batch.
- **Pay only for results.** You are charged per successfully extracted transcript. Videos without captions, private or removed videos are returned with an `error` field and cost nothing.
- **Language aware.** Pick a language (en, es, de, ...). Falls back to the closest available track and tells you whether captions are auto-generated.
- **Any link format.** watch URLs, youtu.be short links, Shorts, embeds, or bare 11-character video IDs.

### Input

| Field | Description |
|---|---|
| `videos` | List of YouTube URLs or video IDs |
| `language` | Preferred caption language code, default `en` |
| `includeSegments` | Add `start`, `duration`, `text` for each caption line |
| `proxyConfiguration` | Residential proxy recommended (default) |

### Output example

```json
{
  "videoId": "dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up",
  "channel": "Rick Astley",
  "language": "en",
  "isAutoGenerated": false,
  "availableLanguages": ["en", "de-DE", "ja"],
  "text": "We're no strangers to love ...",
  "segments": [{ "start": 18.4, "duration": 3.2, "text": "We're no strangers to love" }]
}
```

### Typical uses

Feed transcripts to an LLM or RAG pipeline, summarize videos, build search over video archives, research and content repurposing, subtitle datasets.

Only publicly available captions are extracted. Respect the rights of video owners and YouTube's terms when using the output.

# Actor input Schema

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

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

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

Language code, e.g. en, es, de. Falls back to the first available track if missing.

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

Add per-line start time and duration alongside the full text.

## `proxyConfiguration` (type: `object`):

Proxy used for requests. Residential proxies are the most reliable against YouTube blocking.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "language": "en",
  "includeSegments": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All extracted items.

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

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

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

```

## MCP server setup

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

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/PM7xNIambkteqOaER/builds/9KchBzje2NAmU52GK/openapi.json
