# YouTube Scraper — Video Metadata, Channel Stats & Search (`muhammadafzal/youtube-video-channel-scraper`) Actor

Scrape YouTube video metadata, channel stats and search results: views, likes, comments, tags, upload dates, subscribers and latest uploads from links, @handles or keywords. No transcripts. USD 2 per 1,000 records.

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

## Pricing

from $2.40 / 1,000 video or channel records

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 Scraper — Video Metadata, Channel Stats & Search

YouTube Scraper returns YouTube video metadata (views, likes, comments, duration, upload date, tags, category, channel), channel stats (subscribers, total videos, total views, join date, country, latest uploads) and YouTube search results, from video links, channel @handles or search words. It costs USD 3.00 per 1,000 video or channel records plus a USD 0.005 start fee, and videos that are unavailable, channels that do not exist and searches without results are not charged.

It is built for marketers, researchers, data teams and AI agents who need YouTube video and channel data as clean JSON, CSV or Excel without a YouTube Data API key or quota.

### What data does this YouTube scraper return?

Every record is one YouTube video (`recordType: "video"`) or one channel (`recordType: "channel"`). Fields that a source does not provide are `null`, never guessed.

| Field | What it is | Video links | Search results | Channel @handles |
|---|---|---|---|---|
| `videoId`, `videoUrl`, `title` | Video ID, watch link and title | yes | yes | – |
| `description` | Full description (search: the snippet YouTube shows) | full | snippet | – |
| `viewCount` | Exact view count | yes | yes | – |
| `likeCount`, `commentCount` | Likes and comments | yes | – | – |
| `durationSeconds`, `durationText` | Video length | yes | yes | – |
| `uploadDate` | Upload date (YYYY-MM-DD) | yes | – | – |
| `publishedTimeText` | Age as YouTube shows it ("4mo ago") | – | yes | – |
| `tags`, `categories` | Uploader tags and YouTube category | yes | – | – |
| `hasCaptions`, `captionLanguages`, `autoCaptionLanguages` | Which caption languages exist (not the captions) | yes | – | – |
| `musicTracks` | Songs listed in the video's music section | yes | – | – |
| `isLive`, `isShort`, `badges`, `ageLimit` | Live stream, Short, labels such as 4K or CC, age limit | partly | yes | – |
| `thumbnailUrl` | Largest thumbnail | yes | yes | – |
| `trainingPermission` | AI-training permission (optional, see below) | yes | yes | – |
| `channelId`, `channelHandle`, `channelName`, `channelUrl` | The channel, or the video's channel | yes | yes | yes |
| `subscriberCount`, `subscriberCountText` | Subscribers (4.56M becomes 4560000) | – | channel search | yes |
| `channelVideoCount`, `channelViewCount` | Total videos and total views | – | – | yes |
| `joinedDate`, `country`, `channelDescription`, `avatarUrl`, `links` | Channel profile | – | partly | yes |
| `latestVideos` | Newest uploads: title, link, views, age | – | – | yes |
| `searchQuery`, `searchRank` | The query and the result's position | – | yes | – |

The dataset has two views in Apify Console: **Videos** and **Channels**.

### How do I scrape YouTube video metadata, channel stats or search results?

Fill in at least one of the three lists; you can mix them in one run. A run with none of them stops before any work.

1. **Video links** (`videoUrls`): watch, youtu.be, Shorts, embed or live links, or bare 11-character IDs. Each link returns the full video metadata. Up to 500 per run.
2. **Channel @handles** (`channelHandles`): `@MrBeast` or `https://www.youtube.com/@MrBeast`. Each handle returns one channel record with stats and up to 100 latest uploads (`latestVideos`, default 10). Up to 100 per run.
3. **Search words** (`searchQueries`): each query returns up to 20 results, filtered like YouTube's own menu: `sortBy` (relevance, upload date, view count, rating), `uploadDate` (last hour to this year), `duration` (under 4, 4–20, over 20 minutes), `searchType` (videos, channels, movies and shows) and `searchCountry` (US, GB, DE, IN…). Turn on `deepSearch` and raise `maxResultsPerQuery` to get up to about 700 results per query. Up to 20 queries per run.

Example input:

```json
{
    "videoUrls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
    "channelHandles": ["@RickAstleyYT"],
    "latestVideos": 5,
    "searchQueries": ["espresso machine review"],
    "maxResultsPerQuery": 20,
    "sortBy": "view_count",
    "uploadDate": "this_year"
}
```

Records are written in input order: video links first, then channels, then searches. A video or channel that appears more than once (in two queries, or as a link and a search result) is delivered and charged once.

### What does the output look like?

