# YouTube Video Scraper — Search, Channels & Shorts (`zulfi_2026/youtube-video-scraper`) Actor

Scrape YouTube videos and Shorts from search queries, channels, playlists, or video URLs — title, channel, views, likes, duration, published date, and link. One result per video. Uses YouTube's public web API: no login, no API key, no proxy.

- **URL**: https://apify.com/zulfi_2026/youtube-video-scraper.md
- **Developed by:** [Zulkifal Khan](https://apify.com/zulfi_2026) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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.

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 — Search, Channels, Playlists & Video Data

### What does YouTube Video Scraper do?

Give it search terms, channel pages, playlists, or individual video links and
it returns every video as structured data — title, channel, views, likes,
duration, published date, description, and a direct link. One result per
video.

It reads YouTube's **public InnerTube web API** — the same JSON endpoints
the youtube.com website itself uses to load search results, channel pages,
and playlists. **No login, no API key, no proxy, no browser, no CAPTCHA
solving.** That is also why it is fast and reliable: a public video list
returns in one request, and pagination follows YouTube's own continuation
tokens.

### 🎯 Professional use cases

- 🔍 **Creator & competitor research** — For creators, agencies, and MCNs
  benchmarking a niche. Track what a channel is posting, which videos are
  gaining views, and how often they upload — then compare the same numbers
  across rival channels to see who is winning and why.
- 📈 **Trend & topic tracking** — For newsrooms, analysts, and marketers
  watching a topic. Search any keyword and see the top videos, sorted by
  upload date to catch breakout videos early, or by view count to find
  what is already winning the conversation.
- ✂️ **Content planning & clipping** — For clipping teams, editors, and
  short-form creators. Find the moments worth clipping, with durations and
  view counts attached, so you cut what audiences already proved they
  watch. Shorts are flagged and filterable, and whole Shorts catalogs can
  be pulled per channel.
- 🧪 **Market research** — For brands and product teams. See what videos
  exist about a product, a game, or a topic, and how audiences respond to
  them — views, likes, and upload dates tell you what the market cares
  about and when interest spiked.
- 📊 **Channel audits & reporting** — For sponsorship buyers, talent
  scouts, and consultants. Pull a channel's full catalog to audit upload
  cadence, average views, best performers, and consistency before a
  sponsorship deal, acquisition, or partnership.
- 🏷️ **Video SEO & metadata research** — For SEO specialists and content
  strategists. Study the titles, descriptions, and publish dates of
  ranking videos to learn what the algorithm rewards in a niche, and plan
  your own titles and descriptions around proven patterns.

### Input

| Icon | Field | What it does |
|---|---|---|
| 🔍 | **Search queries** | One per line, e.g. `gta 6 trailer`. Each query returns matching videos. |
| 📺 | **Channels** | One per line. A channel URL (`https://www.youtube.com/@MKBHD`), a handle (`@MKBHD`), or a channel ID (`UCBJycsmduvYEL83R_U4JriQ`). Returns the channel's videos, newest first. |
| 📱 | **Channel Shorts** | One per line. Same channel formats as above. Returns the channel's Shorts, newest first — the vertical videos search results rarely surface. |
| 📋 | **Playlists** | One per line. A playlist URL or a bare playlist ID (`PL...`). |
| 🎬 | **Video URLs** | One per line. A video URL or a bare video ID — fetches that video's data. |
| ↕️ | **Sort search results by** | Relevance, upload date (newest first), or view count (most viewed first). Search only. |
| 🔢 | **Max videos per source** | Default 50, up to 500. |
| ✨ | **Include details** | Off by default. On adds exact view counts, like counts, the full description, and the exact published date to every video (two extra requests per video, slower runs). |
| 📱 | **Shorts only** | Off by default. On keeps only Shorts. |

At least one search query, channel, channel Shorts list, playlist, or video is required. A source
that cannot be loaded (bad URL, deleted channel, private playlist) fails
cleanly and the run continues with the other sources.

### Output

One dataset item per video:

```json
{
  "videoId": "QdBZY2fkU-0",
  "title": "Grand Theft Auto VI Trailer 1",
  "url": "https://www.youtube.com/watch?v=QdBZY2fkU-0",
  "channelId": "UC6VcWc1rAoWdBCM0JxrRQ3A",
  "channelTitle": "Rockstar Games",
  "channelUrl": "https://www.youtube.com/channel/UC6VcWc1rAoWdBCM0JxrRQ3A",
  "viewCount": 309197753,
  "viewCountText": "309,197,753 views",
  "likeCount": 12000000,
  "durationSeconds": 91,
  "durationText": "1:31",
  "isShorts": false,
  "isLive": false,
  "publishedText": "2 years ago",
  "publishedDate": "2023-12-04",
  "description": "Song: Love Is A Long Road\nArtist: Tom Petty...",
  "thumbnailUrl": "https://i.ytimg.com/vi/QdBZY2fkU-0/hqdefault.jpg",
  "source": "search",
  "sourceQuery": "gta 6 trailer"
}
```

#### Output fields

| Field | Description |
|---|---|
| `videoId` | YouTube's unique ID for the video. |
| `title` | Video title as shown on YouTube. |
| `url` | Direct watch link (`https://www.youtube.com/watch?v=...`). |
| `channelId` / `channelTitle` / `channelUrl` | The owning channel's ID, display name, and link. |
| `viewCount` / `viewCountText` | Exact view count (number) and the formatted text YouTube shows. |
| `likeCount` | Exact like count — only when **Include details** is on. |
| `durationSeconds` / `durationText` | Length in seconds and in `m:ss` / `h:mm:ss` form. |
| `isShorts` | `true` for vertical Shorts, including the `/shorts/` URL form. |
| `isLive` | `true` for live streams and premieres. |
| `publishedText` / `publishedDate` | Relative time ("2 years ago") and the exact date (`YYYY-MM-DD`, details on only). |
| `description` | Full video description — only when **Include details** is on. |
| `thumbnailUrl` | Video thumbnail image URL. |
| `source` / `sourceQuery` | Which input produced the video (`search`, `channel`, `channelShorts`, `playlist`, `video`) and the query or channel it came from. |

`likeCount`, `publishedDate`, and `description` are only filled when
**Include details** is on (or for single-video inputs, which always load the
video's page data). Fields a source does not report come back as `null`.

A per-source summary (videos found and pushed per source, plus any source
that failed) is saved to the key-value store under the key `SUMMARY`.

### Notes

- Only **public** video data is collected: titles, view counts, likes,
  durations, dates, and descriptions that YouTube itself displays publicly.
  No private data, no comments, no user accounts, no login sessions.
- YouTube may rate-limit very large runs; the actor paces page requests and
  retries transient failures once.
- You are responsible for complying with YouTube's Terms of Service and
  applicable law when using the data this Actor returns.

# Actor input Schema

## `channelShortsUrls` (type: `array`):

YouTube channels to fetch Shorts from. One per line. A channel URL (https://www.youtube.com/@MKBHD), a handle (@MKBHD), or a channel ID (UCBJycsmduvYEL83R_U4JriQ). Returns the channel's Shorts, newest first.

## `channelUrls` (type: `array`):

YouTube channels to fetch videos from. One per line. A channel URL (https://www.youtube.com/@MKBHD), a handle (@MKBHD), or a channel ID (UCBJycsmduvYEL83R_U4JriQ). Returns the channel's videos, newest first.

## `includeDetails` (type: `boolean`):

On adds exact view counts, like counts, the full description, and the exact published date to every video (two extra requests per video, slower runs). Off by default — list data already includes views, duration, and relative publish time.

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

Maximum number of videos returned per source (per search query, per channel, per playlist). Higher values return more videos but use more compute.

## `playlistUrls` (type: `array`):

YouTube playlists to fetch videos from. One per line. A playlist URL (https://www.youtube.com/playlist?list=PL...) or a bare playlist ID (PL...).

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

YouTube search terms. One per line. Each query returns matching videos, sorted as selected below.

## `shortsOnly` (type: `boolean`):

Only keep Shorts (vertical videos under 60 seconds). Useful for clipping and Shorts research. Off by default.

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

How search results are sorted. Only applies to search queries.

## `videoUrls` (type: `array`):

Individual videos to fetch data for. One per line. A video URL (https://www.youtube.com/watch?v=QdBZY2fkU-0, https://youtu.be/QdBZY2fkU-0) or a bare video ID (QdBZY2fkU-0).

## Actor input object example

```json
{
  "channelUrls": [
    "https://www.youtube.com/@MKBHD"
  ],
  "includeDetails": false,
  "maxResults": 50,
  "searchQueries": [
    "gta 6 trailer"
  ],
  "shortsOnly": false,
  "sortBy": "relevance"
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing one item per video.

# 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 = {
    "channelUrls": [
        "https://www.youtube.com/@MKBHD"
    ],
    "searchQueries": [
        "gta 6 trailer"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("zulfi_2026/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 = {
    "channelUrls": ["https://www.youtube.com/@MKBHD"],
    "searchQueries": ["gta 6 trailer"],
}

# Run the Actor and wait for it to finish
run = client.actor("zulfi_2026/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 '{
  "channelUrls": [
    "https://www.youtube.com/@MKBHD"
  ],
  "searchQueries": [
    "gta 6 trailer"
  ]
}' |
apify call zulfi_2026/youtube-video-scraper --silent --output-dataset

```

## MCP server setup

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