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

Extract YouTube channel data at scale, including channel names, descriptions, subscriber counts, video totals, views, handles, URLs, thumbnails, and metadata. Ideal for creator research, influencer discovery, competitor analysis, lead generation, and YouTube analytics.

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

## Pricing

from $0.99 / 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.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

### What does YouTube Channel Scraper do?

YouTube Channel Scraper collects public video listings and channel metadata from YouTube channel URLs. Add a handle URL such as `https://www.youtube.com/@Apify/videos`, a channel ID URL, or a legacy custom channel URL, then receive one structured dataset item per video.

Use the results for creator research, competitor monitoring, content planning, publishing-cadence analysis, media catalogs, and AI or RAG datasets. The actor follows the channel's public video feed, supports YouTube's available sorting options, and removes empty values from each item.

### Why use YouTube Channel Scraper?

- **One or many channels** - Collect videos from a single channel or combine several channels in one run.
- **Useful channel context** - Keep the channel name, handle, URL, description, subscriber text, and channel video count with each video.
- **Video-level records** - Get title, direct video URL, publication text, views text, duration, thumbnail, and content status flags.
- **Sorting controls** - Request latest, popular, or oldest videos when the channel exposes that option.
- **Pagination limits** - Control both the number of saved results and the number of pages requested per channel.
- **Optional video details** - Enrich each saved video with public detail data such as numeric views, likes, comment count, full description, tags, and category.
- **Compact datasets** - Empty and unavailable values are omitted instead of being written as repeated `null` fields.
- **Automation-ready** - Download JSON, CSV, Excel, or XML, schedule repeat runs, use webhooks, or retrieve results through the Apify API.

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

| Field | Type | Description |
|-------|------|-------------|
| `channel_id` | String | YouTube channel identifier when available. |
| `channel_title` | String | Public channel name. |
| `channel_url` | String | Canonical or requested channel URL. |
| `channel_handle` | String | Public handle when available. |
| `channel_description` | String | Public channel description when available. |
| `channel_subscriber_count` | String | Subscriber count text shown by YouTube. |
| `channel_video_count` | String | Channel video count text shown by YouTube. |
| `video_id` | String | Unique YouTube video identifier. |
| `title` | String | Public video title. |
| `url` | String | Direct YouTube video URL. |
| `description` | String | Video description snippet when available. |
| `published_text` | String | Relative or localized publication text. |
| `view_count_text` | String | Localized view count text. |
| `view_count` | Number | Numeric view count when video details are enabled and available. |
| `duration_text` | String | Localized duration text. |
| `duration_seconds` | Number | Duration in seconds when available. |
| `thumbnail_url` | String | Best available video thumbnail URL. |
| `like_count` | Number | Public like count when video details are enabled and available. |
| `comment_count` | Number | Public comment count when video details are enabled and available. |
| `tags` | Array | Public video tags when video details are enabled and available. |
| `category` | String | YouTube video category when video details are enabled and available. |
| `canonical_url` | String | Canonical video URL when video details are enabled and available. |
| `is_private` | Boolean | Privacy status from video details when available. |
| `is_unlisted` | Boolean | Unlisted status from video details when available. |
| `is_family_safe` | Boolean | Family-safe status from video details when available. |
| `video_details_fetched` | Boolean | Indicates that detail mode was requested for the record. |
| `is_live` | Boolean | Whether YouTube marks the video as live. |
| `is_upcoming` | Boolean | Whether the video is scheduled for the future. |
| `is_premiere` | Boolean | Whether the video is marked as a premiere. |
| `has_captions` | Boolean | Whether YouTube marks captions as available. |

### How to use YouTube Channel Scraper

1. Add one or more public YouTube channel URLs in `startUrls`.
2. Choose the video sorting order.
3. Set `results_wanted` and `max_pages`.
4. Start the run and review the dataset preview.
5. Export the data or connect the dataset to your workflow.

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `startUrls` | Array of URL objects | Yes | Apify channel example | YouTube channel URLs. Supports handle, `/channel/UC...`, `/c/...`, and `/user/...` formats. |
| `sort_by` | String | No | `latest` | Video order: `latest`, `popular`, or `oldest`. |
| `results_wanted` | Integer | No | `20` | Maximum number of unique videos across all input URLs. |
| `max_pages` | Integer | No | `5` | Maximum number of video batches requested per channel. |
| `fetch_video_details` | Boolean | No | `false` | Fetch public detail data for each video. Adds extra InnerTube requests and may increase runtime. |

### Usage Examples

#### Collect recent videos from a channel

Use a handle URL for the simplest run:

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/@Apify/videos"
    }
  ],
  "sort_by": "latest",
  "results_wanted": 20,
  "max_pages": 3,
  "fetch_video_details": false
}
```

Set `fetch_video_details` to `true` when you need public likes, comment counts, full descriptions, tags, category, and numeric view counts:

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/@Apify/videos"
    }
  ],
  "fetch_video_details": true,
  "results_wanted": 20,
  "max_pages": 3
}
```

#### Collect popular videos from multiple URL formats

Mix channel handles, channel ID URLs, and custom channel URLs in one run:

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/@Apify"
    },
    {
      "url": "https://www.youtube.com/channel/UCxxxxxxxxxxxxxxxxxxxxxx"
    },
    {
      "url": "https://www.youtube.com/c/example"
    }
  ],
  "sort_by": "popular",
  "results_wanted": 50,
  "max_pages": 5
}
```

#### Collect oldest videos

Use a larger page cap for historical channel research:

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/user/example"
    }
  ],
  "sort_by": "oldest",
  "results_wanted": 100,
  "max_pages": 10
}
```

