# YouTube Channel Scraper — All Videos, Views & Subscribers (`dottti/youtube-channel-scraper`) Actor

Scrape every video from any YouTube channel: title, views, duration, publish date, plus channel subscribers and video count. No API key, no quota.

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

## Pricing

from $3.00 / 1,000 video scrapeds

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 Channel Scraper — All Videos, Views & Subscribers

Scrape every video from any YouTube channel without an API key, a quota or a login. Give it an `@handle`, a channel URL or a `UC…` ID.

Each row carries the video **and** the channel: title, views, duration, publish date, plus subscriber count, total video count, handle, description and avatar.

### Output

```json
{
  "channelName": "Marques Brownlee",
  "channelId": "UCBJycsmduvYEL83R_U4JriQ",
  "channelHandle": "@MKBHD",
  "subscriberCount": 21300000,
  "videoCount": 1800,
  "videoId": "6D__H_DO2Xk",
  "url": "https://www.youtube.com/watch?v=6D__H_DO2Xk",
  "title": "iPhone Duo: What We Missed!",
  "viewCount": 8200000,
  "viewCountText": "8.2M views",
  "lengthText": "10:37",
  "lengthSeconds": 637,
  "publishedText": "1 day ago",
  "publishedApprox": "2026-09-13T...",
  "isShort": false
}
```

### Why this one does not quietly return zero

YouTube is midway through changing how channel grids are built. The old shape was `videoRenderer`; channels now serve `lockupViewModel`, where the video ID sits in `contentId` and the view count and age are unlabelled strings.

Measured on a live channel page on 14 September 2026: **30 `lockupViewModel`, zero `videoRenderer`.** Any scraper that only knows the old shape returns an empty dataset and reports success.

This Actor reads the new shape first and falls back to the old one, so it works on both sides of the rollout. A test asserts each path independently, so a future fallback removal fails loudly rather than silently.

Views and ages are classified by their **format** rather than their label, because in the new shape the labels move between layouts and the value formats do not.

### Blocked pages are never charged

YouTube refuses some datacenter IPs with "Sign in to confirm you're not a bot" — returned as a normal 200 page with no data. Billing for that would charge you for this Actor's IP being refused, so those rows are written with `blocked: true` and `error: "blocked_by_youtube"` and **no event fires**.

To avoid it entirely, set `proxyConfiguration` to Apify Proxy with `RESIDENTIAL` groups.

### Input

| Field | What it does |
| --- | --- |
| `channels` | `@handles`, channel URLs, or `UC…` IDs. All three work and can be mixed. |
| `maxVideosPerChannel` | Cap on videos per channel, and therefore on cost. One page carries about 30. |
| `includeChannelInfo` | Attach channel name, subscribers, video count and avatar to every row. |
| `language` / `country` | Two-letter codes affecting titles and regional availability. |

#### Example

```json
{
  "channels": ["@MKBHD", "UCBJycsmduvYEL83R_U4JriQ"],
  "maxVideosPerChannel": 60
}
```

### Notes and limits

- Public channel data only. No login, no cookies, no Google account.
- View counts on channel grids are the **abbreviated** values YouTube displays ("8.2M views"), so they are rounded at source. Both the number and the original string are returned. For exact counts, run the video scraper on the IDs.
- Publish dates are relative on this surface ("1 day ago"), so `publishedApprox` is derived and approximate by definition. The original text is kept in `publishedText`.
- One request per channel returns roughly 30 videos. Deeper paging is not performed.

### Development

```bash
npm install
npm test
node src/main.js
```

# Actor input Schema

## `channels` (type: `array`):

YouTube channels as @handles, full channel URLs, or UC… channel IDs. All three forms work and can be mixed.

## `maxVideosPerChannel` (type: `integer`):

Hard cap on videos returned per channel, and therefore on cost. One page of a channel's Videos tab carries about 30 videos.

## `includeChannelInfo` (type: `boolean`):

Adds channel name, ID, handle, subscriber count, total video count, description and avatar to each video row.

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

Two-letter language code used for titles and metadata.

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

Two-letter country code. Affects availability and regional blocking.

## `requestDelayMs` (type: `integer`):

YouTube throttles bursts. Raise this if the log shows 429 or bot checks.

## `maxRetries` (type: `integer`):

Retries with exponential backoff on 403, 429 and 5xx.

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

YouTube refuses some datacenter IPs with a bot check. Blocked channels are never charged, but a residential proxy avoids the problem entirely.

## Actor input object example

```json
{
  "channels": [
    "@MKBHD"
  ],
  "maxVideosPerChannel": 60,
  "includeChannelInfo": true,
  "language": "en",
  "country": "US",
  "requestDelayMs": 600,
  "maxRetries": 4,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `videos` (type: `string`):

Video ID and URL, title, view count (numeric and as shown), duration, approximate publish date, Shorts flag, plus channel name, ID, handle, subscriber count, total video count, description and avatar.

## `runSummary` (type: `string`):

Per-channel outcome: videos delivered, renderer shape used, and any channel that failed or was blocked.

# 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 = {
    "channels": [
        "@MKBHD"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dottti/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 = { "channels": ["@MKBHD"] }

# Run the Actor and wait for it to finish
run = client.actor("dottti/youtube-channel-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 '{
  "channels": [
    "@MKBHD"
  ]
}' |
apify call dottti/youtube-channel-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dottti/youtube-channel-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/Y3IRKhcfB2OLCsKYI/builds/6YNtF2g0z3ICHRrPt/openapi.json
