# 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, 0 monthly users, 0.0% runs succeeded, NaN 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/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 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("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=transparent_locket/youtube-channel-video-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Scraper (Free, No API Key)",
        "description": "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.",
        "version": "0.1",
        "x-build-id": "e6FdwBWPPBsls3YAb"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/transparent_locket~youtube-channel-video-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-transparent_locket-youtube-channel-video-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/transparent_locket~youtube-channel-video-scraper/runs": {
            "post": {
                "operationId": "runs-sync-transparent_locket-youtube-channel-video-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/transparent_locket~youtube-channel-video-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-transparent_locket-youtube-channel-video-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "source": {
                        "title": "Source",
                        "enum": [
                            "channel",
                            "video"
                        ],
                        "type": "string",
                        "description": "channel = list videos on a channel. video = fetch full metadata (and optionally comments) for specific video URLs/IDs.",
                        "default": "channel"
                    },
                    "channel": {
                        "title": "Channel (handle, URL, or ID)",
                        "type": "string",
                        "description": "Required for source=channel. Examples: '@mkbhd', 'https://www.youtube.com/@veritasium', or a channel ID 'UCsXVk37bltHxD1rDPwtNM8Q'."
                    },
                    "videos": {
                        "title": "Video URLs / IDs",
                        "type": "array",
                        "description": "Required for source=video. Full URLs or 11-char IDs.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxVideos": {
                        "title": "Max videos (channel mode)",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Cap on videos returned from a channel.",
                        "default": 50
                    },
                    "enrichDetails": {
                        "title": "Enrich channel videos with full metadata",
                        "type": "boolean",
                        "description": "Slow but returns the full per-video schema (views, likes, tags, etc.).",
                        "default": false
                    },
                    "maxComments": {
                        "title": "Max comments per video",
                        "minimum": 0,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Only used in video mode. 0 = no comments.",
                        "default": 0
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
