# YouTube Video Stats & Campaign Report (`getdataforu/youtube-video-stats`) Actor

Exact views and likes, title, channel, length, publish date and tags for any list of YouTube videos and Shorts, plus a campaign report with CPM. No API key needed.

- **URL**: https://apify.com/getdataforu/youtube-video-stats.md
- **Developed by:** [EMT Crawler](https://apify.com/getdataforu) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 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.
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 Video Stats & Campaign Report

Paste a list of YouTube video or Shorts links. Get back **exact views and likes**, title, channel, length, publish date, category and tags for every one — plus a campaign report with CPM you can send straight to a client.

No YouTube API key, no Google account, no quota limits.

### What it's for

- **Influencer campaign reporting** — paste the links of every sponsored video and get total views, likes and cost per 1,000 views in one run.
- **Sponsorship pricing** — check what a creator's recent videos really do before you agree a fee.
- **Competitor tracking** — re-run on a rival channel's videos every week and watch which ones keep growing.
- **Content research** — compare performance across topics, lengths and formats.

### What you get for each video

| | |
|---|---|
| **Performance** | Exact views, exact likes, like rate (likes ÷ views) |
| **Video** | Title, description, length, category, tags, thumbnail |
| **Channel** | Channel name, channel ID, channel link |
| **Timing** | Publish date and upload date |
| **Flags** | Live stream, family-safe, unlisted, Shorts-eligible, likes hidden |

Real rows from a test run:

| Channel | Title | Views | Likes |
|---|---|---|---|
| MrBeast | Eat Everything In A Grocery Store, Win $… | 245,396,414 | 3,868,595 |
| MrBeast | Last To Leave Mansion, Keeps It | 126,790,457 | 2,408,606 |
| NASA | NASA Moon Base: The First Six Months | 520,418 | 9,000 |

### The campaign report

Every run writes a **`CAMPAIGN_REPORT`** to the key-value store: total views and likes, like rate, median views, the top videos by views and by like rate, a per-channel breakdown, and — when you give a budget — **cost per 1,000 views (CPM)**, cost per view and cost per like. Links that failed are listed with the reason.

### Input

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=IwZVXmQdX1E",
    "https://youtu.be/ErAqN6gXqZQ",
    "https://www.youtube.com/shorts/IwZVXmQdX1E"
  ],
  "campaignBudget": 10000,
  "currency": "USD"
}
```

| Field | Default | Notes |
|---|---|---|
| `videoUrls` | — | **Required.** Watch pages, youtu.be links, Shorts, live streams, embeds, mobile links or bare video IDs. Duplicates are removed. |
| `campaignBudget` | — | Optional total spend. Adds CPM, cost per view and cost per like. |
| `currency` | `USD` | Label for the budget. |
| `maxConcurrency` | `10` | Videos fetched in parallel. |

### Speed

Measured: **40 videos from 6 channels in one run, every one returned.** The actor reads YouTube's compact video metadata (about 10 KB per video) rather than loading the whole watch page (about 1.3 MB), which is why large runs stay fast.

### You only pay for videos that load

Deleted, private and mistyped links are never written to the dataset, so they are never charged. They are listed with the reason in `CAMPAIGN_REPORT.failed`.

### Limitations

- **Comment counts and dislikes are not included.** YouTube does not publish dislikes; comments are available in the companion **YouTube Comments Scraper**.
- Age-restricted and members-only videos need a login and are reported as failed.
- Channel subscriber counts are not included — YouTube only publishes them rounded.

### Legal

Reads only what YouTube shows any visitor without logging in. You are responsible for how you use the data.

# Actor input Schema

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

YouTube links of any kind - watch pages, youtu.be short links, Shorts, live streams, embeds - or bare 11-character video IDs, one per line. Duplicates are removed automatically.

## `campaignBudget` (type: `integer`):

What you paid for these videos in total. When set, the report adds cost per 1,000 views (CPM), cost per view and cost per like.

## `currency` (type: `string`):

Currency of the budget. Only used as a label.

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

Each video is fetched through its own proxy IP.

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

Residential proxies are required: YouTube shows server IPs a bot check instead of data.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=IwZVXmQdX1E",
    "https://youtu.be/ErAqN6gXqZQ",
    "https://www.youtube.com/shorts/IwZVXmQdX1E"
  ],
  "currency": "USD",
  "maxConcurrency": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `videos` (type: `string`):

Every video that loaded: exact views and likes, like rate, title, description, channel, duration, publish and upload dates, category, tags and thumbnail.

## `campaignReport` (type: `string`):

Totals, like rate, top videos, a per-channel breakdown, CPM and cost per view when a budget is given, and links that failed.

# 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=IwZVXmQdX1E",
        "https://youtu.be/ErAqN6gXqZQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("getdataforu/youtube-video-stats").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=IwZVXmQdX1E",
        "https://youtu.be/ErAqN6gXqZQ",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("getdataforu/youtube-video-stats").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=IwZVXmQdX1E",
    "https://youtu.be/ErAqN6gXqZQ"
  ]
}' |
apify call getdataforu/youtube-video-stats --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,getdataforu/youtube-video-stats"
        }
    }
}
```

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/gVdAiYR5CUQFfnDzM/builds/lKqFRHfDxrTn8ShwD/openapi.json
