# YouTube Pro Scraper — Videos, Channels, Comments & Transcripts (`dami0089/youtube-data-pro-scraper`) Actor

Videos, canales, comentarios con respuestas, transcripciones y Shorts de YouTube en un solo actor HTTP, 60% más barato que el líder.

- **URL**: https://apify.com/dami0089/youtube-data-pro-scraper.md
- **Developed by:** [Damian Oliva](https://apify.com/dami0089) (community)
- **Categories:** Social media, Videos
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 Pro Scraper — Videos, Channels, Comments & Transcripts

Scrape public YouTube at scale with plain HTTP: **video metadata, channel profiles, playlists,
top-level comments with reply threads, full transcripts with SRT, and Shorts/Live detection** —
in a single actor, with pay-per-event pricing.

Built for researchers, marketers, sales teams, and AI apps that need structured YouTube data
without juggling three or four separate scrapers.

### What it does

Five combinable modes in one run:

1. **Search** — keyword search with sort order (`relevance`, `date`, `viewCount`, `rating`) and
   country/language localization. Returns full video detail per result, not just snippets.
2. **Videos** — full detail from URLs or 11-char IDs: views, likes, duration, exact publish date,
   tags, category, description, chapters, thumbnails, channel info, Short/Live flags.
3. **Channels** — profile (subscribers, video count, description, avatar, banner) plus recent videos.
   Accepts `@handle`, channel URLs, or `UC…` IDs.
4. **Playlists** — expanded to full video metadata. Private/deleted entries come back as flagged
   partial items (free, no charge).
5. **Comments** — top-level comments per video with nested reply threads (author, text, likes,
   reply count). Charged per top-level comment.

Optional extras per video: **full transcript** (`text` + `segments` + `SRT`, manual captions
preferred, auto-generated fallback), **dislike estimate** (via the public Return YouTube Dislike
aggregate), and a **markdown** rendering ready to paste into an LLM prompt.

**Monitor mode** for scheduled runs returns only items that appeared since the previous run —
track any channel, keyword, or playlist over time without re-paying for old data.

### How to use

1. Add one or more inputs: `searchQueries`, `videoUrls`, `channelUrls`, `playlistUrls`.
2. Tune `maxResults` (per query/channel), `maxComments`, `includeTranscript`, and the hard cap
   `maxItems` (controls total spend).
3. Run. Results land in the default dataset; each video/channel/comment row maps 1:1 to a
   billed pay-per-event charge shown below.

#### Example input

```json
{
  "searchQueries": ["lofi hip hop radio"],
  "maxResults": 10,
  "maxComments": 0,
  "includeTranscript": false,
  "maxItems": 10
}
```

#### Example output (real item)

```json
{
  "id": "5yx6BWlEVcY",
  "url": "https://www.youtube.com/watch?v=5yx6BWlEVcY",
  "title": "Chillhop Radio - jazzy & lofi hip hop beats",
  "description": "Welcome to the Chillhop Radio, playing the best jazzy / lofi hip hop beats...",
  "viewCount": 59983304,
  "likeCount": 381000,
  "commentCount": null,
  "durationSeconds": null,
  "publishedAt": "2020-03-21T06:21:02-07:00",
  "tags": ["lofi hip hop", "nonstop lofi", "lofi radio", "study beats radio"],
  "category": "Music",
  "isShort": false,
  "isLive": true,
  "channelId": "UCOxqgCwgOqC2lMqC5PYz_Dg",
  "channelName": "Chillhop Music",
  "subscriberCount": 3300000,
  "transcript": null,
  "comments": null,
  "type": "video"
}
```

With `maxComments: 3, includeTranscript: true`, the same item additionally carries a `comments`
array (each with `replies`) and a `transcript` object:

```json
"comments": [
  {
    "id": "UgzAuQpdzR30bsB2KSJ4AaABAg",
    "author": "@gutluckbro9802",
    "authorChannelUrl": "https://www.youtube.com/channel/UCTStHu4wR8ZpWrHFQBb5FCQ",
    "text": "Who's watching this after IFT - 14?",
    "likeCount": 31,
    "replyCount": 1,
    "publishedTime": "7 days ago",
    "replies": [{ "author": "@user", "text": "Me!", "...": "..." }]
  }
],
"transcript": {
  "text": "full plain text...",
  "segments": [{ "start": 0, "duration": 4.8, "text": "..." }],
  "srt": "1\n00:00:00,000 --> 00:00:04,800\n...\n",
  "language": "en",
  "isAutoGenerated": true
}
```

### Pricing (pay per event)

| Event | Price | What counts |
|---|---|---|
| `video-item` | **$0.002** | Each video with full metadata (transcript + nested comments included in the same item) |
| `channel-item` | **$0.002** | Each channel profile |
| `comment-item` | **$0.0004** | Each top-level comment fetched (replies included free) |

Examples:

- 1,000 videos ≈ **$2.00**
- 1,000 videos with 10 comments each ≈ $2.00 + $4.00 = **$6.00**
- Playlist containers and private/deleted/unavailable videos are **free** (pushed without charge
  so you can see what was skipped).

The actor respects your max-spend budget automatically: it stops requesting more results when the
charge limit is reached, and `maxItems` caps the total dataset size no matter what.

### How it compares

Most YouTube actors on the Store charge roughly **$0.005 per video** and ship search *or*
comments *or* transcripts as separate products. This actor combines all five modes plus reply
threads, full transcripts with SRT, incremental monitor mode, and LLM-ready markdown in one run,
at **$0.002 per video** — with comments at a fraction of a cent each. Compare the price tables
and feature lists before you run; the dataset schema above is exactly what you get.

### Transcripts & SRT

`includeTranscript: true` attaches the video's captions: plain `text`, timestamped `segments`,
and a ready-to-save `srt` string, plus the caption `language` and whether it is auto-generated.
Manual captions in your `language` are preferred; auto-generated tracks are the fallback.
Live streams and videos with captions disabled return `transcript: null` (metadata is still
delivered and still counts as one video-item).

### Monitor mode

Set `monitorMode: true` and schedule the actor (e.g. daily). State is kept in a
`youtube-monitor` key-value store: each run returns only videos/comments not seen before and
updates the state. Perfect for tracking a competitor's channel, a keyword, or a playlist.

### Limits & errors

- Pure HTTP, no browser: fast and cheap. YouTube rate-limits aggressively, so the actor retries
  with exponential backoff (3 attempts) and supports the built-in proxy configuration —
  residential proxies are recommended for large runs.
- Optional `youtubeApiKeys`: a pool of YouTube Data API v3 keys used as automatic fallback if
  the public endpoints ever throttle. Quota rotates across keys.
- `maxResults` 1–500 per query/channel/playlist; `maxItems` 1–100,000 total.
- One bad URL never kills a run: per-item failures are logged and skipped.
- Exact comment timestamps are not public on YouTube; comment items carry YouTube's relative
  time (e.g. `"7 days ago"`). Video/channel dates are exact ISO timestamps.
- Dislike counts have been hidden by YouTube since 2021; `dislikeEstimate` is a clearly-labeled
  estimate from a public aggregate, only fetched when you opt in.

### FAQ

**Is this legal?** The actor reads only public pages and endpoints — the same data any logged-out
browser sees. It never touches logins, CAPTCHAs, or private/deleted content (those return empty
flagged items). You are responsible for complying with YouTube's Terms of Service for your use case.

**Why are some fields null?** `null` means YouTube didn't expose it (e.g. no captions, live chat
instead of comments, hidden subscriber counts). Data is never invented.