### Sample Output

```json
{
  "channel_title": "Apify",
  "channel_url": "https://www.youtube.com/@Apify/videos",
  "channel_handle": "@Apify",
  "channel_subscriber_count": "12.3K subscribers",
  "video_id": "OcYfUaFzXdY",
  "title": "A practical guide to web data collection",
  "url": "https://www.youtube.com/watch?v=OcYfUaFzXdY",
  "published_text": "2 weeks ago",
  "view_count_text": "1.2K views",
  "duration_text": "12:34",
  "duration_seconds": 754,
  "thumbnail_url": "https://i.ytimg.com/vi/OcYfUaFzXdY/maxresdefault.jpg",
  "is_live": false,
  "is_upcoming": false,
  "is_premiere": false,
  "has_captions": true
}
```

### Tips for Best Results

- Use the `/videos` version of a channel URL when available, although the actor also resolves the channel root URL.
- Start with `results_wanted: 20` and `max_pages: 3` to validate a channel before requesting a larger history.
- Use `popular` for performance research and `oldest` for channel-history or publishing-cadence studies.
- Enable `fetch_video_details` only when needed because it makes additional InnerTube requests for each video.
- A channel may provide fewer videos than requested, and some status or metadata fields may be absent for individual records.
- Use `video_id` as the stable key when comparing scheduled runs.

### Integrations and Export Formats

- **Google Sheets** - Review publishing cadence, titles, and view-count text in a spreadsheet.
- **Airtable** - Build a searchable creator or competitor video catalog.
- **Webhooks** - Notify downstream systems when a scheduled run finishes.
- **Make or Zapier** - Trigger alerts, enrichment, and reporting workflows.
- **Apify API** - Start runs and retrieve dataset items programmatically.
- **Export formats** - Download JSON, CSV, Excel, XML, and other formats supported by Apify.

### Frequently Asked Questions

#### Which YouTube URL formats are supported?

Handle URLs, channel ID URLs, custom `/c/` URLs, and legacy `/user/` URLs are supported. The URL may point to the channel root or its videos tab.

#### Can I collect videos from multiple channels?

Yes. Add multiple URL objects to `startUrls`; `results_wanted` is the total cap across the run.

#### Does the actor need a YouTube login or API key?

No. It collects public channel and video information and does not require user credentials.

#### Why are some fields missing?

YouTube does not publish every field for every video or channel. The actor omits unavailable values to keep each dataset item compact.

#### Does detail mode include dislikes and full comments?

Detail mode includes public like and comment counts when YouTube exposes them. Exact public dislike totals are not reliably exposed by YouTube, and full comment threads are not fetched by this actor.

#### Can I collect all videos from a channel?

Set a high `results_wanted` value and increase `max_pages`. The final count depends on the channel's public feed and the limits YouTube returns.

#### Can I run this on a schedule?

Yes. Create an Apify schedule to collect new channel videos hourly, daily, weekly, or at a custom interval.

#### Is collecting YouTube data legal?

You are responsible for complying with YouTube's terms, applicable laws, copyright rules, and privacy requirements. Use public data responsibly and avoid collecting information you do not need.

### Related Actors

- [Reddit Community Scraper](https://apify.com/shahidirfan/reddit-community-scraper) - Collect public community content for audience and trend research.
- [Apify Store Scraper](https://apify.com/shahidirfan/apify-store-scraper) - Monitor public tool listings and marketplace metadata for competitive research.

### Support

For issues or feature requests, use the Issues tab on the Actor page or contact the developer through Apify.

### Legal Notice

This Actor is intended for legitimate collection of publicly available information. Users are responsible for complying with YouTube's terms of service, applicable laws, copyright obligations, and privacy rules.

# Actor input Schema

## `startUrls` (type: `array`):

Channel URLs such as /@handle, /channel/UC..., /c/name, or /user/name.

## `sort_by` (type: `string`):

Sort videos by latest, popular, or oldest when the channel provides that option.

## `results_wanted` (type: `integer`):

Maximum number of unique videos to save across all input channels.

## `max_pages` (type: `integer`):

Maximum number of InnerTube video batches to request for each channel.

## `fetch_video_details` (type: `boolean`):

Fetch each video's public detail data for likes, comment count, full description, tags, category, and numeric view count.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/@Apify/videos"
    }
  ],
  "sort_by": "latest",
  "results_wanted": 20,
  "max_pages": 3,
  "fetch_video_details": false
}
```

# Actor output Schema

## `overview` (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 = {
    "startUrls": [
        {
            "url": "https://www.youtube.com/@Apify/videos"
        }
    ],
    "sort_by": "latest",
    "results_wanted": 20,
    "max_pages": 3,
    "fetch_video_details": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("shahidirfan/youtube-channel-scraper-api").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 = {
    "startUrls": [{ "url": "https://www.youtube.com/@Apify/videos" }],
    "sort_by": "latest",
    "results_wanted": 20,
    "max_pages": 3,
    "fetch_video_details": False,
}

# Run the Actor and wait for it to finish
run = client.actor("shahidirfan/youtube-channel-scraper-api").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 '{
  "startUrls": [
    {
      "url": "https://www.youtube.com/@Apify/videos"
    }
  ],
  "sort_by": "latest",
  "results_wanted": 20,
  "max_pages": 3,
  "fetch_video_details": false
}' |
apify call shahidirfan/youtube-channel-scraper-api --silent --output-dataset

```

## MCP server setup

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

```

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/eiDZnKQPG7r1QoFiu/builds/UkX9cefoP1R1ozMGA/openapi.json
