# YouTube Video Stats Scraper — Views, Likes, Duration by URL (`nick.cheng/youtube-video-stats`) Actor

Get YouTube video stats and metadata by URL or video ID — view count, likes, duration, publish date, title, description, category, keywords, channel and caption languages. Bulk video lookup, no API key, no login, no quota. Filter by views or duration. Charged only for videos actually returned.

- **URL**: https://apify.com/nick.cheng/youtube-video-stats.md
- **Developed by:** [Nicholas Cheng](https://apify.com/nick.cheng) (community)
- **Categories:** Videos, AI, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $15.00 / 1,000 video scrapeds

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?

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

## YouTube Video Stats Scraper

**Give it YouTube links or video IDs, get one row of real numbers per video.** View count, duration, publish date, likes, title, full description, category, keywords, channel, and which caption languages exist. No API key, no OAuth, no login, no quota to apply for. Accepts watch links, Shorts links, `youtu.be` links, embed links, or bare 11-character IDs.

**You are charged only for videos that actually came back.** A private, deleted, or region-blocked video produces an explanatory row and costs nothing.

| | |
|---|---|
| **Input** | Video URLs or IDs — any format YouTube itself accepts |
| **Output** | One row per video, numbers as numbers |
| **Price** | **$0.015 per video — the same on every Apify plan** |
| **API key** | Not needed. This does not use the YouTube Data API, so it does not consume your quota |
| **Channels** | **Not fetched.** This Actor is the videos-only mode of the [YouTube Video & Channel Scraper](https://apify.com/nick.cheng/youtube-video-channel-scraper); use that one to list a channel's recent videos |

***

### What you get

```json
{
  "itemType": "video",
  "videoId": "aircAruvnKk",
  "url": "https://www.youtube.com/watch?v=aircAruvnKk",
  "title": "But what is a neural network? | Deep learning chapter 1",
  "description": "Full text of the video description, not truncated.",
  "durationSeconds": 1120,
  "viewCount": 23951183,
  "likesLabel": "like this video along with 512,000 other people",
  "publishedAt": "2017-10-05T00:00:00-07:00",
  "channelId": "UCYO_jab_esuFRV4b17AJtAw",
  "channelName": "3Blue1Brown",
  "channelUrl": "https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw",
  "channelSubscribersLabel": "7.4M subscribers",
  "keywords": ["neural networks", "deep learning", "machine learning"],
  "category": "Education",
  "isLive": false,
  "thumbnail": "https://i.ytimg.com/vi/aircAruvnKk/maxresdefault.jpg",
  "availableCaptions": [
    { "language": "en", "name": "English", "isAutoGenerated": false }
  ]
}
```

`viewCount` and `durationSeconds` are real numbers, not display strings — you can sort and filter on
them without parsing `"1.2M"` first. `likesLabel` is a string on purpose: YouTube no longer exposes
an exact like count to logged-out clients, and inventing a number from a rounded label would be
making data up.

`availableCaptions` lists which caption tracks exist and in which languages. It does **not** include
the caption text — see below.

***

### Input

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://youtu.be/dQw4w9WgXcQ",
    "https://www.youtube.com/shorts/…",
    "jNQXAC9IVRw"
  ],
  "minViews": 10000
}
```

| Option | Default | Notes |
|---|---|---|
| `videoUrls` | — | Watch, Shorts, `youtu.be`, embed links, or bare IDs. De-duplicated |
| `minViews` | `0` | Drop videos below this view count |
| `minDurationSeconds` / `maxDurationSeconds` | `0` | Keep only videos in a length range — e.g. `maxDurationSeconds: 60` for Shorts |
| `publishedAfter` | — | ISO date; older videos are dropped |
| `titleContains` | — | Keep only titles containing any of these phrases (case-insensitive) |
| `maxItems` | `0` | Hard cap on rows for the run |

**Videos that fail a filter are not delivered and not charged.** They are counted under
`filteredOut` in the run summary.

***

### Pricing

**$0.015 per video, on every Apify plan** — Free, Bronze, Silver, Gold, Platinum, Diamond. Check
the Pricing tab: all six columns are identical. The price a listing advertises in its title is not
always the price a free-plan run pays; here it is.

#### What you are not charged for

| | What happens here |
|---|---|
| **Unavailable videos** | Private, deleted, region-blocked, or mistyped IDs produce one row marked `chargedForThis: false`. Nothing is billed. |
| **Filtered-out videos** | A video that fails `minViews` or any other filter is not written and not billed. |
| **Empty or placeholder rows** | If the video data did not come back, no row is written. |
| **The free plan** | Same code path, same fields, same limits. No demo mode, no row cap, no nulls in place of data. |

***

### What this Actor cannot do

- **No transcripts or subtitles.** YouTube serves caption text only to clients that pass a proof-of-origin check; this Actor does not attempt to defeat it. You get the list of caption languages, not the text.
- **No channel listings.** For "the latest videos from these channels", use the [YouTube Video & Channel Scraper](https://apify.com/nick.cheng/youtube-video-channel-scraper) — same code, same prices, plus a $0.005 channel event.
- **No exact like count.** YouTube stopped exposing it to logged-out clients; you get YouTube's own rounded label.
- **No comments, no search.**

***

### How it stays working

Video pages are loaded through a rotating residential connection — an ordinary browser-like request from an ordinary address, not a bypass of anything. YouTube's page structure is read at runtime; if a video's data does not come back, the row is marked unavailable rather than filled with nulls.

***

### Integrating

```bash
curl -X POST "https://api.apify.com/v2/acts/nick.cheng~youtube-video-stats/run-sync-get-dataset-items?token=<TOKEN>" \
  -H 'Content-Type: application/json' \
  -d '{"videoUrls":["aircAruvnKk","dQw4w9WgXcQ"]}'
```

Official clients exist for JavaScript and Python, and results export as JSON, CSV, or Excel.

# Actor input Schema

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

YouTube videos to scrape. Accepts watch links, Shorts links, youtu.be links, embed links, or bare 11-character video IDs.

## `maxItems` (type: `integer`):

Hard ceiling on rows for the whole run, across every video and channel. Leave at 0 for no limit.

## `minViews` (type: `integer`):

Skip videos with fewer views than this. Videos from channel listings are screened before their page is fetched, so filtered-out videos cost nothing. 0 means no minimum.

## `minDurationSeconds` (type: `integer`):

Skip videos shorter than this many seconds. Useful for dropping Shorts. 0 means no minimum.

## `maxDurationSeconds` (type: `integer`):

Skip videos longer than this many seconds. Useful for keeping only Shorts or clips. 0 means no maximum.

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

ISO date or datetime, e.g. 2026-01-01. Videos published before it are skipped. Channel listings only show relative dates ("3 weeks ago"), so the pre-fetch screen is conservative and the exact date is checked once the page is loaded.

## `titleContains` (type: `array`):

Keep only videos whose title contains at least one of these words or phrases, case-insensitive. Leave empty to keep all titles.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "dQw4w9WgXcQ"
  ],
  "maxItems": 0,
  "minViews": 0,
  "minDurationSeconds": 0,
  "maxDurationSeconds": 0
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=aircAruvnKk",
        "dQw4w9WgXcQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nick.cheng/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=aircAruvnKk",
        "dQw4w9WgXcQ",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("nick.cheng/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=aircAruvnKk",
    "dQw4w9WgXcQ"
  ]
}' |
apify call nick.cheng/youtube-video-stats --silent --output-dataset

```

## MCP server setup

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