# YouTube Channel Videos Scraper (`serentity/youtube-channel-videos-scraper`) Actor

List every video of a YouTube channel from its URL, @handle or ID: title, views, duration, publish date, Shorts and live streams separated. Sort by latest, popular or oldest. No API key, no quota.

- **URL**: https://apify.com/serentity/youtube-channel-videos-scraper.md
- **Developed by:** [Tarik Cerkezovic](https://apify.com/serentity) (community)
- **Categories:** Videos, Social media, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 video listeds

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 Videos Scraper

List every video a YouTube channel has published, from its URL, @handle or channel ID. Each item carries the title, view count, duration, publish date and type (video, Short, live stream or scheduled premiere), plus the channel's name, handle, subscriber count and video count. Sort the Videos tab by latest, popular or oldest, cap the number per channel, or take everything.

No YouTube API key, no quota, no login. Built for channel analytics, content research, competitor tracking and feeding video lists into other tools such as a transcript scraper.

### What you get

| Field | Description |
|---|---|
| `videoId`, `url`, `title`, `type` | The video; `type` is `video`, `short`, `live` or `upcoming` |
| `durationSeconds`, `durationText` | Length (not available for Shorts on the Shorts tab) |
| `viewCount`, `viewCountText` | Views as a number and as YouTube shows it |
| `publishedText`, `publishedAt` | "3 weeks ago" and an ISO date estimated from it |
| `thumbnailUrl` | Largest thumbnail |
| `tab`, `position` | Which tab the item came from and its position in the requested order |
| `channelId`, `channelName`, `channelHandle`, `channelUrl`, `subscriberCount`, `videoCount`, `avatarUrl` | Channel fields, repeated on every item |
| `error`, `errorMessage` | Present only on channel-level failures |

### Sample output

```json
{
  "videoId": "ZAzWPE9CItg",
  "url": "https://www.youtube.com/watch?v=ZAzWPE9CItg",
  "title": "AI Crisis in Math: Navier-Stokes, Riemann Hypothesis & Complexity Theory | Lex Fridman Podcast #503",
  "type": "video",
  "durationSeconds": 12867,
  "durationText": "3:34:27",
  "viewCount": 1300000,
  "viewCountText": "1.3M views",
  "publishedText": "9 days ago",
  "publishedAt": "2026-10-27T15:20:11.000Z",
  "thumbnailUrl": "https://i.ytimg.com/vi/ZAzWPE9CItg/hq720.jpg",
  "tab": "videos",
  "position": 1,
  "channelId": "UCSHZKyawb77ixDdsGog4iWA",
  "channelName": "Lex Fridman",
  "channelHandle": "@lexfridman",
  "channelUrl": "https://www.youtube.com/channel/UCSHZKyawb77ixDdsGog4iWA",
  "subscriberCount": 5070000,
  "videoCount": 870,
  "input": "@lexfridman",
  "fetchedAt": "2026-11-05T16:40:00.000Z"
}
```

### Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `channelUrls` | array of strings | required | Channel URLs, `@handles`, bare handles or `UC...` IDs. Legacy `/c/` and `/user/` URLs work too. |
| `maxVideosPerChannel` | integer | `100` | Cap per channel per tab. `0` takes everything. |
| `sortBy` | `latest`, `popular`, `oldest` | `latest` | Order of the Videos tab. |
| `includeVideos` | boolean | `true` | The Videos tab. |
| `includeShorts` | boolean | `false` | The Shorts tab. Shorts have title and views only. |
| `includeLive` | boolean | `false` | The Live tab: past streams, current streams and scheduled premieres. |
| `maxConcurrency` | integer | `3` | Channels in parallel. |
| `proxyConfiguration` | object | Apify datacenter proxy | Proxy for all requests. |
| `residentialFallback` | boolean | `true` | Retry a blocked channel through residential proxies. Only used on a detected block. |

Minimal input:

```json
{ "channelUrls": ["@NASA"], "maxVideosPerChannel": 50 }
```

### Errors

A channel that cannot be processed becomes one item with an `error` code; the run never fails because of one bad input.

| `error` | Meaning | Charged? |
|---|---|---|
| `INVALID_INPUT` | Not a channel URL, handle or ID | no |
| `CHANNEL_NOT_FOUND` | Handle or URL does not resolve to a channel, or the channel was terminated | no |
| `NO_VIDEOS` | The channel has none of the requested tabs, or they are empty | no |
| `BLOCKED` | YouTube refused the request from every proxy tried | no |
| `FETCH_FAILED` | Network or parsing failure | no |

### Pricing

Pay per event: a small fixed amount per video item returned, plus Apify platform usage. Error items are free. Set a maximum total charge on the run and the actor stops cleanly at the limit.

Typical cost: a channel with 1,000 videos takes about 35 requests and a few seconds.

### Notes

- `publishedAt` is derived from the relative text YouTube shows ("2 years ago"), so it is only as precise as that text. For exact publish dates use the video page or a transcript/metadata actor on the video IDs.
- View counts are rounded the way YouTube rounds them in lists ("1.3M views").
- The Live tab lists scheduled premieres as `upcoming` with the scheduled time in `publishedText`.
- The actor uses YouTube's own web data endpoints with datacenter proxies first and residential proxies only on a detected block, which keeps platform cost low.

### Using it from code

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('serentity/youtube-channel-videos-scraper').call({ channelUrls: ['@NASA'], maxVideosPerChannel: 200 });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((v) => [v.title, v.viewCount]));
```

### Legal

The data is what YouTube shows to any visitor of a public channel page. No login, no personal data beyond the public channel name and handle. Use it in line with YouTube's terms of service.

# Actor input Schema

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

Any of: https://www.youtube.com/@handle, @handle, https://www.youtube.com/channel/UC..., a bare UC... channel ID, or legacy /c/ and /user/ URLs.

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

Stop after this many items per channel per tab. 0 means all videos the channel has.

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

Order of the Videos tab. Shorts and live tabs are always newest first.

## `includeVideos` (type: `boolean`):

The Videos tab.

## `includeShorts` (type: `boolean`):

The Shorts tab. Shorts items have views and title but no duration or publish date, because YouTube does not list those on the tab.

## `includeLive` (type: `boolean`):

The Live tab: past streams, current streams and scheduled premieres.

## `maxConcurrency` (type: `integer`):

Channels processed in parallel.

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

Proxy used for the requests. Apify datacenter proxies are used by default.

## `residentialFallback` (type: `boolean`):

If YouTube blocks the datacenter proxy for a channel, retry through Apify residential proxies. Only used on a detected block.

## Actor input object example

```json
{
  "channelUrls": [
    "https://www.youtube.com/@NASA",
    "@lexfridman"
  ],
  "maxVideosPerChannel": 100,
  "sortBy": "latest",
  "includeVideos": true,
  "includeShorts": false,
  "includeLive": false,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "residentialFallback": true
}
```

# 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 = {
    "channelUrls": [
        "https://www.youtube.com/@NASA",
        "@lexfridman"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("serentity/youtube-channel-videos-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 = {
    "channelUrls": [
        "https://www.youtube.com/@NASA",
        "@lexfridman",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("serentity/youtube-channel-videos-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 '{
  "channelUrls": [
    "https://www.youtube.com/@NASA",
    "@lexfridman"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call serentity/youtube-channel-videos-scraper --silent --output-dataset

```

## MCP server setup

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