# YouTube Scraper (Free, No API Key) (`transparent_locket/youtube-channel-video-scraper`) Actor

Free YouTube scraper. Two modes: 'channel' lists every video on a channel handle/URL. 'video' fetches full metadata (views, likes, tags, thumbnails) for specific videos + optional comments. No API key. No quotas. No login.

- **URL**: https://apify.com/transparent_locket/youtube-channel-video-scraper.md
- **Developed by:** [casper smartwater](https://apify.com/transparent_locket) (community)
- **Categories:** Social media, Videos, AI
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 + Video Scraper — Free, No API Key

**Turn any YouTube channel or video URL into clean structured data.** Channel video lists, full video metadata (views, likes, tags, duration, thumbnails), and optional comments — all free, no Google API key, no quotas, no login.

Powered by [`yt-dlp`](https://github.com/yt-dlp/yt-dlp), the gold-standard YouTube extraction library used by millions. This Actor wraps it in a tidy input/output interface and runs it on Apify's infrastructure.

### ✨ Why this Actor

- **Free** — most YouTube scrapers on the Apify Store charge $20-50/mo. This one is $0.
- **No Google API key** — the official YouTube Data API has a 10,000-unit/day quota and requires OAuth. This Actor bypasses both.
- **No login** — works on public videos and channels.
- **Battle-tested** — yt-dlp handles every YouTube edge case (signature decryption, age gates, region restrictions, livestreams, shorts).

### 🚀 Quick start

**Get every video on MKBHD's channel:**

```json
{
  "source": "channel",
  "channel": "@mkbhd",
  "maxVideos": 100
}
```

**Get full metadata + comments for a specific video:**

```json
{
  "source": "video",
  "videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
  "maxComments": 200
}
```

**Get videos from a channel ID:**

```json
{
  "source": "channel",
  "channel": "UCsXVk37bltHxD1rDPwtNM8Q",
  "maxVideos": 50,
  "enrichDetails": true
}
```

### 📦 Output schema

#### Channel mode (lightweight)

| Field | Type | Notes |
|---|---|---|
| `id` | str | 11-char video ID |
| `title` | str | Video title |
| `url` | str | Full `youtube.com/watch?v=…` URL |
| `duration` | int | Seconds |
| `view_count` | int | Lifetime views (when available) |
| `channel_id` | str | UC… ID |
| `channel` | str | Channel display name |

#### Video mode (full metadata)

Everything above plus:

| Field | Type | Notes |
|---|---|---|
| `description` | str | Full video description |
| `like_count`, `comment_count` | int | Engagement counts |
| `upload_date` | str | YYYY-MM-DD |
| `categories`, `tags` | array<str> | YouTube category + tags |
| `thumbnail` | str | Highest-res thumbnail URL |
| `language` | str | Auto-detected language code |
| `live_status` | str | `not_live` / `was_live` / `is_live` / `is_upcoming` |
| `channel_follower_count` | int | Subscriber count at scrape time |
| `comments` | array<obj> | When `maxComments > 0`. Each: `id`, `text`, `author`, `like_count`, `timestamp`, `parent` |

### 🎯 Use cases

- **Channel auditing** — pull every video from a competitor, sort by views, see what works
- **Content trend tracking** — sweep N channels daily, find rising topics
- **Comment sentiment analysis** — feed comments into an LLM, score sentiment, detect themes
- **Build a video search engine** — index titles + descriptions across niche channels
- **Auto-tweet new uploads** — schedule daily, post the latest video
- **YouTube SEO research** — see which tags + categories successful videos use
- **Sponsorship outreach** — find channels in a niche, get subscriber counts + recent engagement

### ⚙️ Input parameters

| Parameter | Type | Default | Notes |
|---|---|---|---|
| `source` | str | `channel` | `channel` or `video` |
| `channel` | str | — | Required for `source=channel`. `@handle`, full URL, or channel ID |
| `videos` | array<str> | `[]` | Required for `source=video`. URLs or 11-char IDs |
| `maxVideos` | int | 50 | Channel mode cap |
| `enrichDetails` | bool | false | Channel mode: fetch full per-video metadata (slower but richer) |
| `maxComments` | int | 0 | Video mode: comments per video (0 = none) |

### 🛠️ How it works

This Actor wraps [yt-dlp](https://github.com/yt-dlp/yt-dlp), the most actively maintained YouTube extraction library. It hits YouTube's public web endpoints (the same ones the website uses), parses the JSON player config, and returns structured data.

No API key required because yt-dlp uses unauthenticated public endpoints. No login required because all returned data is from public videos.

### ⚠️ Tips & caveats

- **Channel mode is fast (~1 sec per 50 videos)** because it uses YouTube's flat playlist endpoint. Set `enrichDetails: true` only when you need per-video stats — it adds ~1 sec per video.
- **Comments scraping is slow** (~5-10 sec per 100 comments) and YouTube paginates aggressively. Stick to `maxComments: 100-500` per video for reasonable runtimes.
- **Some channels block extraction** — if you see `Video unavailable`, the channel owner has restricted scraping. Rare but happens.
- **Live streams** return partial data while live; full metadata becomes available after the stream ends.

### 🔗 Related Actors

Building a media intelligence stack? Combine with:

- **[Reddit Subreddit + Search Scraper](https://apify.com/transparent_locket/reddit-subreddit-search-scraper)** — find what's being discussed on r/videos, r/youtubehelp
- **[Product Hunt Daily Launches](https://apify.com/transparent_locket/product-hunt-daily-launches)** — catch trending tools that go viral on YouTube
- **[GitHub Trending Repositories](https://apify.com/transparent_locket/github-trending-repositories)** — for dev-YouTube — see what code is exploding

### 💬 Support & feedback

Issues, feature requests, or want a custom YouTube-related scraper? Email **caspersmartwater@gmail.com**.

⭐ Star this Actor if it saves you time — Apify's algorithm uses run counts + stars to surface Actors.

# Actor input Schema

## `source` (type: `string`):

channel = list videos on a channel. video = fetch full metadata (and optionally comments) for specific video URLs/IDs.

## `channel` (type: `string`):

Required for source=channel. Examples: '@mkbhd', 'https://www.youtube.com/@veritasium', or a channel ID 'UCsXVk37bltHxD1rDPwtNM8Q'.

## `videos` (type: `array`):

Required for source=video. Full URLs or 11-char IDs.

## `maxVideos` (type: `integer`):

Cap on videos returned from a channel.

## `enrichDetails` (type: `boolean`):

Slow but returns the full per-video schema (views, likes, tags, etc.).

## `maxComments` (type: `integer`):

Only used in video mode. 0 = no comments.

## Actor input object example

```json
{
  "source": "channel",
  "videos": [],
  "maxVideos": 50,
  "enrichDetails": false,
  "maxComments": 0
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("transparent_locket/youtube-channel-video-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("transparent_locket/youtube-channel-video-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 '{}' |
apify call transparent_locket/youtube-channel-video-scraper --silent --output-dataset

```

## MCP server setup

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