# Youtube Video Scraper (channels, playlists, searches) (`igolaizola/youtube-video-scraper`) Actor

Extract full YouTube video metadata, complete descriptions, captions, thumbnails, embed links and analytics from playlists, channels or search results at scale. Ideal for content analysis, performance monitoring and seamless JSON integration with reliable proxy support.

- **URL**: https://apify.com/igolaizola/youtube-video-scraper.md
- **Developed by:** [Iñigo Garcia Olaizola](https://apify.com/igolaizola) (community)
- **Categories:** Videos, Social media
- **Stats:** 23 total users, 2 monthly users, 92.9% 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 Scraper

### 🤖 What does YouTube Video Scraper do?

YouTube Video Scraper enables you to extract comprehensive metadata and media details from any YouTube resource—channels, playlists, search results pages, or individual video URLs. It retrieves:

- **Video Details** – ID, title, length, complete description, keywords, author, view count, like count, publish/upload dates, and more
- **Captions** – Auto-generated and manual subtitle tracks, with track URLs and language codes
- **Microformat Data** – Thumbnails, embed settings (iframe URL, dimensions), category, family-safe flag, and availability by country
- **Owner & Channel Info** – Channel ID, channel name, external channel URL
- **Thumbnail URLs** – Multiple sizes of thumbnails (hqdefault, maxresdefault, etc.)
- **Embed & Playback Links** – Direct embed URL for iframe usage

This scraper gives you structured JSON output, ready for analytics, archiving, or feeding into downstream pipelines.

### 💡 Why scrape YouTube videos?

YouTube hosts over 2 billion monthly logged-in users and immense volumes of video content. Scraping YouTube videos lets you:

- **Perform Content Analysis:** Gather titles, descriptions, transcripts, and tags for NLP or sentiment analysis
- **Track Channel Performance:** Monitor upload frequency, view/like growth, and emerging keywords
- **Build Datasets:** Aggregate structured metadata across thousands of videos for research or machine learning
- **Automate Reporting:** Generate periodic reports on trending videos in a niche or competitor channels
- **Enable Multimedia Applications:** Preload thumbnails, embed links, or captions for custom apps or dashboards

### 🚀 How to scrape YouTube videos

1. **Configure Your Input:**

   - **Max Items:** Specify how many videos to scrape (e.g., the latest 20 uploads in a playlist)
   - **URLs:** Provide one or more YouTube URLs (channel, playlist, search page, or video link)

2. **Run the Actor:**

   - Click **Run** in the Apify Console or invoke via API/CLI

3. **Access & Use Your Data:**

   - Once finished, open the **Dataset** tab to preview, filter, or download your JSON results

### 📝 Input Parameters

The scraper supports the following parameters:

| Parameter            | Type             | Required | Description                                                                                   | Default                                                      |
| -------------------- | ---------------- | -------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| `maxItems`           | Integer          | Yes      | Maximum number of videos to scrape. Must be ≥ 1.                                              | `10`                                                         |
| `urls`               | Array of Strings | Yes      | One or more YouTube URLs (channel, playlist, search results, or video) to scrape videos from. | `["https://www.youtube.com/results?search_query=apify"]`     |

Example input:

```json
{
  "maxItems": 10,
  "urls": [
    "https://www.youtube.com/results?search_query=apify",
    "https://www.youtube.com/@Apify"
  ]
}
```

***

### 📊 Results

Example output snippet:

```json
[
  {
    "Video": {
      "ID": "gZ_RLC25gCw",
      "Title": "The Simplest Way to Automate Scraping Anything with No Code (Apify + n8n tutorial)",
      "Thumbnails": [
        {
          "URL": "https://i.ytimg.com/vi/gZ_RLC25gCw/hqdefault.jpg?sqp=-oaymwEiCKgBEF5IWvKriqkDFQgBFQAAAAAYASUAAMhCPQCAokN4AQ==\u0026rs=AOn4CLDddnaM9iDPX8YXetwPC6t-2Lvh7w",
          "Width": 168,
          "Height": 94
        },
        {
          "URL": "https://i.ytimg.com/vi/gZ_RLC25gCw/hqdefault.jpg?sqp=-oaymwEiCMQBEG5IWvKriqkDFQgBFQAAAAAYASUAAMhCPQCAokN4AQ==\u0026rs=AOn4CLCB8vHsYqFiuI_HueuLcBxnIDKGCQ",
          "Width": 196,
          "Height": 110
        },
        {
          "URL": "https://i.ytimg.com/vi/gZ_RLC25gCw/hqdefault.jpg?sqp=-oaymwEjCPYBEIoBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=\u0026rs=AOn4CLDRMwMBIyADpxCUea4r9Djxu-VvSQ",
          "Width": 246,
          "Height": 138
        },
        {
          "URL": "https://i.ytimg.com/vi/gZ_RLC25gCw/hqdefault.jpg?sqp=-oaymwEjCNACELwBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=\u0026rs=AOn4CLB2aMoAqrE0qe1uDSTDl6DJ7-DHvQ",
          "Width": 336,
          "Height": 188
        },
        {
          "URL": "https://i.ytimg.com/vi/gZ_RLC25gCw/maxresdefault.jpg",
          "Width": 1920,
          "Height": 1080
        },
        {
          "URL": "https://i.ytimg.com/vi/gZ_RLC25gCw/hqdefault.jpg?sqp=-oaymwEiCKgBEF5IWvKriqkDFQgBFQAAAAAYASUAAMhCPQCAokN4AQ==\u0026rs=AOn4CLDddnaM9iDPX8YXetwPC6t-2Lvh7w",
          "Width": 168,
          "Height": 94
        },
        {
          "URL": "https://i.ytimg.com/vi/gZ_RLC25gCw/hqdefault.jpg?sqp=-oaymwEiCMQBEG5IWvKriqkDFQgBFQAAAAAYASUAAMhCPQCAokN4AQ==\u0026rs=AOn4CLCB8vHsYqFiuI_HueuLcBxnIDKGCQ",
          "Width": 196,
          "Height": 110
        },
        {
          "URL": "https://i.ytimg.com/vi/gZ_RLC25gCw/hqdefault.jpg?sqp=-oaymwEjCPYBEIoBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=\u0026rs=AOn4CLDRMwMBIyADpxCUea4r9Djxu-VvSQ",
          "Width": 246,
          "Height": 138
        },
        {
          "URL": "https://i.ytimg.com/vi/gZ_RLC25gCw/hqdefault.jpg?sqp=-oaymwEjCNACELwBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=\u0026rs=AOn4CLB2aMoAqrE0qe1uDSTDl6DJ7-DHvQ",
          "Width": 336,
          "Height": 188
        },
        {
          "URL": "https://i.ytimg.com/vi/gZ_RLC25gCw/maxresdefault.jpg",
          "Width": 1920,
          "Height": 1080
        }
      ],
      "Description": "🔗 Try out Apify with code 30NATEHERK for 30% off: https://www.apify.com/?fpr=nate\n\n🌟 Want my full course on building AI Agents with no code?👇\nhttps://www.skool.com/ai-automation-society-plus/about\n\n📌 Join my FREE Skool community for all the resources to set this system up! 👇\nhttps://www.skool.com/ai-automation-society/about\n\n🚧 Start Building with n8n! (I get kickback if you sign up here - thank you!)\nhttps://n8n.partnerlinks.io/22crlu8afq5r\n\n💻 Check out my agency. We build intelligent AI systems for businesses. \nhttps://truehorizon.ai/\n\nWant to scrape websites, social media, or generate leads without writing a single line of code? In this video, I’ll show you the fastest and easiest way to use Apify with n8n to scrape anything, from Instagram profiles to Google Maps businesses and more. \n\nApify is a platform full of powerful, pre-built actors, and when you connect it to n8n, you unlock a no-code automation system that can collect and move data wherever you need it. I’ll walk you through how to set up your first Actor in under 5 minutes, how to connect it to n8n just by copying and pasting. \n\nWhether you’re a business owner, marketer, or just exploring no-code tools, this combo is incredibly powerful for lead generation, research, and content workflows. No coding, no headaches—just plug, play, and scrape.\nYou can sign up for Apify here: https://www.apify.com/?fpr=nate and use the code 30NATEHERK for 30% off Apify credits.\n\nSponsorship Inquiries:\n📧 sales@uppitai.com\n\nWATCH NEXT:\nhttps://youtu.be/QhujcQk8pyU?si=kpGWo0cF4aiAaT68\n\nTIMESTAMPS\n00:00 What is Apify?\n00:48 How this works in n8n\n01:41 Live Setup TikTok Scraper\n05:07 Run Actor Synchronously Issue\n05:49 Adding a Wait Step\n07:14 Advanced Technique: Polling\n\nGear I Used:\nCamera: Razer Kiyo Pro\nMicrophone: Blue Yeti USB",
      "Channel": {
        "ID": "UC2ojq-nuP8ceeHqiroeKhBA",
        "Name": "Nate Herk | AI Automation",
        "Handle": "",
        "Description": "",
        "Thumbnails": [
          {
            "URL": "https://yt3.ggpht.com/oIDUNVZEoSIIiR7d7xSguLYmI6zs3B_NB1Tbq617pzQ9g54jybjiD3jiZ9zy36tJcLyt12QOlQ=s48-c-k-c0x00ffffff-no-rj",
            "Width": 48,
            "Height": 48
          },
          {
            "URL": "https://yt3.ggpht.com/oIDUNVZEoSIIiR7d7xSguLYmI6zs3B_NB1Tbq617pzQ9g54jybjiD3jiZ9zy36tJcLyt12QOlQ=s88-c-k-c0x00ffffff-no-rj",
            "Width": 88,
            "Height": 88
          },
          {
            "URL": "https://yt3.ggpht.com/oIDUNVZEoSIIiR7d7xSguLYmI6zs3B_NB1Tbq617pzQ9g54jybjiD3jiZ9zy36tJcLyt12QOlQ=s176-c-k-c0x00ffffff-no-rj",
            "Width": 176,
            "Height": 176
          }
        ],
        "SubscriberCount": "389K subscribers",
        "Videos": {},
        "Shorts": {},
        "Live": {},
        "Playlists": {},
        "Posts": {},
        "URL": "https://www.youtube.com/channel/UC2ojq-nuP8ceeHqiroeKhBA"
      },
      "UploadDate": "May 16, 2025",
      "ViewCount": {},
      "LikeCount": {},
      "IsLiveContent": false,
      "Tags": [],
      "Related": {},
      "Captions": {
        "Languages": [
          {
            "Name": "English (auto-generated)",
            "Code": "en",
            "IsTranslatable": true,
            "URL": "https://www.youtube.com/api/timedtext?v=gZ_RLC25gCw\u0026ei=yzTgaJXgFdKN1d8PicbdqQk\u0026caps=asr\u0026opi=112496729\u0026xoaf=5\u0026xowf=1\u0026hl=en\u0026ip=0.0.0.0\u0026ipbits=0\u0026expire=1759549243\u0026sparams=ip,ipbits,expire,v,ei,caps,opi,xoaf\u0026signature=1F6878915EB4DB0DD75A84FDD55E18D228BAD39B.813031B257B5BD36C8554B31B40D2988E322D55D\u0026key=yt8\u0026kind=asr\u0026lang=en"
          }
        ]
      },
      "Duration": 474,
      "Chapters": null,
      "Comments": {}
    },
    "LiveVideo": null
  }
]
```

### ⚖️ Legal Considerations

When using YouTube Video Scraper, please keep in mind:

- **YouTube's Terms of Service:** Ensure your use case complies with YouTube's policies.
- **Respect Rate Limits:** Configure `maxItems` reasonably to avoid overwhelming YouTube's servers.
- **Data Privacy Laws:** If you're processing personal data, ensure GDPR or other regulations compliance.
- **Consult Legal Advice:** When in doubt about data usage rights or redistribution, seek professional guidance.

For more on web scraping legality, see our blog post: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

# Actor input Schema

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

Maximum number of videos to scrape

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

List of YouTube URLs to scrape. It can be a channel, playlist, search results page, or a video URL.

## Actor input object example

```json
{
  "maxItems": 10,
  "urls": [
    "https://www.youtube.com/results?search_query=apify"
  ]
}
```

# Actor output Schema

## `results` (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 = {
    "urls": [
        "https://www.youtube.com/results?search_query=apify"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("igolaizola/youtube-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 = { "urls": ["https://www.youtube.com/results?search_query=apify"] }

# Run the Actor and wait for it to finish
run = client.actor("igolaizola/youtube-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 '{
  "urls": [
    "https://www.youtube.com/results?search_query=apify"
  ]
}' |
apify call igolaizola/youtube-video-scraper --silent --output-dataset

```

## MCP server setup

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