# YouTube Subtitles Scraper (`igview-owner/youtube-subtitles-scraper`) Actor

Powerful YouTube subtitles scraper for developers and agencies. Programmatically fetch all caption tracks (including auto‑generated) and export them as SRT, VTT, JSON, or plain text for SEO, analytics, and content repurposing.

- **URL**: https://apify.com/igview-owner/youtube-subtitles-scraper.md
- **Developed by:** [Sachin Kumar Yadav](https://apify.com/igview-owner) (community)
- **Categories:** Developer tools, Automation, SEO tools
- **Stats:** 11 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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 Subtitles Scraper 🎬🧾

Fetch subtitles / caption tracks from YouTube videos and save clean, structured data directly to your Apify dataset. This actor processes a single YouTube video and returns all available subtitle tracks (languages) in the format you choose.

***

#### 📚 Table of Contents

1. [Overview](#overview)
2. [Key Features](#key-features)
3. [When to Use This Actor](#when-to-use-this-actor)
4. [Input Parameters](#input-parameters)
5. [Output Data](#output-data)
6. [How to Use on Apify](#how-to-use-on-apify)
7. [Examples](#examples)
8. [Best Practices](#best-practices)
9. [FAQ](#faq)
10. [Tags](#tags)

***

#### 🔎 Overview

The **YouTube Subtitles Scraper** actor makes it easy to:

- Fetch **subtitle / caption tracks** for a single YouTube video
- Choose the **subtitle format** that best fits your workflow (JSON / XML / text)
- Optionally filter tracks by **language code** (e.g. `en`, `hi`, `es`)
- Save one **dataset item per subtitle track**, including the language and direct subtitle URL

You can export the dataset to **JSON, CSV or Excel** and plug it into your own tools, dashboards, NLP/AI pipelines or automations.

***

#### ✨ Key Features

- **Flexible input** – accepts either a full YouTube URL or just the video ID
- **Multiple subtitle formats** – `json3`, `srv1`, `srv2`, `srv3`, `ttml`, `vtt`, `srt`
- **Language filtering** – only keep the languages you care about
- **Clean, structured output** – one row per subtitle track with consistent fields
- **Clear error messages** – failures are stored as simple, readable error items

***

#### 🎯 When to Use This Actor

Use this actor when you want to:

- Build a **subtitle dataset** for NLP, translation, or transcription projects
- Collect subtitles in **multiple languages** for the same YouTube video
- Export subtitles for **caption editing tools** or localization workflows
- Quickly check which **subtitle languages** are available for a given video

***

#### ⚙️ Input Parameters

Your input lives in the actor's `INPUT` store and is controlled by the Apify UI form.

| Field | Type | Required | Description |
|------|------|----------|-------------|
| `videoId` | string | **Yes** | YouTube video ID or full video URL. The actor automatically extracts the video ID. Must be a valid YouTube video link or ID. |
| `format` | string | No | Subtitle format. Default is `srv1` (XML). |
| `languageFilter` | array of strings | No | Optional list of language codes to keep, e.g. `["en", "hi"]`. If empty or omitted, all languages are returned. |

**Notes**

- `videoId` accepts both:
  - Full URL: `https://www.youtube.com/watch?v=WKHKy89QaV0`
  - Raw ID: `WKHKy89QaV0`
- `format` can be one of:
  - `json3`, `srv1`, `srv2`, `srv3`, `ttml`, `vtt`, `srt`

***

#### 📤 Output Data

Each successful dataset item represents **one subtitle track** for the requested video.

| Field | Type | Description |
|------|------|-------------|
| `videoId` | string | YouTube video ID. |
| `videoUrl` | string | Full video URL (`https://www.youtube.com/watch?v=...`). |
| `format` | string | Subtitle format. |
| `languageName` | string | Human-readable language name, e.g. `English`. |
| `languageCode` | string | Language code, e.g. `en`. |
| `isTranslatable` | boolean | Whether this subtitle track can be auto-translated by YouTube. |
| `subtitleUrl` | string | Direct URL to the subtitle file in the requested format. |
| `createdAt` | string | ISO timestamp when the actor created this item. |

If the actor cannot fetch subtitles for the video, you will instead see an **error item** like this:

| Field | Type | Description |
|------|------|-------------|
| `videoId` | string | YouTube video ID. |
| `videoUrl` | string | Full video URL. |
| `status` | string | Always `failed` for error items. |
| `error` | string | Simple, human-readable error message. |
| `httpStatus` | number | null | HTTP status code returned by the subtitles service, if available. |
| `createdAt` | string | ISO timestamp when the error was recorded. |

You can see the exact schema in the **Output schema** tab on Apify or by inspecting a sample dataset item after a run.

***

#### 🚀 How to Use on Apify

1. **Open the actor** on Apify.
2. Click **Run**.
3. In the input form:
   - Paste a **YouTube video URL or ID** into the `videoId` field.
   - (Optional) Choose your desired `format` (default is `srv1`).
   - (Optional) Add `languageFilter` codes if you only want specific languages.
4. Start the run.
5. When the run finishes, open the **Dataset** tab to see the subtitle tracks.
6. Export the dataset as **JSON, CSV or Excel** for further use.

***

#### 💡 Examples

##### Example 1 – Basic run with default format

```json
{
  "videoId": "https://www.youtube.com/watch?v=WKHKy89QaV0"
}
```

##### Example 2 – Filter subtitles by language

```json
{
  "videoId": "WKHKy89QaV0",
  "format": "vtt"
}
```

***

#### ✅ Best Practices

- Use **public YouTube videos** that are available worldwide where possible.
- Prefer **full video URLs** if you are unsure about the video ID format.
- Use `languageFilter` to keep only the languages you actually need and reduce dataset size.
- After the run finishes, **export the dataset** quickly if you plan to process subtitles in external tools.

***

#### ❓ FAQ

**Q: Does this actor download and store subtitle files on Apify?**\
A: The actor stores **links and metadata** about subtitle tracks in the dataset. You can download subtitle files later using their URLs.

**Q: Can I scrape multiple videos in one run?**\
A: This actor is designed for **one video per run** (one `videoId`). For multiple videos, create a workflow that runs the actor for each video ID.

**Q: Which subtitle formats are supported?**\
A: Supported formats are: `json3`, `srv1`, `srv2`, `srv3`, `ttml`, `vtt`, `srt`.

**Q: What happens if no subtitles are available?**\
A: If there are no subtitle tracks for the video, the actor will log this and may return an empty dataset (no subtitle items).

**Q: Why do I see error items in the dataset?**\
A: Error items appear when the subtitle service cannot return data (for example, invalid video ID, unavailable video, or technical issues). Each error item contains a simple message in the `error` field.

***

#### 🏷️ **Tags**

youtube subtitles scraper, youtube subtitles api, actor youtube captions extractor, youtube transcript scraper, download youtube subtitles, youtube subtitles dataset, youtube transcript dataset, subtitle metadata scraper, caption tracks dataset, youtube subtitle downloader, youTube subtitles extension,

***

### 🚀 Get Started Now

**Ready to extract comprehensive YouTube video Subtitles?**

1. 🎥 Enter **video IDs** (e.g., `["dX9CGRZwD-w", "N3IIruee3PE"]`)
2. ▶️ Click **Start** to run the actor
3. 📥 Download your data in JSON, CSV, Excel, or HTML format
4. Click ["Try for free"](https://apify.com?fpr=ykgg9c) to test the actor

**⭐ Star this actor if it helps you extract YouTube video Subtitles efficiently!**

***

### Related Actors 🤝

Looking for more YouTube data? Check out these complementary actors:

- **[YouTube Video Downloader](https://apify.com/igview-owner/youtube-video-downloader-api)**
- **[YouTube Comment Scraper](https://apify.com/igview-owner/youtube-comment-finder)**
- **[YouTube Search Scraper](https://apify.com/igview-owner/youtube-search-scraper)**
- **[YouTube Video Scraper](https://apify.com/igview-owner/youtube-video-details-scraper)**

***

*Built with ❤️ using Apify Platform*

# Actor input Schema

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

Paste a full YouTube URL or just the video ID. The actor will detect the video ID automatically.

## `format` (type: `string`):

Choose the subtitle format. If you are not sure, keep the default.

## Actor input object example

```json
{
  "videoId": "https://www.youtube.com/watch?v=WKHKy89QaV0",
  "format": "srv1"
}
```

# Actor output Schema

## `overview` (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 = {
    "videoId": "https://www.youtube.com/watch?v=WKHKy89QaV0"
};

// Run the Actor and wait for it to finish
const run = await client.actor("igview-owner/youtube-subtitles-scraper").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 = { "videoId": "https://www.youtube.com/watch?v=WKHKy89QaV0" }

# Run the Actor and wait for it to finish
run = client.actor("igview-owner/youtube-subtitles-scraper").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 '{
  "videoId": "https://www.youtube.com/watch?v=WKHKy89QaV0"
}' |
apify call igview-owner/youtube-subtitles-scraper --silent --output-dataset

```

## MCP server setup

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

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/MTsUqicdO0FQ0MIi3/builds/pbP10i0pQRw9YDEvV/openapi.json