**Do I need a proxy?** Small runs work without one. For hundreds of videos or scheduled monitors,
set a residential proxy in `proxyConfiguration` to avoid 429s.

**Can I get more than 500 results per query?** The actor paginates automatically up to
`maxResults` (max 500 per input) and up to `maxItems` overall — combine queries for more.

**Shorts?** Yes — detected via duration/URL and flagged with `isShort`. Reel results from search
are included automatically.

### Integrations

Standard Apify dataset output: pull it via the **API** (`/v2/acts/.../runs/.../dataset/items`),
connect **Make / Zapier / n8n** with the Apify modules, or call the actor through the **Apify MCP
server** from Claude/ChatGPT — the dataset view and output schema are machine-readable. Combine
with `outputMarkdown: true` to feed transcripts and comments straight into an LLM pipeline.

### Support

Found a page shape that parses wrong? Open an issue with the video/channel URL and the field that
came back empty — YouTube changes markup regularly and fixes ship fast.

# Actor input Schema

## `searchQueries` (type: `array`):

YouTube search terms. Each query returns up to maxResults videos.

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

Video URLs or 11-char IDs for full detail (views, likes, duration, exact date, tags, category, chapters, Short/Live flags).

## `channelUrls` (type: `array`):

Channels (@handle, URL or UC id): profile + recent videos. Example: https://www.youtube.com/@veritasium

