# YouTube Scraper Pro (`grow_media/youtube-scraper-pro`) Actor

All-in-one YouTube scraper: search with filters, channel videos, Shorts, live streams, playlists and video details — with subtitle support.

- **URL**: https://apify.com/grow_media/youtube-scraper-pro.md
- **Developed by:** [Grow Media](https://apify.com/grow_media) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 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.
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 Scraper Pro 🎬

**Extract videos, Shorts, live streams, and full channel info from YouTube — fast, reliable, and no quota headaches.**

YouTube Scraper Pro scrapes **any YouTube channel** (or search query) and returns **structured JSON** with video details, statistics, timestamps, and channel profiles — ready for AI pipelines, dashboards, market research, and lead-gen workflows.

<p align="center">
  <a href="#-quick-start">Quick Start</a> ·
  <a href="#-use-cases">Use Cases</a> ·
  <a href="#-input-parameters">Input Parameters</a> ·
  <a href="#-output-data">Output Data</a> ·
  <a href="#-faq">FAQ</a>
</p>

***

### ✨ Why YouTube Scraper Pro?

- ⚡ **Blazing fast** — batched API requests with smart pagination, up to 1,000+ videos per run
- 🧠 **Full enrichment** — views, likes, comments, tags, descriptions, thumbnails, and channel stats in one pass
- 📺 **All content types** — videos, Shorts, and live streams from any public channel
- 🔍 **Search built in** — filter by date, duration, sorting, and relevance
- 🛡️ **Error-first design** — bad channels, missing videos, or empty tabs push structured error items instead of crashing your run
- 🧾 **Clean, typed output** — every item follows the same schema, with built-in dataset views

***

### 🚀 Quick Start

1. Add a channel handle (e.g. `@MrBeast`), channel ID, or full channel URL.
2. Set `maxResults` (default: 50).
3. Hit **Run** → get structured video data in seconds.

<details>
<summary><strong>Example input</strong></summary>

```json
{
    "channelUrls": ["https://www.youtube.com/@MrBeast"],
    "maxResults": 100,
    "sortOrder": "latest",
    "videoType": "long"
}
```

</details>

***

### 🎯 Use Cases

- 📊 **Competitor analysis** — track video cadence, views, and engagement across channels
- 🤖 **AI & LLM pipelines** — feed clean video metadata and descriptions into RAG or agents
- 📈 **Trend tracking** — monitor Shorts and live streams as they publish
- 🧑‍💼 **Influencer discovery** — profile channels with subscriber and view stats
- 🎥 **Content aggregation** — build directories or feeds from channel data

***

### 🔧 Input Parameters

| Parameter        | Type      | Default    | Description |
|------------------|-----------|------------|-------------|
| `channelUrls`    | `array`   | —          | Full YouTube channel URLs (e.g. `https://www.youtube.com/@MrBeast`). Takes priority over handle/ID. |
| `channelHandle`  | `string`  | —          | YouTube handle, e.g. `@MrBeast`. Ignored if `channelUrls` is set. |
| `channelId`      | `string`  | —          | Channel ID (e.g. `UCX6OQ3DkcsbYNE6H8uQQuVA`). Ignored if URL/handle set. |
| `maxResults`     | `integer` | `50`       | Maximum videos to scrape (1–1000). |
| `videoType`      | `string`  | `long`     | `"long"` for regular videos, `"short"` for Shorts. |
| `sortOrder`      | `string`  | `latest`   | `"latest"`, `"popular"`, or `"oldest"`. |
| `query`          | `string`  | —          | Search query (uses YouTube Search API). |
| `maxResultsSearch` | `integer` | `50`     | Max results per search query. |

> ⚠️ At least one of `channelUrls`, `channelHandle`, `channelId`, or `query` is required.

***

### 📦 Output Data

All results are pushed to the **default dataset**. The actor defines **dataset views** for quick filtering in Apify Console:

| View            | What it shows |
|-----------------|---------------|
| **Overview**    | A compact table: title, thumbnail, view count, channel |
| **Detailed**    | Full item view with all metadata, statistics, and error codes |
| **Channel Info**| Channel profile: subscribers, total views, video count |
| **Errors**      | Failed inputs with `{url, input, error, note}` for debugging |

<details>
<summary><strong>Sample output item (video)</strong></summary>

```json
{
    "title": "Video Title",
    "url": "https://www.youtube.com/watch?v=VIDEO_ID",
    "id": "VIDEO_ID",
    "type": "video",
    "thumbnailUrl": "https://i.ytimg.com/vi/VIDEO_ID/hqdefault.jpg",
    "date": "2026-10-23T00:00:00Z",
    "viewCount": 1523421,
    "likes": 84210,
    "commentsCount": 3194,
    "duration": "12:34",
    "durationSeconds": 754,
    "description": "Full video description...",
    "keywords": ["tag1", "tag2"],
    "isShort": false,
    "channelId": "UC...",
    "channelName": "Channel Name",
    "channelUrl": "https://www.youtube.com/channel/UC..."
}
```

</details>

<details>
<summary><strong>Sample output item (Short)</strong></summary>

```json
{
    "title": "Short Title",
    "url": "https://www.youtube.com/shorts/VIDEO_ID",
    "type": "short",
    "isShort": true,
    "durationSeconds": 42,
    "viewCount": 95102
}
```

</details>

<details>
<summary><strong>Sample error item</strong></summary>

```json
{
    "url": "https://www.youtube.com/@thischanneldoesnotexist",
    "input": "@thischanneldoesnotexist",
    "error": "CHANNEL_DOES_NOT_EXIST",
    "note": "No channel found for this handle."
}
```

**Error codes:** `CHANNEL_DOES_NOT_EXIST`, `NO_VIDEOS`, `NO_VALID_START_URLS`.

</details>

***

### 💰 Cost

This actor uses **pay-per-result pricing** — you only pay for the results it delivers. Check the current price on the Apify Store page.

***

### ❓ FAQ

<details>
<summary><strong>Does this use official YouTube APIs?</strong></summary>

It combines YouTube's Data API (for metadata enrichment) and YouTube's Internal Browse API (for fast channel pagination) — no scraping of HTML pages, so no brittle DOM parsing.

</details>

<details>
<summary><strong>Can I scrape Shorts and live streams?</strong></summary>

Yes — set `videoType: "short"` for Shorts; live streams are detected automatically and marked with `isShort: false` and a live flag.

</details>

<details>
<summary><strong>What happens if a channel is invalid?</strong></summary>

The actor pushes an error item (`error`, `note`, `url`, `input`) to the dataset and continues with the next channel — your run never fails because of one bad input.

</details>

***

### 📚 Resources

- [Apify Actor Documentation](https://docs.apify.com)
- [YouTube Data API Reference](https://developers.google.com/youtube/v3/docs)

***

*Built with ❤️ for the Apify community.*

# Actor input Schema

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

Search terms, just like you would enter them in the YouTube search bar.

## `youtubeHandles` (type: `array`):

Channel handles (with or without @) to scrape videos from, e.g. @MrBeast, mkbhd. Full handle URLs are also accepted, e.g. https://www.youtube.com/@MrBeast.

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

Channel IDs (e.g. UCX6OQ3DkcsbYNE6H8uQQuVA) or full channel URLs (e.g. https://www.youtube.com/channel/UCX6OQ3DkcsbYNE6H8uQQuVA).

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

Maximum number of regular videos to scrape per channel or search query (1-1000).

## `maxResultsShorts` (type: `integer`):

Maximum number of Shorts to scrape per channel (0-1000). Set 0 to skip Shorts.

## `maxResultStreams` (type: `integer`):

Maximum number of live streams to scrape per channel (0-1000). Set 0 to skip live streams.

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

Hard cap on the total number of results pushed to the dataset across all sources. Leave empty for no global cap.

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

Upload date filter for search queries only.

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

Video duration filter for search queries only.

## `features` (type: `string`):

Video feature filter for search queries only.

## `sort` (type: `string`):

Sorting order for search queries only.

## `gl` (type: `string`):

Region for search results, ISO 3166-1 alpha-2 country code (e.g. US, DE, IN).

## `hl` (type: `string`):

Language for search results, ISO 639-1 two-letter code (e.g. en, es, fr).

## `sortVideosBy` (type: `string`):

Maps to the sorting buttons on the channel's Videos, Shorts and Live pages.

## `oldestPostDate` (type: `string`):

Only videos uploaded after or on this date (YYYY-MM-DD) will be scraped. The channel is scanned newest-first up to this date boundary, then results are ordered according to Sort Channel Videos By.

## `fetchVideoDetails` (type: `boolean`):

Enrich every video with full metadata (likes, comments, description, tags, channel stats) via batched Data API requests.

## Actor input object example

```json
{
  "searchQueries": [
    "web scraping tutorials"
  ],
  "maxResults": 50,
  "maxResultsShorts": 0,
  "maxResultStreams": 0,
  "uploadDate": "any",
  "duration": "any",
  "features": "any",
  "sort": "relevance",
  "gl": "us",
  "hl": "en",
  "sortVideosBy": "NEWEST",
  "fetchVideoDetails": true
}
```

# Actor output Schema

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

All scraped videos, Shorts and live streams with metadata, statistics and channel info.

## `errors` (type: `string`):

Per-source error items ({url, input, error, note}) for channels or searches that failed. Separate from results by the presence of the 'error' field.

# 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": [
        "web scraping tutorials"
    ],
    "maxResults": 50,
    "maxResultsShorts": 0,
    "maxResultStreams": 0
};

// Run the Actor and wait for it to finish
const run = await client.actor("grow_media/youtube-scraper-pro").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": ["web scraping tutorials"],
    "maxResults": 50,
    "maxResultsShorts": 0,
    "maxResultStreams": 0,
}

# Run the Actor and wait for it to finish
run = client.actor("grow_media/youtube-scraper-pro").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": [
    "web scraping tutorials"
  ],
  "maxResults": 50,
  "maxResultsShorts": 0,
  "maxResultStreams": 0
}' |
apify call grow_media/youtube-scraper-pro --silent --output-dataset

```

## MCP server setup

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

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/MDESn100VL89viVE7/builds/DBgv0oywl59mW9LaA/openapi.json
