# YouTube Channel Scraper ($0.20/1K videos) (`mathtec/youtube-channel-scraper`) Actor

Scrape YouTube channels: newest videos, Shorts or live streams with title, exact view count, duration and publish time, plus channel info (subscribers, total views, video count, join date, country, links). No login. Failed channels are free.

- **URL**: https://apify.com/mathtec/youtube-channel-scraper.md
- **Developed by:** [Adam Rudd](https://apify.com/mathtec) (community)
- **Categories:** Videos, Social media, Automation
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 1,000 video rows

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 Channel Scraper (videos, Shorts, live + channel info)

List the newest **videos, Shorts or live streams** of YouTube channels, with **channel info on every row**. No login, no
cookies, no YouTube API key.

- **Input:** channel links (`@handle`, `/channel/UC...`, `/c/...`, `/user/...`), bare `@handles` or `UC...` channel ids.
  Add `/videos`, `/shorts` or `/streams` to a link to take that tab for that channel; otherwise `contentType` decides.
- **Video fields:** `videoId`, `url`, `title`, `viewCount` (exact for videos and streams; rounded for Shorts, flagged by
  `viewCountIsApprox`), `viewCountText`, `duration`, `durationSeconds`, `publishedTimeText` (for example `3 days ago`),
  `isLiveNow`, `thumbnailUrl`, `rank` (position on the tab, newest first).
- **Channel fields (every row):** `channelId`, `channelName`, `channelHandle`, `channelUrl`, `channelIsVerified`,
  `subscriberCount` (YouTube shows it rounded, e.g. 21.4M), `channelVideoCount`, `channelTotalViews`, `channelJoinedDate`,
  `channelCountry`, `channelLinks`, `channelDescription`, `channelKeywords`, `channelAvatarUrl`.
- **Channel info only:** set `maxVideosPerChannel` to `0` to get one row per channel.
- **Failures are free:** a channel that does not exist, a link that is not a channel, or a tab the channel does not have
  gives a row with `status` `failed`, `rejected` or `empty` and the reason, and is not charged.

### Input

| Field | Default | Notes |
|---|---|---|
| `channels` | *(required)* | channel links, @handles or UC ids |
| `contentType` | `videos` | `videos`, `shorts` or `streams` (when the link names no tab) |
| `maxVideosPerChannel` | `30` | newest items per channel; `0` = channel info only |
| `includeChannelInfo` | `true` | exact total views and video count, join date, country, links (one extra request per channel) |

### Output example

```json
{
  "input": "@3blue1brown",
  "status": "ok",
  "rank": 1,
  "type": "video",
  "videoId": "LKrwhjOI8Nc",
  "url": "https://www.youtube.com/watch?v=LKrwhjOI8Nc",
  "title": "There's never been a better time to go into math",
  "viewCount": 2194622,
  "viewCountIsApprox": false,
  "duration": "40:44",
  "durationSeconds": 2444,
  "publishedTimeText": "3 days ago",
  "channelId": "UCYO_jab_esuFRV4b17AJtAw",
  "channelName": "3Blue1Brown",
  "channelHandle": "@3blue1brown",
  "subscriberCount": 8710000,
  "channelVideoCount": 246,
  "channelTotalViews": 786479275,
  "channelJoinedDate": "2015-03-03",
  "channelCountry": "United States"
}
```

### Pricing

One price per returned row (video, Short or stream; or channel row with `maxVideosPerChannel` 0). See the Pricing tab.
Failed, rejected and empty rows are free. The run stops when your maximum charge is reached.

### What it does not do (yet)

Exact publish dates (YouTube's channel tabs give relative times such as `3 days ago`), like and comment counts, and
Shorts durations. For transcripts of the same videos, use our [YouTube Transcript](https://apify.com/mathtec/youtube-transcript) Actor.

### Responsible use

You are responsible for how you use the data, including personal data and YouTube's terms.

# Actor input Schema

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

Channel links (@handle, /channel/UC..., /c/..., /user/...), @handles or UC... channel ids. Add /videos, /shorts or /streams to a link to take that tab for that channel. One dataset row per video.

## `contentType` (type: `string`):

The channel tab to list when a link names no tab.

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

Newest videos (or Shorts / streams) per channel. 0 returns one row of channel info per channel, without videos.

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

Add the About panel to every row: exact total views and video count, join date, country and links. Off: only the header's rounded subscriber and video counts.

## Actor input object example

```json
{
  "channels": [
    "https://www.youtube.com/@veritasium"
  ],
  "contentType": "videos",
  "maxVideosPerChannel": 30,
  "includeChannelInfo": true
}
```

# Actor output Schema

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

Dataset items: input, status (ok | empty | failed | rejected), rank, type (video | short | stream | channel), videoId, url, title, viewCount, viewCountIsApprox, viewCountText, isLiveNow, duration, durationSeconds, publishedTimeText, thumbnailUrl; channelId, channelName, channelHandle, channelUrl, channelIsVerified, subscriberCount, subscriberCountText, channelVideoCount, channelTotalViews, channelJoinedDate, channelCountry, channelDescription, channelLinks, channelKeywords, channelAvatarUrl; error when not ok.

# 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": [
        "https://www.youtube.com/@veritasium"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mathtec/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": ["https://www.youtube.com/@veritasium"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mathtec/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/UjlosrCatrBIIFEKF/builds/zYJsSim9ls0nE2dC0/openapi.json
