# YouTube Channel Scraper - Videos, Shorts, Subscribers & About (`socialscrapers/youtube-channel-scraper`) Actor

YouTube Channel Scraper: scrape any YouTube channel by URL or @handle: all its videos, Shorts and live streams with views, likes and dates, plus channel stats from the About page: subscribers, total views, videos, join date, country, links. No login or API key. $0.35 per 1,000 videos.

- **URL**: https://apify.com/socialscrapers/youtube-channel-scraper.md
- **Developed by:** [Social Scrapers](https://apify.com/socialscrapers) (community)
- **Categories:** Videos, Social media
- **Features:** Limited permissions
- **Stats:** 8 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.28 / 1,000 videos

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** extracts everything public about a YouTube channel: **all its videos, Shorts and live streams** with their exact views, likes, comment counts and publish dates, plus the **channel's About data**: subscribers, total views, number of videos, join date, country, links, description, avatar and banner. Paste channel URLs or @handles, get clean JSON, CSV or Excel. **No login, no API key**, from **$0.35 per 1,000 videos**.

> 💡 **Need a feature that isn't here? Just ask.** Open an issue on the **Issues** tab and tell us what you need: a new field, filter, input type or output format. We build requested features fast, usually within 24 hours, at no extra cost.

> ⭐ **Found it useful?** A short review on the **Reviews** tab helps other people find this scraper, and tells us what to build next.

### What does YouTube Channel Scraper do?

YouTube Channel Scraper reads YouTube channels the way a visitor sees them, and saves them as structured data:

- 📺 **Every video of a channel**: the Videos tab from newest to oldest, with no upper limit, so you can export a whole channel.
- 🎬 **Shorts and live streams**: the Shorts tab and the Live tab, each with its own limit.
- 🔀 **Latest, Popular or Oldest**: the same sort buttons as on the channel page, so you can get a channel's most viewed videos first.
- 👤 **Channel details from the About page**: subscribers, total views, video count, join date, country, links (website, social profiles), keywords, description, avatar and banner, as one channel item per channel.
- 📅 **Date range**: only videos published after or before a date (`2026-01-31`, `31/01/2026`, `Jan 31 2026`), or within an age like `30 days` or `2w`. In Latest order the scraper stops reading a channel as soon as its videos are older.
- 📊 **Exact numbers**: exact view, like and comment counts, tags and category (hidden on YouTube's page), chapters, and the paid-promotion flag of each video.
- ✅ **Pay only for results**, with a maximum cost per run if you want one.

### What data can you extract from a YouTube channel?

| Item | Data |
| --- | --- |
| **Channel** | name, @handle, channel ID, URL, description, subscribers, total videos, total views, join date, country, links, keywords, avatar, banner, verified badge |
| **Video, Short or stream** | title, description, URL, publish date and time, duration, views, likes, comment count, tags, hashtags, category, thumbnail, chapters, video type, live status, members-only, age-restricted, paid promotion, links in the description |
| **Position** | the video's place in the channel tab (1 = first in the chosen order) |

### How to scrape a YouTube channel

1. Open YouTube Channel Scraper on Apify and click **Try for free**.
2. Paste one or more **channel URLs or @handles**, such as `https://www.youtube.com/@NASA` or `@NASA`.
3. Set **Max videos per channel**, and **Max Shorts per channel** or **Max live streams per channel** if you want those.
4. Pick the order (**Latest**, **Popular** or **Oldest**) and, optionally, a date range.
5. Keep **Save channel details** on for the About data, click **Start**, and download the results as JSON, CSV, Excel, XML or HTML.

#### How to export all videos from a YouTube channel

Set **Max videos per channel** to a number at least as large as the channel's video count (the channel item's `videoCount` tells you), and keep the order on **Latest**. The scraper pages through the whole Videos tab.

#### How to find a channel's most popular videos

Choose **Popular** as the order. The channel's most viewed videos come first, as on the channel's own Popular button; set the limit to how many you want.

#### How to get YouTube channel subscribers and About info

Keep **Save channel details** on and set **Max videos per channel** to `0`: each channel then costs one channel item, with its subscribers, views, video count, join date, country and links.

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

Pay per result, with platform usage and proxies included and no monthly fee for the Actor:

| Result | Price per 1,000 | Silver plan | Gold plan |
| --- | --- | --- | --- |
| Videos (Shorts and live streams included) | **$0.35** | $0.315 | $0.28 |
| Channel details | **$0.47** | $0.423 | $0.376 |

Each run also has Apify's standard **Actor start** charge: $0.001 per run (one event per GB of memory, at least one; this Actor uses at most 1 GB, so one event per run).

Examples:

- **The details of 1,000 channels** (no videos): **$0.47**.
- **100 channels with their latest 50 videos each** (5,000 videos): $1.75 + $0.05 = **$1.80**.
- **A channel's whole archive of 6,000 videos**: **$2.10**.

Apify's free plan comes with $5 of platform credit every month, enough to try it on about 14,000 videos. Set a **maximum cost per run** and the scraper stops cleanly before the first result that would go over it.

### Input example

```json
{
  "startUrls": ["https://www.youtube.com/@NASA", "@SpaceX", "https://www.youtube.com/channel/UCLA_DiR1FfKNvjuUpBHmylQ/shorts"],
  "maxVideosPerChannel": 200,
  "maxShortsPerChannel": 50,
  "maxStreamsPerChannel": 0,
  "channelSortBy": "newest",
  "includeChannelInfo": true,
  "publishedAfter": "2026-01-01"
}
```

Channel URLs can be `/@handle`, `/channel/UC…`, `/c/…` or `/user/…` links, or bare @handles. A URL ending in `/videos`, `/shorts` or `/streams` reads only that tab.

### Output example

Each result has a `dataType`: `channel` or `video`. NASA's channel item:

```json
{
  "dataType": "channel",
  "id": "UCLA_DiR1FfKNvjuUpBHmylQ",
  "url": "https://www.youtube.com/@NASA",
  "name": "NASA",
  "handle": "@NASA",
  "description": "NASA's mission is to pioneer the future in space exploration, scientific discovery, and aeronautics research...",
  "subscriberCount": 15100000,
  "videoCount": 6201,
  "viewCount": 1134443909,
  "joinedAt": "2008-06-03",
  "country": null,
  "links": [
    { "title": "nasa.gov", "url": "https://www.nasa.gov" },
    { "title": "X", "url": "https://x.com/nasa" },
    { "title": "Instagram", "url": "https://www.instagram.com/nasa" }
  ],
  "keywords": ["nasa", "space", "iss", "hubble", "apollo", "Artemis"],
  "avatar": "https://yt3.googleusercontent.com/...=s160-c-k-c0x00ffffff-no-rj",
  "isVerified": true,
  "sourceUrl": "https://www.youtube.com/@NASA"
}
```

One of its videos:

```json
{
  "dataType": "video",
  "id": "0E0S07VMSYI",
  "url": "https://www.youtube.com/watch?v=0E0S07VMSYI",
  "title": "Hubble: Vision, Hope and Triumph",
  "publishedAt": "2008-12-02T17:14:12.000Z",
  "duration": "00:04:36",
  "viewCount": 13808,
  "likeCount": 79,
  "commentCount": 16,
  "tags": ["nasa", "hubble", "space", "telescope", "science", "repair", "shuttle", "sts-125"],
  "category": "Science & Technology",
  "videoType": "video",
  "channelName": "NASA",
  "channelSubscriberCount": 15100000,
  "sourceType": "channel",
  "position": 34
}
```

### Use cases

- **Competitor analysis**: what a rival channel publishes, how often, and which videos work best.
- **Influencer research and outreach**: subscribers, country, links and contact pages of channels in a niche.
- **Content strategy**: a channel's most popular videos, their titles, tags and lengths.
- **Channel monitoring**: schedule a weekly run with a date range to get every new upload.
- **Archiving and research**: a full, dated list of a channel's videos for media or academic studies.

### Use it via API, Python, JavaScript and integrations

Run it and get the results in one call with the [Apify API](https://docs.apify.com/api/v2):

```bash
curl -X POST "https://api.apify.com/v2/acts/socialscrapers~youtube-channel-scraper/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls": ["@NASA"], "maxVideosPerChannel": 50}'
```

Python, with the [Apify client](https://docs.apify.com/api/client/python):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("socialscrapers/youtube-channel-scraper").call(run_input={"startUrls": ["@NASA"], "maxVideosPerChannel": 0})
for channel in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(channel["name"], channel["subscriberCount"])
```

JavaScript, with the [Apify client](https://docs.apify.com/api/client/js):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('socialscrapers/youtube-channel-scraper').call({ startUrls: ['@NASA'], channelSortBy: 'popular', maxVideosPerChannel: 20 });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

Schedule runs, get a webhook when one finishes, or send the data to **Make, Zapier, n8n, Google Sheets** and other tools through [Apify integrations](https://docs.apify.com/integrations). AI agents and assistants can run it through [Apify's MCP server](https://docs.apify.com/mcp).

### YouTube Data API vs YouTube Channel Scraper

| | Official YouTube Data API | YouTube Channel Scraper |
| --- | --- | --- |
| Setup | Google Cloud project and API key | None: paste channel URLs or @handles |
| Limits | 10,000 quota units a day by default | No quota |
| Channel tabs | One request per page of results, counted against the quota | Videos, Shorts and Live tabs in Latest, Popular or Oldest order |
| Price | Free within the quota | $0.35 per 1,000 videos, $0.47 per 1,000 channels |

### Limits

- **Public channels and videos only.** The scraper never signs in; private, deleted and members-only content is not available.
- **Subscriber counts** are as precise as YouTube shows them ("15.1M" becomes 15100000). View, like and comment counts of videos are exact.
- **Country** is only known when the channel lists one.
- Some channels have no Shorts or Live tab; the log says so.
- **Datacenter proxy choices fall back to residential.** If you pick Apify Proxy without the RESIDENTIAL group, the first session YouTube refuses moves the run to RESIDENTIAL, in the same country; custom proxy URLs are used exactly as given.
- **Share links work as they are**: channel links with the app's `?si=…` share parameter, `m.youtube.com` links and `youtube.com/@handle` links all name the same channel.
- **A run with 0 results still succeeds.** When a channel does not exist or shows nothing public, the run ends as Succeeded with a status message naming each channel and why, and nothing is charged. When nothing in the input can be used at all, the run also ends as Succeeded, with a status message that starts "Nothing to scrape:" and says what to fix; no results are charged. A run fails only when YouTube refuses every one of 3 or more channels and a well-known public channel is refused too (the scraper is then blocked; try again later).

### FAQ

**Is it legal to scrape YouTube channels?**
YouTube Channel Scraper collects only data that anyone can see without signing in. Channel details can include personal data protected by laws such as the GDPR, so collect only what you need. You are responsible for how you use the data and for following YouTube's terms and the laws that apply to you.

**Do I need a YouTube API key?**
No. Paste channel URLs or @handles and start the run.

**How many videos can I get from one channel?**
All of them: there is no upper limit, and the scraper reads the channel's tabs until YouTube has no more.

**Can I scrape many channels at once?**
Yes, paste as many as you want, one per line. They are read side by side.

**How do I get only new videos from a channel?**
Set **Published on or after** (for example `7 days`) and schedule the run. In Latest order, reading stops at the first older videos.

**Can I get the comments too?**
Use [YouTube Comments Scraper](https://apify.com/socialscrapers/youtube-comments-scraper), or [YouTube Scraper](https://apify.com/socialscrapers/youtube-scraper), which does channels, search, comments and subtitles in one Actor.

### Other scrapers by Social Scrapers

| Scraper | What it gets |
| --- | --- |
| [TikTok API](https://apify.com/socialscrapers/tiktok-api) | Profiles, Videos and Comments |
| [TikTok Comments Scraper](https://apify.com/socialscrapers/tiktok-comments-scraper) | Comments, Replies and Likes |
| [TikTok Hashtag Scraper](https://apify.com/socialscrapers/tiktok-hashtag-scraper) | Top Videos, Views and Likes |
| [TikTok Profile Scraper](https://apify.com/socialscrapers/tiktok-profile-scraper) | Followers, Bio, Stats and Videos |
| [TikTok Scraper](https://apify.com/socialscrapers/tiktok-scraper) | Videos, Profiles, Hashtags and Comments |
| [TikTok Sound Scraper](https://apify.com/socialscrapers/tiktok-sound-scraper) | Videos Using a Sound and Music Info |
| [TikTok Video Scraper](https://apify.com/socialscrapers/tiktok-video-scraper) | Views, Likes, Captions and Comments |
| [Instagram API](https://apify.com/socialscrapers/instagram-api) | Profiles, Posts, Reels, Comments and Hashtags |
| [Instagram Comments Scraper](https://apify.com/socialscrapers/instagram-comments-scraper) | Comments, Likes and Reply Counts |
| [Instagram Hashtag Scraper](https://apify.com/socialscrapers/instagram-hashtag-scraper) | Reels and Keyword Search |
| [Instagram Post Details Scraper](https://apify.com/socialscrapers/instagram-post-details-scraper) | Likes, Comments, Views and Media |
| [Instagram Post Scraper](https://apify.com/socialscrapers/instagram-post-scraper) | Posts, Reels and Comments |
| [Instagram Profile Scraper](https://apify.com/socialscrapers/instagram-profile-scraper) | Followers, Bio, Posts and Reels |
| [Instagram Reels Scraper](https://apify.com/socialscrapers/instagram-reels-scraper) | Reels, Plays, Likes and Comments |
| [Instagram Reels Transcript Scraper](https://apify.com/socialscrapers/instagram-reels-transcript-scraper) | Speech to Text and Captions |
| [Instagram Scraper](https://apify.com/socialscrapers/instagram-scraper) | Posts, Profiles, Reels, Comments and Hashtags |
| [YouTube API](https://apify.com/socialscrapers/youtube-api) | Videos, Transcripts, Search, Channels and Comments |
| [YouTube Comments Scraper](https://apify.com/socialscrapers/youtube-comments-scraper) | Comments, Replies and Likes |
| [YouTube Scraper](https://apify.com/socialscrapers/youtube-scraper) | Videos, Shorts, Channels and Comments |
| [YouTube Search Scraper](https://apify.com/socialscrapers/youtube-search-scraper) | Videos, Channels, Views and Filters |
| [YouTube Shorts Scraper](https://apify.com/socialscrapers/youtube-shorts-scraper) | Shorts, Views, Likes and Search |
| [YouTube Transcript Scraper](https://apify.com/socialscrapers/youtube-transcript-scraper) | Subtitles, Captions and SRT |
| [YouTube Video Details Scraper](https://apify.com/socialscrapers/youtube-video-details-scraper) | Stats, Subtitles and Comments |
| [Facebook Ads Library Scraper](https://apify.com/socialscrapers/facebook-ads-library-scraper) | Meta Ad Library and Spend |
| [Facebook Comments Scraper](https://apify.com/socialscrapers/facebook-comments-scraper) | Posts, Reels, Videos and Replies |
| [Facebook Groups Scraper](https://apify.com/socialscrapers/facebook-groups-scraper) | Public Group Posts and Reactions |
| [Facebook Marketplace Scraper](https://apify.com/socialscrapers/facebook-marketplace-scraper) | Prices, Locations and Sellers |
| [Facebook Page Contact Info Scraper](https://apify.com/socialscrapers/facebook-page-contact-scraper) | Email, Phone and WhatsApp |
| [Facebook Posts Scraper](https://apify.com/socialscrapers/facebook-profile-posts-scraper) | Pages, Profiles and Timelines |
| [Facebook Pages Scraper](https://apify.com/socialscrapers/facebook-profile-scraper) | Profiles, Contact Info and Reviews |
| [Facebook Reels Scraper](https://apify.com/socialscrapers/facebook-reels-scraper) | Reels, Videos, Plays and Captions |
| [X (Twitter) Profile Scraper](https://apify.com/socialscrapers/x-profile-scraper) | Followers, Bio and Tweets |
| [X (Twitter) Tweet Scraper](https://apify.com/socialscrapers/x-tweet-scraper) | Latest Posts by Profile |
| [Threads Profile Scraper](https://apify.com/socialscrapers/threads-profile-scraper) | Followers, Bio, Links and Posts |
| [Threads Replies Scraper](https://apify.com/socialscrapers/threads-replies-scraper) | Comments, Authors, Likes and Media |
| [Threads Scraper](https://apify.com/socialscrapers/threads-scraper) | Posts, Profiles, Replies and Search |
| [Threads Search Scraper](https://apify.com/socialscrapers/threads-search-scraper) | Keywords, Hashtags, Top and Recent Posts |
| [Reddit Comments Scraper](https://apify.com/socialscrapers/reddit-comments-scraper) | Threads, Replies, Votes and Authors |
| [Reddit Scraper](https://apify.com/socialscrapers/reddit-scraper) | Posts, Comments, Subreddits, Users and Search |
| [Reddit Search Scraper](https://apify.com/socialscrapers/reddit-search-scraper) | Posts by Keyword, Subreddit and Date |
| [Reddit User Scraper](https://apify.com/socialscrapers/reddit-user-scraper) | Profiles, Karma, Posts and Comments |
| [Subreddit Scraper](https://apify.com/socialscrapers/subreddit-scraper) | Hot, New and Top Posts with Comments |
| [Quora Scraper](https://apify.com/socialscrapers/quora-scraper) | Answers, Questions, Profiles and Topic Search |
| [LinkedIn Ad Library Scraper](https://apify.com/socialscrapers/linkedin-ad-library-scraper) | Ads, Advertisers and Impressions |
| [LinkedIn Job Search Scraper](https://apify.com/socialscrapers/linkedin-job-search-scraper) | Filters, Salaries and New Jobs |
| [LinkedIn Jobs Scraper](https://apify.com/socialscrapers/linkedin-jobs-scraper) | Job Listings, Salaries and Companies |
| [Google Maps Email Extractor](https://apify.com/socialscrapers/google-maps-email-extractor) | Emails, Phones and Social Links |
| [Google Maps Scraper](https://apify.com/socialscrapers/google-maps-scraper) | Places, Phones, Websites, Ratings and Hours |
| [Google News Scraper](https://apify.com/socialscrapers/google-news-scraper) | Headlines, Articles and Search |
| [Google Ads Transparency Scraper](https://apify.com/socialscrapers/google-ads-transparency-scraper) | Ad Creatives and Advertisers |
| [Amazon Product Scraper](https://apify.com/socialscrapers/amazon-product-scraper) | Search Results, Prices, Ratings, ASINs |
| [Indeed Jobs Scraper](https://apify.com/socialscrapers/indeed-jobs-scraper) | Salaries, Full Descriptions, Company Data |
| [Contact Details Scraper](https://apify.com/socialscrapers/contact-details-scraper) | Emails, Phones and Social Links |
| [Telegram Channel Scraper](https://apify.com/socialscrapers/telegram-channel-scraper) | Posts, Views and Media |
| [Doximity Scraper](https://apify.com/socialscrapers/doximity-physician-scraper) | Physician Profiles and Doctor Directory |
| [KevinMD Scraper](https://apify.com/socialscrapers/kevinmd-articles-scraper) | Physician Articles and Author Specialties |
| [Op-Med Scraper](https://apify.com/socialscrapers/opmed-articles-scraper) | Physician Essays and Doctor Profiles |
| [Career Site Jobs Scraper](https://apify.com/socialscrapers/career-site-jobs-scraper) | Greenhouse, Lever, Ashby and Workday |
| [Google Trends Scraper](https://apify.com/socialscrapers/google-trends-scraper) | Interest Over Time, Regions and Queries |

# Actor input Schema

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

Channel URLs or @handles, one per line: <code>https://www.youtube.com/@NASA</code>, <code>@NASA</code>, or <code>/channel/UC…</code>, <code>/c/…</code> and <code>/user/…</code> URLs. A URL ending in <code>/videos</code>, <code>/shorts</code> or <code>/streams</code> reads only that tab.

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

How many videos to save from each channel's Videos tab. 0 saves none (for example to get only Shorts or only the channel details). No upper limit. Example: <code>500</code>.

## `maxShortsPerChannel` (type: `integer`):

How many Shorts to save from each channel's Shorts tab. 0 saves none. Example: <code>50</code>.

## `maxStreamsPerChannel` (type: `integer`):

How many live streams (current and past) to save from each channel's Live tab. 0 saves none. Example: <code>20</code>.

## `channelSortBy` (type: `string`):

Which of a channel's videos come first, as the sort buttons on the channel page: latest, most popular or oldest.

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

Save one channel item per channel: subscribers, total videos and views, country, join date, description, links, keywords, avatar and banner.

## `publishedAfter` (type: `string`):

Only videos published on or after this date, or within this age. Pick a date or an age, or type one: a date (<code>2026-01-31</code>, <code>31/01/2026</code>, <code>Jan 31 2026</code>; a UTC day) or an age such as <code>7 days</code>, <code>2w</code> or <code>6 months</code>. In Latest order, reading stops once the channel's videos are older.

## `publishedBefore` (type: `string`):

Only videos published on or before this date (the whole day counts), or before this age. A date (<code>2026-01-31</code>, <code>31/01/2026</code>, <code>Jan 31 2026</code>) or an age such as <code>7 days</code> or <code>1 year</code>.

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

Residential proxies give the most reliable results.

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

How many videos are read at the same time. Example: <code>20</code>.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.youtube.com/@NASA"
  ],
  "maxVideosPerChannel": 5,
  "maxShortsPerChannel": 0,
  "maxStreamsPerChannel": 0,
  "channelSortBy": "newest",
  "includeChannelInfo": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "maxConcurrency": 20
}
```

# 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 = {
    "startUrls": [
        "https://www.youtube.com/@NASA"
    ],
    "maxVideosPerChannel": 5
};

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

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

```

## MCP server setup

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