# YouTube Transcript Scraper - Captions, Search, Comments & Info (`jarvis-duo-studio/youtube-scraper`) Actor

Get full YouTube video transcripts as clean text: any caption language, optional timestamps, no API key. Also searches videos and extracts comments, video info and channel data. Blocked IPs are retried through a residential proxy automatically. Pay only per result.

- **URL**: https://apify.com/jarvis-duo-studio/youtube-scraper.md
- **Developed by:** [Jarvis Studio](https://apify.com/jarvis-duo-studio) (community)
- **Categories:** Videos, Social media, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 44.4% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 results

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, Search, Comments & Video Info

Get the **full transcript of any YouTube video as clean text** — ready for summaries, RAG pipelines, content repurposing, SEO research or LLM datasets. No API key, no browser, and you pay only for the results you get.

### What you get

- **Full transcripts, no length cap** — a 4-hour course comes back whole (250,000+ characters), one dataset item per video.
- **Any caption language** — ask for `es`, `it`, `pt-BR`…; falls back to English, then to the first available track. Hand-written captions are preferred over auto-generated ones.
- **Optional timestamps** — one segment per caption line with `start` and `duration` in seconds.
- **Blocks handled for you** — when YouTube refuses the datacenter IP, the Actor switches to a residential proxy and retries the video on its own.
- **Four more modes** — video search with filters, comments with replies, video info, and channel videos, Shorts or profile, to build a dataset around the transcripts.

### Sample output (mode: transcript)

```json
{
  "type": "transcript",
  "videoId": "UF8uR6Z6KLc",
  "url": "https://youtube.com/watch?v=UF8uR6Z6KLc",
  "title": "Steve Jobs' 2005 Stanford Commencement Address",
  "author": "Stanford",
  "channelId": "UC-EnprmCZ3OXyAoG7vjVNCA",
  "durationSeconds": 904,
  "views": 49465541,
  "language": "en",
  "isAutoGenerated": false,
  "text": "This program is brought to you by Stanford University. Please visit us at stanford.edu Thank You. I am honored to be with you today at your commencement from one of the finest universities in the world...",
  "chars": 12131,
  "scrapedAt": "2026-11-20T20:04:54.447Z"
}
```

With `includeTimestamps: true` every item also carries `segments`: `[{ "start": 1.57, "duration": 7.39, "text": "..." }, ...]`.

### Modes

| Mode | You provide | One dataset item per |
|---|---|---|
| `transcript` | `videoUrls` | video — full caption text |
| `search` | `keywords` | video found — title, channel, views, duration, age (filters: upload date, duration, most viewed) |
| `video-info` | `videoUrls` | video — title, channel, views, duration, keywords, description |
| `comments` | `videoUrls` | comment — author, text, likes, reply count; replies on request |
| `channel` | `channelIds` | channel profile (subscribers, total views, video count), or one row per video / Short |

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | enum | `transcript` | `transcript` / `search` / `video-info` / `comments` / `channel` |
| `videoUrls` | array | \[] | YouTube URLs (watch, youtu.be, shorts) or 11-character video ids |
| `keywords` | array | \[] | Search keywords (mode: search) |
| `channelIds` | array | \[] | `@handles`, channel URLs or `UC…` ids (mode: channel) |
| `channelContent` | enum | `info` | `info` (profile), `videos` or `shorts` (mode: channel) |
| `sortBy` | enum | `default` | `newest` for comments, `popularity` for search |
| `includeReplies` | boolean | false | Also return replies to comments (mode: comments) |
| `uploadDate` / `duration` | enum | `any` | Search filters (mode: search) |
| `language` | string | `en` | Preferred caption language code |
| `includeTimestamps` | boolean | false | Add per-line `segments` to each transcript |
| `maxItems` | integer | 50 | Maximum dataset items for the whole run |
| `maxItemsPerInput` | integer | 0 | Maximum per video, keyword or channel (0 = no limit) |
| `proxyConfiguration` | object | no proxy | Optional — the Actor already falls back to a proxy when blocked |

### Pricing

Pay per result: **$4 per 1,000 dataset items** ($0.004 each), platform usage included. One transcript is one item, however long the video. Videos without captions and items that fail are not charged, and the run never produces more items than your spending limit allows.

### Good to know

- Videos with captions disabled (many music-only uploads) return no item — the log names each skipped video and why.
- Private, members-only and age-restricted videos cannot be read.
- `video-info` does not include likes or the publish date: YouTube no longer exposes them to the client this Actor uses.
- `search` returns videos only and follows YouTube's own result pages until they run out.
- Only need one of these jobs? The dedicated Actors in this profile — YouTube Comments Scraper, YouTube Channel Scraper, YouTube Search Scraper — do the same work at $0.50 per 1,000 rows.

# Actor input Schema

## `mode` (type: `string`):

What to scrape

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

YouTube URLs or 11-char video ids (transcript / video-info / comments)

## `keywords` (type: `array`):

Search keywords (mode: search)

## `channelIds` (type: `array`):

@handles, channel URLs or UC... channel ids (mode: channel)

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

Preferred caption language code (en, es, it, pt-BR...). Falls back to English, then to the first available track.

## `includeTimestamps` (type: `boolean`):

Add a segments array with start/duration (seconds) for every caption line (mode: transcript).

## `channelContent` (type: `string`):

What to return for each channel: its profile, its videos (newest first) or its Shorts (mode: channel).

## `sortBy` (type: `string`):

Comments: top comments or newest first. Search: relevance or most viewed.

## `includeReplies` (type: `boolean`):

Also return the replies to each comment; each reply is one dataset item (mode: comments).

## `uploadDate` (type: `string`):

Only videos uploaded in this period (mode: search).

## `duration` (type: `string`):

Only videos of this length (mode: search).

## `maxItems` (type: `integer`):

Maximum number of dataset items for the whole run

## `maxItemsPerInput` (type: `integer`):

Limit for each single video, keyword or channel. 0 = no per-input limit.

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

Optional. Runs without a proxy by default and switches to a residential proxy on its own when YouTube refuses the IP.

## Actor input object example

```json
{
  "mode": "transcript",
  "videoUrls": [
    "https://www.youtube.com/watch?v=UF8uR6Z6KLc"
  ],
  "keywords": [],
  "channelIds": [],
  "language": "en",
  "includeTimestamps": false,
  "channelContent": "info",
  "sortBy": "default",
  "includeReplies": false,
  "uploadDate": "any",
  "duration": "any",
  "maxItems": 5,
  "maxItemsPerInput": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Dataset items collected by this run.

# 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 = {
    "mode": "transcript",
    "videoUrls": [
        "https://www.youtube.com/watch?v=UF8uR6Z6KLc"
    ],
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("jarvis-duo-studio/youtube-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 = {
    "mode": "transcript",
    "videoUrls": ["https://www.youtube.com/watch?v=UF8uR6Z6KLc"],
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("jarvis-duo-studio/youtube-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 '{
  "mode": "transcript",
  "videoUrls": [
    "https://www.youtube.com/watch?v=UF8uR6Z6KLc"
  ],
  "maxItems": 5
}' |
apify call jarvis-duo-studio/youtube-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jarvis-duo-studio/youtube-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/N6WELOZMgql03u1ci/builds/fZ8czW2iuzOkIlrul/openapi.json
