# YouTube Channel Scraper (`api-ninja/youtube-channel-scraper`) Actor

🚀 Comprehensive YouTube scraper! Extract videos, shorts, live streams, playlists, and community posts from any channel. Fast, reliable data extraction with support for geo/lang localization and keyword search.

- **URL**: https://apify.com/api-ninja/youtube-channel-scraper.md
- **Developed by:** [API ninja](https://apify.com/api-ninja) (community)
- **Categories:** Videos, Developer tools, Social media
- **Stats:** 315 total users, 72 monthly users, 100.0% runs succeeded, 16 bookmarks
- **User rating**: 5.00 out of 5 stars

## 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## YouTube Channel Scraper: Scrape Videos, Shorts, Playlists, and Posts

YouTube Channel Scraper is a comprehensive **YouTube data extraction tool** that allows you to **scrape YouTube channels** and extract videos, shorts, playlists, and community posts without using the official **YouTube API**. Whether you need to monitor competitors, analyze trends, or build research datasets, this scraper provides a fast and reliable way to get structured data from any channel on [YouTube](https://www.youtube.com).

As a robust **YouTube API alternative**, this Actor handles the technical complexity of extraction for you, offering localized results, custom sorting, and deep filtering options.

**How to use YouTube Channel Scraper to extract data:**
1.  Find the URL of the YouTube channel you want to scrape.
2.  Paste the URL into the **YouTube Channel URLs** field.
3.  Select which content types you need (Videos, Shorts, Live Streams, etc.).
4.  Click **Start** and download your data in JSON, CSV, or Excel format.

> **Note**: YouTube Channel Scraper does not download video files or scrape full comment text; for those specific needs, please see our [YouTube Video Downloader](https://apify.com/api-ninja/youtube-video-downloader) or [YouTube Comments Scraper](https://apify.com/api-ninja/youtube-comments-scraper).

### 🌟 What can YouTube Channel Scraper do?

This tool is much more than a simple video list extractor. It is a full-featured **YouTube channel scraper** that can:

-   🎥 **Extract YouTube Videos**: Get titles, view counts, upload dates, and durations.
-   📱 **Scrape YouTube Shorts**: Access the latest viral short-form content.
-   🔴 **Monitor Live Streams**: Track current and past live broadcasts.
-   📂 **Download Playlists**: Organize content by the channel's own curation.
-   💬 **Collect Community Posts**: Scrape text and engagement from the channel's "Community" tab.
-   🏬 **Scrape Channel Store**: Extract product information if the channel has a shop.
-   🔍 **Search Within Channel**: Use a keyword to find specific videos or playlists inside a single channel.

### 💼 Why use YouTube Channel Scraper?

-   **Competitor Analysis**: Track competitors’ upload frequency and content mix to stay ahead.
-   **Content Strategy**: Analyze the performance of Shorts vs. long-form videos to optimize your own channel.
-   **Audience Sentiment**: Monitor community posts and engagement to understand audience trends.
-   **Research & AI**: Build high-quality datasets for content research, trend analysis, or recommendation models.

### 📊 What data can you extract from YouTube channels?

The scraper returns structured data in multiple formats. Here is a breakdown of the key data points you can collect:

| Category | Data Points Extracted |
| --- | --- |
| **Videos/Shorts** | Title, Video ID, Thumbnail URL, View Count, Published Time, Duration, Description Snippet |
| **Live Streams** | Title, Video ID, Live Status, Thumbnail, Viewers (if live) |
| **Playlists** | Title, Playlist ID, Video Count, Thumbnail |
| **Community Posts** | Post Text, Attachment Type (Image/Poll), Published Date |
| **Channel Info** | Browse ID, Channel Name, Subscriber Count (via resolve) |

### 🚀 How to scrape YouTube channels with YouTube Channel Scraper

Using this Actor is straightforward, even if you have no coding experience. Follow these simple steps:

1.  **Find your target**: Copy the URL of the YouTube channel you want to scrape (e.g., `https://www.youtube.com/@MrBeast`).
2.  **Set the Input**: Paste the URL(s) into the **YouTube Channel URLs** field in the input tab.
3.  **Select Categories**: Choose whether you want Videos, Shorts, Playlists, etc.
4.  **Run the Actor**: Click the "Start" button and wait for the data to populate.
5.  **Download**: Once finished, export your data from the **Dataset** tab.

### 💰 How much does it cost to scrape YouTube channels?

Scraping YouTube data is highly efficient on the Apify platform. While web scraping can be unpredictable, our tool is optimized for low resource consumption.

On average, you can expect to scrape **thousands of results for just a few dollars** in platform usage fees (Compute Units). 
-   **Free Plan**: You can get started for free using Apify's trial credits.
-   **Scalability**: For large-scale operations, the Actor supports proxy rotation and scheduling to ensure continuous data flow.

### 📂 Input Parameters

The Actor provides a user-friendly interface for configuration. Key options include:

-   **YouTube Channel URLs**: A list of URLs to process.
-   **Content Categories**: Pick exactly what you need (Videos, Shorts, Live Streams, Playlists, Posts, etc.).
-   **Results per Category**: Limit the amount of data to save on costs.
-   **Sort Order**: Sort by Newest, Oldest, or Popular.

> YouTube Channel Scraper has the following input options. For a full description of every field, validation rules, and defaults, click on the **Input** tab in Apify Console.

### ⚙️ Tips and advanced options

-   **Limit Results**: Adjust **Results per Category** to control your Compute Unit usage and speed up runs.
-   **Localization**: Use `geo` and `lang` in the **Advanced options** section to get localized results for specific countries or languages.
-   **Fresh Data**: Schedule the Actor to run daily or weekly to keep your channel dataset up to date automatically.
-   **Sorting**: Use **Sort Order = Newest** to keep incremental runs fast and focused on the latest content.

### 📥 Output Example

You can download the dataset extracted by **YouTube Channel Scraper** in various formats such as **JSON, HTML, CSV, or Excel** from the **Dataset** tab. Here is a simplified example of a video item in JSON format:

```json
{
  "type": "video",
  "title": "I Built A Giant LEGO Tower",
  "videoId": "dQw4w9WgXcQ",
  "viewCount": "15,234,098",
  "publishedTime": "2 days ago",
  "lengthText": "12:45",
  "thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
  "scrapedCategory": "videos",
  "scrapedBrowseId": "UCX6OQ3DkcsbYNE6H8uQQuVA"
}
````

### 🛠 Other YouTube Scraping Tools

If you like this Actor, you might also find these specialized tools useful:

- 💬 **[YouTube Comments Scraper](https://apify.com/api-ninja/youtube-comments-scraper)**: Extract thousands of comments and replies from any video.
- 🔍 **[YouTube Search Scraper](https://apify.com/api-ninja/youtube-search-scraper)**: Scrape search results for any keyword to discover new channels.
- 📥 **[YouTube Video Downloader](https://apify.com/api-ninja/youtube-video-downloader)**: Get direct download links for YouTube videos.

### ⚖️ Is it legal to scrape YouTube?

Our scrapers are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our scrapers, when used for ethical purposes by Apify users, are safe.

However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers. You can also read our blog post on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

### 🆘 Support and Feedback

If you run into any issues or have a feature request, please head over to the **Issues** tab or contact us directly. We are constantly improving the scraper and appreciate your feedback!

# Actor input Schema

## `urls` (type: `array`):

List of YouTube channel URLs to scrape content from. Example: https://www.youtube.com/@YouTube

## `categories` (type: `array`):

Select which types of content to scrape from each channel.

## `resultsPerCategory` (type: `integer`):

Maximum number of items to scrape for each selected category. Ignored when 'Parse all results' is enabled.

## `parseAllResults` (type: `boolean`):

When enabled, scrape all available content regardless of the maximum results limit.

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

Sort order for content. Available for Videos, Shorts and Livestreams. For Playlists, only 'Newest' and 'Oldest' options are available.

## `search` (type: `string`):

Search query to filter videos and playlists within the channel.

## `lang` (type: `string`):

Language code for localized results (e.g., 'en,es,fr').

## `geo` (type: `string`):

ISO 3166-2 country code (e.g., US, GB, IN).

## `local` (type: `boolean`):

Fetch localized content based on country settings. Works with videos, shorts and livestreams. Uses US as default if no country is specified.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/@MrBeast",
    "https://www.youtube.com/@YouTube"
  ],
  "categories": [
    "videos"
  ],
  "resultsPerCategory": 100,
  "parseAllResults": false,
  "sortBy": "newest",
  "local": false
}
```

# Actor output Schema

## `results` (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 = {
    "urls": [
        "https://www.youtube.com/@MrBeast",
        "https://www.youtube.com/@YouTube"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("api-ninja/youtube-channel-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 = { "urls": [
        "https://www.youtube.com/@MrBeast",
        "https://www.youtube.com/@YouTube",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("api-ninja/youtube-channel-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://www.youtube.com/@MrBeast",
    "https://www.youtube.com/@YouTube"
  ]
}' |
apify call api-ninja/youtube-channel-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=api-ninja/youtube-channel-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Channel Scraper",
        "description": "🚀 Comprehensive YouTube scraper! Extract videos, shorts, live streams, playlists, and community posts from any channel. Fast, reliable data extraction with support for geo/lang localization and keyword search.",
        "version": "0.0",
        "x-build-id": "SWwUaMI5zgzp68tZV"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/api-ninja~youtube-channel-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-api-ninja-youtube-channel-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/api-ninja~youtube-channel-scraper/runs": {
            "post": {
                "operationId": "runs-sync-api-ninja-youtube-channel-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/api-ninja~youtube-channel-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-api-ninja-youtube-channel-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "🔗 YouTube Channel URLs",
                        "type": "array",
                        "description": "List of YouTube channel URLs to scrape content from. Example: https://www.youtube.com/@YouTube",
                        "items": {
                            "type": "string"
                        }
                    },
                    "categories": {
                        "title": "🗂️ Content Categories",
                        "type": "array",
                        "description": "Select which types of content to scrape from each channel.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "videos",
                                "shorts",
                                "live",
                                "playlists",
                                "posts",
                                "channels",
                                "store",
                                "home"
                            ],
                            "enumTitles": [
                                "Videos",
                                "Shorts",
                                "Livestreams",
                                "Playlists",
                                "Community posts",
                                "Featured channels",
                                "Channel Store",
                                "Home"
                            ]
                        },
                        "default": [
                            "videos"
                        ]
                    },
                    "resultsPerCategory": {
                        "title": "🔢 Maximum Results per Category",
                        "minimum": 20,
                        "type": "integer",
                        "description": "Maximum number of items to scrape for each selected category. Ignored when 'Parse all results' is enabled.",
                        "default": 100
                    },
                    "parseAllResults": {
                        "title": "Parse All Available Results",
                        "type": "boolean",
                        "description": "When enabled, scrape all available content regardless of the maximum results limit.",
                        "default": false
                    },
                    "sortBy": {
                        "title": "↕️ Sort Order",
                        "enum": [
                            "newest",
                            "popular",
                            "oldest"
                        ],
                        "type": "string",
                        "description": "Sort order for content. Available for Videos, Shorts and Livestreams. For Playlists, only 'Newest' and 'Oldest' options are available.",
                        "default": "newest"
                    },
                    "search": {
                        "title": "🔍 Search Within Channel",
                        "type": "string",
                        "description": "Search query to filter videos and playlists within the channel."
                    },
                    "lang": {
                        "title": "🗣️ Language",
                        "pattern": "^[a-z]{2}$",
                        "type": "string",
                        "description": "Language code for localized results (e.g., 'en,es,fr')."
                    },
                    "geo": {
                        "title": "🌍 Country",
                        "pattern": "^[A-Z]{2}$",
                        "type": "string",
                        "description": "ISO 3166-2 country code (e.g., US, GB, IN)."
                    },
                    "local": {
                        "title": "📍 Localized Content",
                        "type": "boolean",
                        "description": "Fetch localized content based on country settings. Works with videos, shorts and livestreams. Uses US as default if no country is specified.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
