# YouTube Scraper — Videos, Shorts, Channels & Playlists (`vsekar91/youtube-scraper`) Actor

Scrape public YouTube videos, Shorts, channels and playlists: title, views, likes, duration, tags, description, subscribers. No login or API key. Respects youtube.com/robots.txt.

- **URL**: https://apify.com/vsekar91/youtube-scraper.md
- **Developed by:** [Venkatesh Sekar](https://apify.com/vsekar91) (community)
- **Categories:** Social media, Videos
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 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 Scraper — Videos, Shorts, Channels & Playlists (No Login)

**A YouTube scraper that needs no API key, no login and no cookies.** Give it video, Shorts, channel or playlist URLs and it returns clean, structured data from [YouTube](https://www.youtube.com)'s public pages: **views, likes, comment count, duration, publish date, tags, description, thumbnail**, plus channel **subscribers, video count and avatar**.

This actor follows `youtube.com/robots.txt`. It reads only the public pages that file allows, so it does **not** scrape search results or comments, and it reads only the first page of a channel or playlist. That is about 30 videos per tab.

### What you get

Every dataset item has a `type` of `video` or `channel`.

| Type | Fields |
|---|---|
| **video** | `id`, `url`, `title`, `channelName`, `channelId`, `channelUrl`, `views`, `likes`, `commentCount`, `duration` (seconds), `durationText`, `publishedAt` (ISO date), `publishedText`, `description`, `tags`, `thumbnail`, `isShort`, `isLive`, `category`, `source` |
| **channel** | `id`, `handle`, `url`, `title`, `subscribersText`, `subscribers`, `videoCount`, `description`, `avatar`, `banner` |

Any value YouTube does not show, such as hidden like or subscriber counts, comes back as `null`. The actor never makes up a number.

### Use cases

- **Track videos:** views, likes and comment counts for a list of videos, tracked over time.
- **Research creators:** subscribers and recent uploads for a list of channels.
- **Analyse playlists:** export a playlist's videos with durations and tags.

### Input

| Field | Default | What it does |
|---|---|---|
| `startUrls` | @MrBeast videos, Rick Astley video | Video (`watch`, `youtu.be`, `/shorts/`), channel (`@handle`, `/channel/ID`; add `/shorts` or `/streams` for that tab) or playlist URLs |
| `maxResults` | 20 | Videos per channel tab or playlist. YouTube shows about 30 on the first page |
| `fetchVideoDetails` | `true` | Opens each video's page for likes, tags, the full description, comment count and the exact date |
| `includeChannelInfo` | `true` | Adds one `channel` record per channel input |
| `proxyConfiguration` | Apify Proxy | Proxy used for requests |

```json
{
  "startUrls": [{ "url": "https://www.youtube.com/@MrBeast/videos" }, { "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }],
  "maxResults": 20
}
```

### Example output

```json
{
  "type": "video",
  "id": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channelName": "Rick Astley",
  "views": 1837517267,
  "likes": 19507012,
  "commentCount": 2462471,
  "duration": 213,
  "publishedAt": "2009-10-24T23:57:33-07:00",
  "tags": ["rick astley", "Never Gonna Give You Up", "nggyu"],
  "isShort": false,
  "category": "Music"
}
```

### Pricing

**$0.0032 per result.** A video record and a channel record each count as one result. You pay only for items scraped successfully. Failed inputs, such as an invalid URL, a private or deleted video, or a blocked request, are never charged. They are listed in the run's `FAILED_ITEMS` record with the exact reason.

### FAQ

**Why no search results or comments?**
`youtube.com/robots.txt` disallows `/results` (search) and `/youtubei/`, the endpoint that loads comments and "load more" pages. This actor respects that file. Search inputs are reported in `FAILED_ITEMS` as `search_not_supported` and are not charged.

**Why only about 30 videos per channel?**
YouTube shows about 30 videos on the first page of a channel tab or playlist. Loading more needs the disallowed `/youtubei/` endpoint. To get more videos, add the video URLs directly.

**Are the numbers exact?**
`views` and `likes` are exact when YouTube shows them. `commentCount` and `subscribers` come from YouTube's rounded text (for example `526M subscribers`), so they are approximations. The original text is kept in `subscribersText`.

### Legal

This actor collects only public data that YouTube shows to any visitor without logging in, and it follows `youtube.com/robots.txt`. You are responsible for how you use the data. Make sure your use follows [YouTube's Terms of Service](https://www.youtube.com/t/terms), copyright law and data protection rules such as the GDPR. This actor is not affiliated with or endorsed by YouTube or Google.

# Actor input Schema

## `startUrls` (type: `array`):

YouTube video, Shorts, channel or playlist URLs. Search and comments are not supported (youtube.com/robots.txt disallows them).

## `maxResults` (type: `integer`):

Maximum number of videos to return for each search query, channel or playlist. A channel's own record is not counted. Single video URLs always return that video.

## `fetchVideoDetails` (type: `boolean`):

Open every listed video's watch page to add likes, tags, full description, comment count and exact publish date. Turn off for a faster, lighter run with only the fields shown in lists (title, views, duration, published text, channel).

## `includeChannelInfo` (type: `boolean`):

For channel URLs, also return one channel record (subscribers, video count, description, links, avatar) before the videos.

## `maxConcurrency` (type: `integer`):

How many watch pages to fetch in parallel.

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

Proxy used for outbound requests. Datacenter proxies are used first; if YouTube blocks them the actor switches to the residential group automatically (residential traffic costs more).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/@MrBeast/videos"
    },
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "maxResults": 5,
  "fetchVideoDetails": true,
  "includeChannelInfo": true,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": []
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All result rows from this run's default dataset.

## `results_overview` (type: `string`):

No description

## `results_channels` (type: `string`):

No description

## `results_comments` (type: `string`):

No description

## `failedInputs` (type: `string`):

Inputs that failed, with the reason. These are never charged.

# 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 = {
    "startUrls": [
        {
            "url": "https://www.youtube.com/@MrBeast/videos"
        },
        {
            "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
        }
    ],
    "maxResults": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("vsekar91/youtube-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 = {
    "startUrls": [
        { "url": "https://www.youtube.com/@MrBeast/videos" },
        { "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" },
    ],
    "maxResults": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("vsekar91/youtube-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 '{
  "startUrls": [
    {
      "url": "https://www.youtube.com/@MrBeast/videos"
    },
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "maxResults": 5
}' |
apify call vsekar91/youtube-scraper --silent --output-dataset

```

## MCP server setup

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