```json
[
    {
        "recordType": "video",
        "source": "videoUrl",
        "input": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
        "videoId": "jNQXAC9IVRw",
        "videoUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
        "title": "Me at the zoo",
        "durationSeconds": 19,
        "viewCount": 448008364,
        "likeCount": 20131150,
        "commentCount": 10000000,
        "uploadDate": "2005-04-24",
        "tags": ["me at the zoo", "jawed karim", "first youtube video"],
        "categories": ["Film & Animation"],
        "hasCaptions": true,
        "captionLanguages": ["en", "de"],
        "channelId": "UC4QobU6STFB0P71PMvOGN5A",
        "channelHandle": "@jawed",
        "channelName": "jawed",
        "trainingPermission": null
    },
    {
        "recordType": "channel",
        "source": "channelHandle",
        "input": "@RickAstleyYT",
        "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
        "channelHandle": "@RickAstleyYT",
        "channelName": "Rick Astley",
        "subscriberCount": 4560000,
        "subscriberCountText": "4.56M",
        "channelVideoCount": 441,
        "channelViewCount": 2597818401,
        "joinedDate": "2015-02-01",
        "country": "United Kingdom",
        "latestVideos": [
            { "position": 1, "videoId": "PXC_PYeB6F8", "title": "Rick Astley - Angels On My Side (Live at The O2, London, April 2026)", "viewCount": 118000, "publishedTimeText": "4mo ago" }
        ]
    }
]
```

The run summary (`OUTPUT` in the key-value store) lists every input with its outcome — delivered, unavailable, not-found, empty, invalid-input, duplicate, failed or skipped — and the reason.

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

You pay per record delivered, plus a small start fee. Platform usage is included in the price.

| Event | FREE | BRONZE | SILVER | GOLD |
|---|---|---|---|---|
| Video or channel record | USD 0.003 | USD 0.002925 | USD 0.00285 | USD 0.0024 |
| AI-training permission check (only with `includeTrainingPermission`) | USD 0.0025 | USD 0.002438 | USD 0.002375 | USD 0.002 |
| Actor start (per started GB of memory; one at the default 256 MB) | USD 0.005 | USD 0.005 | USD 0.005 | USD 0.005 |

Discounts are 0%, 2.5%, 5% and 20% by Apify plan tier. Worked totals on the FREE tier:

- One video link: USD 0.005 + USD 0.003 = **USD 0.008**.
- 10 searches × 20 results = 200 records: USD 0.005 + 200 × USD 0.003 = **USD 0.605**.
- 100 video links with training permission: USD 0.005 + 100 × (USD 0.003 + USD 0.0025) = **USD 0.555**.

Not charged: unavailable, private, age-restricted or members-only videos, unknown @handles, searches with no results, duplicates and invalid entries. Set a maximum charge on the run and the Actor stops cleanly when it is reached.

### What is the AI-training permission field?

Turn on `includeTrainingPermission` to add, for every video record, whether the rights holder allows third parties to train AI models on the video and which parties they named (`trainingPermission.allowed`, `trainingPermission.permittedParties`). It is the rights holder's own declaration on YouTube, not legal clearance or a license, so check the rights yourself before using any video for training. Each check is one extra lookup, charged as its own event, at most 500 per run.

### When should I use this YouTube scraper, and when not?

Use it when you need:

- view, like and comment counts, upload dates and tags for a list of videos;
- subscriber counts, total views, join dates and recent uploads for a list of channels;
- the videos or channels YouTube shows for keywords, sorted and filtered like YouTube's search menu, as seen from one country.

Do not use it for:

