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

Get the full timestamped transcript of any YouTube video plus the list of available caption languages. Paste video links and get clean JSON with per-segment start, duration and text.

- **URL**: https://apify.com/xtracto/youtube-transcript.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** Videos, AI
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 92.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

Get the full timestamped transcript (subtitles/captions) of any YouTube video, plus the list of every language available for it, as clean JSON — no browser, no account, no API key.

### Why use this actor

- Full timestamped transcript — every line with its start time and duration, not just a wall of text
- Works on both human-made captions and auto-generated (speech-to-text) captions
- Returns the complete list of available caption languages for the video, even if you only need one
- One request per video — paste a link, get a ready-to-use transcript record
- Stable JSON output suitable for summarization pipelines, search indexing, or databases
- No sign-in, cookies, or API key required

### How it works

1. You give the actor one or more YouTube video links (or bare video IDs).
2. The actor reads the video's caption track list and picks the language you asked for (or the video's default language if you didn't specify one).
3. It fetches that caption track and returns every line as a `{start, dur, text}` segment, plus a single joined `fullText` string.
4. Results stream into your dataset, ready to download as JSON, CSV, or Excel.

You don't need to manage a browser, handle video playback, or know YouTube's internal language codes ahead of time — the actor lists them for you in every result.

### Input

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=8S0FDjFBj8o"
  ],
  "videoIds": [],
  "language": "en",
  "includeAutoGenerated": true,
  "maxConcurrency": 4
}
```

| Field | Type | Description |
|---|---|---|
| `videoUrls` | array | YouTube video links — watch links, `youtu.be` short links, Shorts, or embed links. |
| `videoIds` | array | Optional. Bare 11-character video IDs, if you already have IDs instead of full links. |
| `language` | string | Optional. Language code of the transcript you want (`en`, `es`, `fr`, `pt-BR`, ...). Leave empty to use the video's default caption language. A close match is used if the exact code isn't found (e.g. `en` matches `en-US`). |
| `includeAutoGenerated` | boolean | Default `true`. When on, auto-generated (speech-to-text) captions are used if no human-made caption track exists. Turn off to only accept human-made captions. |
| `maxConcurrency` | integer | Default `4`. How many videos to fetch in parallel. |
| `proxyConfiguration` | object | Optional. Not needed for most runs — see **Reliability note** below for when to turn one on. |

### Output

One record per video. Real sample, captured live from an actual run on the Apify platform:

```json
{
  "_input": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "_source": "youtubei-android",
  "_scrapedAt": "2026-08-06T04:56:04Z",
  "videoId": "dQw4w9WgXcQ",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "author": "Rick Astley",
  "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "lengthSeconds": 213,
  "viewCount": 1801039951,
  "language": "en",
  "languageName": "English",
  "isAutoGenerated": false,
  "availableLanguages": [
    { "languageCode": "en", "name": "English", "kind": "manual" },
    { "languageCode": "en", "name": "English (auto-generated)", "kind": "asr" },
    { "languageCode": "de-DE", "name": "German (Germany)", "kind": "manual" },
    { "languageCode": "ja", "name": "Japanese", "kind": "manual" },
    { "languageCode": "pt-BR", "name": "Portuguese (Brazil)", "kind": "manual" },
    { "languageCode": "es-419", "name": "Spanish (Latin America)", "kind": "manual" }
  ],
  "segmentCount": 61,
  "transcript": [
    { "start": 1.36, "dur": 1.68, "text": "[♪♪♪]" },
    { "start": 18.64, "dur": 3.24, "text": "♪ We're no strangers to love ♪" },
    { "start": 22.64, "dur": 4.32, "text": "♪ You know the rules\nand so do I ♪" },
    { "start": 27.04, "dur": 4, "text": "♪ A full commitment's\nwhat I'm thinking of ♪" }
    // ... 57 more
  ],
  "fullText": "[♪♪♪] ♪ We're no strangers to love ♪ ♪ You know the rules and so do I ♪ ♪ A full commitment's what I'm thinking of ♪ ♪ You wouldn't get this from any other guy ♪ ♪ I just wanna tell you how I'm feeling ♪ ♪ Gotta make you understand ♪ ♪ Never gonna give you up ♪ ♪ Never gonna let you down ♪ ♪ Never g..."
}
```

| Field | Type | Description |
|---|---|---|
| `videoId` | string | The 11-character YouTube video ID. |
| `videoUrl` | string | Canonical watch URL for the video. |
| `title` / `author` / `channelId` | string | Video title, channel name, and channel ID. |
| `lengthSeconds` | integer | Video duration in seconds. |
| `viewCount` | integer | View count at scrape time. |
| `language` / `languageName` | string | Language code and display name of the returned transcript. |
| `isAutoGenerated` | boolean | `true` if the transcript is YouTube's auto-generated speech-to-text, `false` if it's a human-made caption track. |
| `availableLanguages` | array | Every caption language available for the video, each with `languageCode`, `name`, and `kind` (`manual` or `asr`). |
| `segmentCount` | integer | Number of transcript segments returned. |
| `transcript` | array | Timestamped segments: `start` (seconds), `dur` (seconds), `text`. |
| `fullText` | string | All segments joined into one plain-text string. |

If a video has no captions at all, or the requested language isn't available, you get an error record instead (`_error`: `no_captions`, `language_not_available`, `not_playable`, etc.) with `availableLanguages` still included so you can retry with a language that exists.

### Reliability note

Transcript fetches work great from a normal residential connection. Shared cloud IP ranges are sometimes asked by YouTube to confirm they're not a bot, which shows up as a `not_playable` error with detail `LOGIN_REQUIRED`. If you see this often, turn on the **Proxy** input with a residential-type proxy group — it resolves the issue for the vast majority of videos.

***

#### Other actors in this collection

See the rest of the social-media actors in this portfolio for TikTok, Instagram, X (Twitter), Reddit, and more.

# Actor input Schema

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

YouTube video links. Accepts watch links, youtu.be short links, Shorts, and embed links. The transcript for each video is returned as one record.

## `videoIds` (type: `array`):

Optional. Bare 11-character YouTube video IDs (the part after v= in a link), if you already have IDs instead of full links.

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

Optional. Language code of the transcript you want, e.g. 'en', 'es', 'fr', 'pt-BR'. Leave empty to use the video's default caption language. If the exact code is not found, a close match is used (e.g. 'en' matches 'en-US').

## `includeAutoGenerated` (type: `boolean`):

When on, auto-generated (speech-to-text) captions are used if no human-made caption track is available. Turn off to only accept human-made captions.

## `maxConcurrency` (type: `integer`):

How many videos to fetch in parallel.

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

Optional. Not required for normal use — transcripts are fetched fine without a proxy. Enable a proxy only for region-restricted videos or very heavy volume.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=8S0FDjFBj8o"
  ],
  "videoIds": [],
  "language": "en",
  "includeAutoGenerated": true,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `title` (type: `string`):

Title of the item.

## `author` (type: `string`):

Author name.

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

Language code of the item.

## `isAutoGenerated` (type: `string`):

Is Auto Generated. Boolean value.

## `segmentCount` (type: `string`):

Segment Count. Whole number.

## `fullText` (type: `string`):

Full Text as reported by the source.

## `videoUrl` (type: `string`):

Link to the video.

## `_scrapedAt` (type: `string`):

UTC timestamp of the scrape, ISO 8601.

## `videoId` (type: `string`):

Video identifier.

## `channelId` (type: `string`):

Channel identifier.

## `lengthSeconds` (type: `string`):

Length Seconds.

## `viewCount` (type: `string`):

View count. Whole number.

## `languageName` (type: `string`):

Language Name as reported by the source.

## `availableLanguages` (type: `string`):

Available Languages.

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

Language Code as reported by the source.

## `name` (type: `string`):

Name of the item.

## `kind` (type: `string`):

Kind as reported by the source.

## `transcript` (type: `string`):

Transcript as reported by the source.

## `start` (type: `string`):

Start as reported by the source.

## `dur` (type: `string`):

Dur as reported by the source.

## `text` (type: `string`):

Text content of the item.

## `_input` (type: `string`):

The input value this row was produced from.

## `_source` (type: `string`):

Which extraction strategy produced the row.

## `_error` (type: `string`):

Set only on diagnostic rows - why that target produced no data.

## `_errorDetail` (type: `string`):

Extra context for the error.

# 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=8S0FDjFBj8o"
    ],
    "videoIds": [],
    "language": "en",
    "maxConcurrency": 4,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/youtube-transcript").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=8S0FDjFBj8o"],
    "videoIds": [],
    "language": "en",
    "maxConcurrency": 4,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("xtracto/youtube-transcript").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=8S0FDjFBj8o"
  ],
  "videoIds": [],
  "language": "en",
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call xtracto/youtube-transcript --silent --output-dataset

```

## MCP server setup

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

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/bEPdhfUvNunNRjIE7/builds/QrIgPtUhhPetcf8Ag/openapi.json