## `playlistUrls` (type: `array`):

Playlists to expand with full video metadata.

## `maxResults` (type: `integer`):

Videos per search or per channel (1-500).

## `maxComments` (type: `integer`):

Top-level comments per video, with reply threads (0 = skip comments).

## `maxRepliesPerComment` (type: `integer`):

Replies fetched inside each top-level comment thread (0 = top-level only).

## `includeTranscript` (type: `boolean`):

Attach full transcript (text, segments, SRT) to each video. Videos without captions keep transcript: null.

## `includeDislikeEstimate` (type: `boolean`):

Attach an engagement-based dislike estimate (YouTube hides real dislikes since 2021). Clearly labeled as an estimate.

## `outputMarkdown` (type: `boolean`):

Add a markdown field to each item, ready to paste into an LLM prompt.

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

Search result order: relevance, date, viewCount or rating.

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

Two-letter content language code, e.g. en, es.

## `country` (type: `string`):

Two-letter country code for search localization, e.g. US, MX, ES.

## `monitorMode` (type: `boolean`):

On scheduled runs, return only items newer than the previous run (stored in key-value store).

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

Hard cap on total dataset items: controls spend (1-100000).

## `youtubeApiKeys` (type: `array`):

Optional pool of YouTube Data API v3 keys used as fallback when InnerTube endpoints are rate-limited. Quota rotates automatically.

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

Proxy settings. Residential proxies are recommended for YouTube (used by default on the platform).

## Actor input object example

```json
{
  "searchQueries": [
    "lofi hip hop radio"
  ],
  "maxResults": 10,
  "maxComments": 0,
  "maxRepliesPerComment": 5,
  "includeTranscript": false,
  "includeDislikeEstimate": false,
  "outputMarkdown": false,
  "sortBy": "relevance",
  "language": "en",
  "country": "US",
  "monitorMode": false,
  "maxItems": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Scraped YouTube videos, channels, playlists and comments (table view).

# 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 = {
    "searchQueries": [
        "lofi hip hop radio"
    ],
    "maxResults": 10,
    "maxComments": 0,
    "maxRepliesPerComment": 5,
    "includeTranscript": false,
    "includeDislikeEstimate": false,
    "outputMarkdown": false,
    "sortBy": "relevance",
    "language": "en",
    "country": "US",
    "monitorMode": false,
    "maxItems": 10,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("dami0089/youtube-data-pro-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 = {
    "searchQueries": ["lofi hip hop radio"],
    "maxResults": 10,
    "maxComments": 0,
    "maxRepliesPerComment": 5,
    "includeTranscript": False,
    "includeDislikeEstimate": False,
    "outputMarkdown": False,
    "sortBy": "relevance",
    "language": "en",
    "country": "US",
    "monitorMode": False,
    "maxItems": 10,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("dami0089/youtube-data-pro-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 '{
  "searchQueries": [
    "lofi hip hop radio"
  ],
  "maxResults": 10,
  "maxComments": 0,
  "maxRepliesPerComment": 5,
  "includeTranscript": false,
  "includeDislikeEstimate": false,
  "outputMarkdown": false,
  "sortBy": "relevance",
  "language": "en",
  "country": "US",
  "monitorMode": false,
  "maxItems": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call dami0089/youtube-data-pro-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dami0089/youtube-data-pro-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/yfVAX0x67FwlRCs6G/builds/vZXHS7GaXYFPHF1Y1/openapi.json
