# YouTube Video/Shorts Stats Scraper (`cyrolix/youtube-shorts-video-stats-scraper`) Actor

Scrapes YouTube videos and Shorts for views, likes, comments and metadata using yt-dlp

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

## Pricing

from $2.00 / 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

## YouTube Video & Shorts Scraper

Scrape YouTube videos and Shorts for views, likes, comments, channel info, and direct video URLs. **No API key or login required.**

Handles regular videos, YouTube Shorts, and playlist URLs (auto-extracts the first entry).

***

### Features

| Feature | Details |
|---------|---------|
| Likes | ✅ |
| Views | ✅ |
| Comment Count | ✅ |
| Video Title | ✅ |
| Video Description | ✅ |
| Upload Date | ✅ |
| Duration (seconds) | ✅ |
| Thumbnail URL | ✅ |
| Direct Video URL | ✅ (CDN link, time-limited) |
| Channel Name | ✅ |
| Channel Handle | ✅ (without @ prefix) |
| Channel URL | ✅ |
| Channel ID | ✅ |
| Subscriber Count | ✅ (human-readable, e.g. "65.3K subscribers") |
| Live Stream Detection | ✅ |
| YouTube Shorts Support | ✅ |
| No Login / API Key Required | ✅ |
| Batch URLs | ✅ |

***

### Supported URL Formats

| Type | Example |
|------|---------|
| Standard video | `https://www.youtube.com/watch?v=XXXXXXXXXXX` |
| Short URL | `https://youtu.be/XXXXXXXXXXX` |
| YouTube Shorts | `https://www.youtube.com/shorts/XXXXXXXXXXX` |
| Playlist (first video) | `https://www.youtube.com/playlist?list=XXXXXXXXX` |

***

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | String | No\* | Single YouTube video or Shorts URL |
| `urls` | Array of Strings | No\* | Multiple YouTube URLs to scrape |

\*At least one of `url` or `urls` must be provided.

#### Example Input

```json
{
  "url": "https://www.youtube.com/watch?v=XXXXXXXXXXX"
}
```

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=XXXXXXXXXXX",
    "https://youtu.be/YYYYYYYYYYY",
    "https://www.youtube.com/shorts/ZZZZZZZZZZZ"
  ]
}
```

***

### Output

Each scraped URL produces one result object pushed to the dataset.

#### Full Output Schema

```json
{
  "url": "https://www.youtube.com/watch?v=XXXXXXXXXXX",
  "videoId": "XXXXXXXXXXX",
  "status": "available",

  "views": 1420000,
  "likes": 48200,
  "comments": 3100,

  "title": "Video Title Here",
  "description": "Full video description text...",
  "durationSeconds": 312,
  "datePosted": "2026-08-10T00:00:00.000Z",
  "isLive": false,

  "channelName": "Channel Display Name",
  "channelId": "UCxxxxxxxxxxxxxxxxxxxxxxxxx",
  "channelUrl": "https://www.youtube.com/@channelhandle",
  "username": "channelhandle",
  "subscriberCount": "65.3K subscribers",

  "thumbnailUrl": "https://i.ytimg.com/vi/XXXXXXXXXXX/maxresdefault.jpg",
  "videoUrl": "https://rr1---sn-xxx.googlevideo.com/...",

  "scrapedAt": "2026-08-22T12:00:00.000Z",
  "error": null
}
```

#### Output Fields Reference

| Field | Type | Description |
|-------|------|-------------|
| `url` | String | Canonical YouTube video URL |
| `videoId` | String | YouTube video ID (11-character string) |
| `status` | String | `"available"` on success, `"error"` on failure |
| `views` | Number / null | Total view count |
| `likes` | Number / null | Total like count |
| `comments` | Number / null | Total comment count (may be null if disabled) |
| `title` | String | Video title |
| `description` | String / null | Full video description |
| `durationSeconds` | Number / null | Video length in seconds |
| `datePosted` | ISO 8601 / null | Upload date |
| `isLive` | Boolean | Whether the video is a live stream |
| `channelName` | String / null | Channel display name |
| `channelId` | String / null | YouTube channel ID (`UC...`) |
| `channelUrl` | String / null | Link to the channel page |
| `username` | String / null | Channel handle without the `@` prefix |
| `subscriberCount` | String / null | Human-readable subscriber count (e.g. `"65.3K subscribers"`) |
| `thumbnailUrl` | String / null | Video thumbnail image URL |
| `videoUrl` | String / null | Direct CDN video URL (googlevideo.com, time-limited) |
| `scrapedAt` | ISO 8601 | Timestamp of when the scrape ran (UTC) |
| `error` | String / null | Error message if `status` is `"error"` |

#### Error Response

```json
{
  "url": "https://www.youtube.com/watch?v=XXXXXXXXXXX",
  "videoId": "XXXXXXXXXXX",
  "status": "error",
  "error": "Video unavailable or removed",
  "scrapedAt": "2026-08-22T12:00:00.000Z"
}
```

***

### Limitations

- Only works on **public** YouTube videos — private, unlisted, and age-restricted videos may not be accessible
- Direct video CDN URLs (`videoUrl`) are **time-limited** (typically a few hours) — download promptly if needed
- Comment counts may be `null` if comments are disabled on the video
- Like counts may be hidden if the channel has disabled like visibility
- YouTube Shorts and videos with DRM protection may not return a usable `videoUrl`
- For very large batches, yt-dlp may be rate-limited — space out runs if needed

# Actor input Schema

## `url` (type: `string`):

Single YouTube video or Shorts URL

## `urls` (type: `array`):

List of YouTube video/Shorts URLs to scrape

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

Select proxies. Residential proxies are strongly recommended — YouTube blocks datacenter IPs with 'Sign in to confirm you're not a bot'.

## Actor input object example

```json
{
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All scraped YouTube video/Shorts metadata and engagement metrics

## `datasetItemsCsv` (type: `string`):

Download all scraped items as CSV

# 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 = {
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("cyrolix/youtube-shorts-video-stats-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 = { "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    } }

# Run the Actor and wait for it to finish
run = client.actor("cyrolix/youtube-shorts-video-stats-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 '{
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call cyrolix/youtube-shorts-video-stats-scraper --silent --output-dataset

```

## MCP server setup

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