# YouTube Scraper: Videos, Shorts, Channels & Search API (`mastertools/youtube-scraper`) Actor

Fast YouTube API alternative with no quota and no login. Scrape videos, Shorts, channels, playlists and search: exact views, likes, comment count, subscribers, publish date, tags and links.

- **URL**: https://apify.com/mastertools/youtube-scraper.md
- **Developed by:** [Master Tools](https://apify.com/mastertools) (community)
- **Categories:** Videos, Social media
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 videos

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

**Every number behind a YouTube video in one clean row: views, likes, comments, subscribers, date and more.**

A fast alternative to the YouTube Data API — no quota, no API key, no login. Search YouTube or paste links to videos, Shorts, channels and playlists: you get one flat row per video with exact views, likes and comment count, the channel's subscribers, publish date and time, length, description, links, hashtags and the hidden tags. It works without a browser, so ten fully detailed videos arrive in seconds.

### What you get

- **Real engagement numbers in every row** — exact views, likes and comment count, the channel's subscribers and verified badge. Work out engagement rate or compare creators right away.
- **Search, channels, playlists, videos and Shorts in one run** — mix search phrases and links in one input. Search links with filters from youtube.com work too.
- **YouTube's own search filters, in any country** — upload date, duration, most viewed, subtitles, Creative Commons, HD, 4K, live now, plus the country and language of the results. Add Shorts to any search.
- **Whole channels** — videos, Shorts and live streams, newest first, as many as you need.
- **Any date range** — "published after" and "published before" take a date or a period like "7 days": pull a channel's videos from one quarter, or schedule the run to follow channels and topics day by day.
- **Data marketers ask for** — links from the description, hashtags, the creator's hidden tags, category, search position, and whether the video has subtitles or chapters.
- **Every link answered** — a deleted or private video, an unknown channel or a wrong link comes back as a short row with the reason. Age-restricted videos still give their numbers.
- **Fast and light** — plain HTTP instead of a browser: ten fully detailed videos in seconds, in the smallest memory size.

### How to use

1. Press **Start** — the example search works as is.
2. Type your own search phrases or paste links: videos, Shorts, `@channels`, playlists or search pages.
3. Download the results as JSON, CSV, Excel or HTML, or take them through the API.

### Input

| Field | What it does | Example |
|---|---|---|
| `searchQueries` | Search phrases — the top videos for each. | `electric cars review` |
| `urls` | Videos, Shorts, channels, playlists or search pages, one per line. Video IDs and @handles work too. Add `/shorts` or `/streams` to a channel link for Shorts or live streams only. | `https://www.youtube.com/@mkbhd` |
| `maxResults` | Videos per search phrase, channel or playlist. Channels start from the newest. | `10` |
| `maxShorts` | Also take this many Shorts from each search phrase and channel. | `5` |
| `maxStreams` | Also take this many live streams from each channel. | `2` |
| `publishedAfter` | Keep only videos published after a date or within a period. | `2026-11-01`, `7 days` |
| `publishedBefore` | Keep only videos published before a date — together with `publishedAfter` it is a date range. Channels skip the newer videos and still give you `maxResults`. | `2024-01-01`, `30 days` |
| `sortBy` | Search order: `relevance` or `views` (most viewed). | `views` |
| `uploadDate` | Search filter: `hour`, `today`, `week`, `month`, `year`. | `week` |
| `duration` | Search filter: `short` (under 4 min), `medium` (4–20 min), `long` (over 20 min). | `long` |
| `features` | Search filter: `subtitles`, `creativeCommons`, `hd`, `4k`, `live`, `hdr`, `360`, `vr180`, `3d`, `location`. | `["subtitles"]` |
| `country` | Search as people in this country see YouTube (two-letter code, 111 countries). | `GB`, `DE`, `BR` |
| `language` | Language of the search results (83 languages). Titles and descriptions always stay original. | `de`, `pt`, `ja` |

```json
{
  "searchQueries": ["electric cars review"],
  "urls": [
    "https://www.youtube.com/@mkbhd",
    "https://www.youtube.com/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi"
  ],
  "maxResults": 20,
  "maxShorts": 5,
  "uploadDate": "month",
  "sortBy": "views"
}
```

### Output

One row per video. Example from the default search (description and lists shortened):

```json
{
  "videoId": "QhD015WUMxE",
  "url": "https://www.youtube.com/watch?v=QhD015WUMxE",
  "type": "video",
  "title": "Beginners Guide To Web Scraping with Python - All You Need To Know",
  "channelName": "Tinkernut",
  "channelHandle": "@Tinkernut",
  "channelId": "UCZDA1kA3y3EIg25BpcHSpwQ",
  "channelUrl": "https://www.youtube.com/channel/UCZDA1kA3y3EIg25BpcHSpwQ",
  "channelSubscribers": 626000,
  "channelVerified": true,
  "publishedAt": "2021-11-27T13:00:24.000Z",
  "durationSeconds": 456,
  "duration": "7:36",
  "viewCount": 490116,
  "likeCount": 13308,
  "commentCount": 233,
  "commentsOff": false,
  "description": "The web is full of data. Lots and lots of data. Data prime for scraping. …",
  "descriptionLinks": ["https://github.com/gigafide/basic_python_scraping/", "https://www.python.org/downloads/", "…"],
  "hashtags": [],
  "tags": ["Web Scraping", "python", "python web scraping", "web scraping tutorial", "…"],
  "category": "Education",
  "thumbnailUrl": "https://i.ytimg.com/vi/QhD015WUMxE/hqdefault.jpg",
  "hasCaptions": true,
  "hasChapters": true,
  "isAgeRestricted": false,
  "isUnlisted": false,
  "position": 1,
  "input": "web scraping",
  "scrapedAt": "2026-11-09T15:16:16.887Z",
  "status": "ok"
}
```

- `type` — `video`, `short`, `live` (on air now), `upcoming` (scheduled) or `stream` (recording of a past live stream).
- `position` — place in the search results, in the channel (1 = newest) or in the playlist. Track how your videos rank for a search phrase.
- `channelSubscribers` — as YouTube shows it, rounded (8.75M → 8750000).

A link that gives nothing comes back like this:

```json
{
  "videoId": "xxxxxxxxxxx",
  "url": "https://www.youtube.com/watch?v=xxxxxxxxxxx",
  "status": "unavailable",
  "input": "https://www.youtube.com/watch?v=xxxxxxxxxxx",
  "error": "Video unavailable: it was deleted, made private, or the link is wrong."
}
```

`status` is `ok`, `unavailable` or `error`. The **Videos** view in the Output tab shows the main numbers with thumbnails; the **Channels** view lists channels with subscribers.

### Use it with AI agents

Add the Actor as a tool in Claude, ChatGPT, Cursor, n8n or any MCP client through the Apify MCP server (`mcp.apify.com`). One field is enough — `searchQueries` or `urls` — and the answer comes back as compact JSON in seconds.

Typical jobs: find creators in a niche with their subscribers and engagement, compare a channel's latest videos, check what ranks for a search phrase, pull links and sponsors from video descriptions.

#### Instant API for agents (Standby)

The Actor also runs as an always-ready web API: no run to start, no dataset to read — one request, one JSON answer.

```
GET https://mastertools--youtube-scraper.apify.actor/?search=electric+cars&maxResults=5
Authorization: Bearer <YOUR_APIFY_TOKEN>
```

Use `url=` instead of `search=` for a video, channel or playlist, and add `maxShorts`, `publishedAfter`, `publishedBefore`, `sortBy`, `uploadDate`, `duration`, `country` or `language` as query parameters — or POST the same JSON as the Actor input. You get the same rows as in the dataset.

### Integrations

Google Sheets, Make, Zapier, n8n, Airbyte, webhooks and the Apify API. Schedule a run with `publishedAfter: "1 day"` to get every new video of the channels and topics you follow.

### FAQ

**Do I need a YouTube account or API key?** No. Type a search phrase or paste links and press Start.

**How fresh is the data?** Every run reads YouTube live: views, likes and comments are the numbers at that moment.

**Does it work with Shorts and live streams?** Yes — paste `/shorts/` links, a channel's `/shorts` or `/streams` page, or set `maxShorts` and `maxStreams`.

**Can I follow channels and get only new videos?** Yes. Set `publishedAfter` to `1 day` or `7 days` and schedule the Actor. Older videos are skipped.

**Can I get a channel's videos from a past period?** Yes. Set `publishedAfter` and `publishedBefore`, for example `2023-06-01` and `2024-01-01`. Newer videos are skipped, and `position` still shows each video's place in the channel.

**Can I search YouTube as people in another country see it?** Yes. Set `country` and `language` — for example `DE` and `de` for German results.

**Why is `likeCount` or `commentCount` empty?** The creator hid likes or turned comments off (`commentsOff: true`), or the video is a live stream with a chat instead of comments.

**Can I get the spoken text of the videos?** `hasCaptions` shows which videos have subtitles. Our YouTube Transcripts Actor turns them into full text with timestamps and chapters.

### Need data at scale?

Daily tracking of thousands of channels and keywords, a pipeline into your CRM, data warehouse or BI tool, or a custom scraper for another video platform — we build it for you.

# Actor input Schema

## `searchQueries` (type: `array`):

Search phrases, one per line — like typing them into YouTube search. You get the top videos for each phrase with views, likes, comments, date and more.

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

Videos, Shorts, channels, playlists or search pages — one per line. Video IDs and @handles work too. A channel link gives its newest videos; add /shorts or /streams to the link for Shorts or live streams only.

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

How many videos to take from each search phrase, channel or playlist. Channels start from the newest video.

## `maxShorts` (type: `integer`):

Also take this many Shorts from each search phrase and channel. 0 — no extra Shorts.

## `maxStreams` (type: `integer`):

Also take this many live streams and stream recordings from each channel. 0 — none.

## `publishedAfter` (type: `string`):

Keep only fresh videos: a date like 2026-11-01 or a period like 7 days. Great for tracking channels and topics on a schedule — older videos are skipped and not charged.

## `publishedBefore` (type: `string`):

End of a date range: a date like 2026-01-01 or a period like 30 days (then only videos older than 30 days). Channels skip the newer videos and still give you as many as you asked for; in searches and playlists newer videos are skipped and not charged.

## `sortBy` (type: `string`):

Relevance — like YouTube shows by default. Most viewed — the biggest videos first. For the newest videos, use the upload date filter or "Only videos published after".

## `uploadDate` (type: `string`):

Only videos uploaded within this period.

## `duration` (type: `string`):

Only videos of this length.

## `features` (type: `array`):

Only videos that have all of these.

## `country` (type: `string`):

Search YouTube as people in this country see it. Leave empty for the United States.

## `language` (type: `string`):

Ranks videos in this language higher. Leave empty for English. Rows always keep the original title and description.

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

Residential proxies are already set up and give the most reliable results. The default works for most users.

## Actor input object example

```json
{
  "searchQueries": [
    "web scraping",
    "electric cars review"
  ],
  "urls": [
    "https://www.youtube.com/@mkbhd",
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://www.youtube.com/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi"
  ],
  "maxResults": 10,
  "maxShorts": 0,
  "maxStreams": 0,
  "sortBy": "relevance",
  "uploadDate": "any",
  "duration": "any",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All rows of this run in the default dataset.

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

// Run the Actor and wait for it to finish
const run = await client.actor("mastertools/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 = {
    "searchQueries": ["web scraping"],
    "maxResults": 10,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

```

## MCP server setup

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