- **Transcripts, captions or subtitles**: use [YouTube Transcript Extractor](https://apify.com/muhammadafzal/youtube-transcript-extractor). This Actor only reports which caption languages a video has.
- **Downloading video or audio files**: not supported.
- **Comments text, playlists, or full channel archives** beyond the 100 latest uploads: not supported.
- **Private, members-only or age-restricted videos**: YouTube does not show them publicly; they are reported as unavailable and not charged.

### Use it from an AI assistant

This Actor works from Claude, ChatGPT, Cursor or any MCP client through Apify's MCP server. Add it as a single tool with `https://mcp.apify.com/?tools=muhammadafzal/youtube-video-channel-scraper` and ask, for example: "Get the subscriber count, total views and five latest uploads of @MrBeast and @veritasium, and the 20 most viewed espresso machine reviews from this year."

You can also call it from code with the Apify API or client:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("muhammadafzal/youtube-video-channel-scraper").call(
    run_input={"channelHandles": ["@veritasium"], "latestVideos": 5}
)
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item["channelName"], item["subscriberCount"])
```

### Limits and reliability

- Up to 500 video links, 100 channels and 20 searches per run.
- A regular search returns at most 20 results. Deep search returns a few hundred to about 700 per query (447 to 576 unique videos for "coffee" in our tests) and takes about 30 to 60 seconds per query; deep searches run one at a time.
- Likes, comments, exact upload dates and tags come only from video links. Search results carry views, length and the relative age YouTube shows.
- Subscriber counts are rounded the way YouTube shows them (4.56M).
- Channels are read by @handle. Channel IDs (UC…) and old /c/ or /user/ links are refused before any work; open the channel page and copy its @handle.
- Lists of video links above 30 are collected in batches, so large runs stay fast and cheap.
- A search that comes back empty is checked once more before it is reported as having no results.

### FAQ

**Do I need a YouTube Data API key or quota?**
No. You only need an Apify account; there is no YouTube API key, quota or OAuth setup.

**How much does it cost to get data for 1,000 YouTube videos?**
USD 3.00 for 1,000 video records on the FREE tier, plus the USD 0.005 start fee, and less on higher Apify plans (down to USD 2.40 on GOLD). Videos that return no data are not charged.

**Why do search results have no likes or upload date?**
YouTube's search page shows views, length and a relative age ("4mo ago") but not likes, comments or the exact date. Put the video links in `videoUrls` to get the full metadata.

**Can it scrape YouTube transcripts or captions?**
No. It lists which caption languages a video has. For the transcript text, use YouTube Transcript Extractor.

**What happens with deleted, private or age-restricted videos?**
They are listed in the run summary with the reason (for example "age-restricted video") and are not charged.

**Can I get all videos of a channel?**
Each channel record lists up to the 100 latest uploads. To get full metadata for those videos, run their links through `videoUrls`.

**How many results can I get per YouTube search?**
Up to 20 per query by default; with `deepSearch` on, up to about 700 per query, and up to 20 queries per run.

**Is scraping YouTube legal?**
This Actor reads only public pages that anyone can open without signing in. You are responsible for how you use the data, including privacy law, YouTube's terms and the rights holders' AI-training choices.

### Related Actors

- [YouTube Transcript Extractor](https://apify.com/muhammadafzal/youtube-transcript-extractor): timed transcripts and full caption text for YouTube videos.

Last verified: 2026-11-09

# Actor input Schema

## `videoUrls` (type: `array`):

Use this when you know the videos and want their full metadata: title, description, views, likes, comments, duration, upload date, tags, category and channel. Accepts watch links (https://www.youtube.com/watch?v=jNQXAC9IVRw), youtu.be, Shorts, embed and live links, or the bare 11-character ID. Playlist and channel links are not expanded. Duplicates are removed before any work. Up to 500.

## `channelHandles` (type: `array`):

Use this for channel stats: name, channel ID, subscribers, total videos, total views, join date, country, description, links and the latest uploads. Enter the @handle shown on the channel page (@MrBeast) or a link such as https://www.youtube.com/@MrBeast. Channel IDs (UC…) and old /c/ or /user/ links are not supported. Up to 100.

## `latestVideos` (type: `integer`):

Use this to choose how many of each channel's newest uploads are listed inside its record (title, link, views, age). 0 returns the channel details only. Included in the channel record's price. Default 10, at most 100.

## `searchQueries` (type: `array`):

Use this to find videos (or channels) the way the YouTube search box does, for example "espresso machine review". Each query returns up to 20 results, or up to about 700 with deep search. A video found by several queries is delivered once. Up to 20 queries.

## `maxResultsPerQuery` (type: `integer`):

Use this to cap the results kept per search query. One search page returns at most 20; values above 20 need deep search turned on. Default 20, at most 700.

## `deepSearch` (type: `boolean`):

Use this when you need more than 20 results per query. A deep search takes about 30 to 60 seconds per query and returns up to about 700 results (447 to 576 unique videos measured for "coffee"). Queries then run one at a time. Default: off.

## `searchType` (type: `string`):

Use this to choose what a search returns: videos (default), channels (name, @handle, subscribers, description), or movies and shows. Playlist search is not supported.

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

Use this to order search results like YouTube's filter menu: relevance (default), upload date, view count or rating.

## `uploadDate` (type: `string`):

Use this to keep only search results uploaded within a period: last hour, today, this week, this month or this year. Default: any time.

## `duration` (type: `string`):

Use this to keep only search results of a length: under 4 minutes, 4 to 20 minutes, or over 20 minutes. Default: any length.

## `searchCountry` (type: `string`):

Use this to search YouTube as seen from one country, as a two-letter code: US, GB, DE, IN, BR. Applies to search only. Default: US.

## `includeTrainingPermission` (type: `boolean`):

Use this to add each video's AI-training permission: whether the rights holder allows third parties to train AI models on it, and which ones. This is the rights holder's own declaration on YouTube, not legal clearance. Optional: each successful check is charged as a separate event (see Pricing), at most 500 per run. Default: off.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "latestVideos": 10,
  "maxResultsPerQuery": 20,
  "deepSearch": false,
  "searchType": "video",
  "sortBy": "relevance",
  "uploadDate": "any",
  "duration": "any",
  "searchCountry": "US",
  "includeTrainingPermission": false
}
```

# Actor output Schema

## `records` (type: `string`):

Dataset of video records (views, likes, comments, duration, upload date, tags, channel) and channel records (subscribers, videos, views, join date, latest uploads).

## `summary` (type: `string`):

OUTPUT record: status, counts, and the outcome of every video link, @handle and search query, with the reason when no data was delivered.

# 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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/youtube-video-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 = { "videoUrls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"] }

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/youtube-video-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 '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ]
}' |
apify call muhammadafzal/youtube-video-channel-scraper --silent --output-dataset

```

## MCP server setup

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