# YouTube Scraper – Videos, Comments & Channels (no browser) (`budoucnost-ai/youtube-scraper`) Actor

Scrape YouTube search results, channel videos/Shorts/live and video URLs via YouTube's own JSON API: views, duration, dates, likes, tags, chapters, comments with replies and channel info. Filters before charging, shared cache, no browser, no API key.

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

## Pricing

from $1.80 / 1,000 video scrapeds

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 Scraper – Videos, Comments & Channels (no browser)

Scrape **YouTube search results, channel videos (incl. Shorts and live streams) and individual video URLs** – with optional
**full video details, comments with replies and channel info** – in one run. The actor talks to YouTube's own JSON API
(the one youtube.com uses internally), so it needs **no browser, no API key and no login**, starts in seconds and stays cheap.

All filters (date, views, duration, Shorts/live, regex, excluded ids, limits, duplicates) are applied **before** you are
charged, so you only pay for rows you actually want.

### What you can use it for

- **Brand & competitor monitoring** – every new video mentioning your brand in the last week, with views and comments.
- **Influencer discovery** – search a niche, keep videos with 10k–500k views, get the channel's subscribers, country and links.
- **Channel analytics** – all uploads of a channel (or only the last 30 days), most popular videos, Shorts vs. long-form.
- **Comment research / sentiment** – top or newest comments with replies, likes, pinned and "hearted by creator" flags.
- **Content research** – titles, tags, hashtags, chapters and descriptions of the top videos for a keyword.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `searchQueries` | string\[] | – | YouTube search terms. Each query is one source. |
| `channelUrls` | string\[] | – | Channel URL, `@handle`, `/channel/UC…`, `/c/name` or UC… id. Videos tab + Shorts/Live tabs. |
| `videoUrls` | string\[] | – | watch / youtu.be / shorts / live URLs or video ids. |
| `maxItems` | integer | 50 | Max video rows in total. |
| `maxItemsPerSource` | integer | 0 | Max videos per query/channel (0 = off). |
| `sortBy` | relevance | date | views | rating | relevance | Search sort; for channels `views` = Popular, otherwise newest first. |
| `uploadDate` | any | hour | today | week | month | year | any | YouTube filter + enforced client-side (channels too). |
| `durationFilter` | any | short | medium | long | any | YouTube length filter (< 4 min, 4–20 min, > 20 min). |
| `features` | string\[] | \[] | YouTube feature filters: hd, 4k, subtitles, creativeCommons, live, 360, vr180, 3d, hdr, location, purchased. |
| `country` | string | US | Region of results (`gl`), e.g. CZ, DE. |
| `publishedAfter` / `publishedBefore` | string | – | ISO date or relative ("30 days"). Channel listings stop paging once videos are older. |
| `minViews` / `maxViews` | integer | 0 | View range (0 = off). |
| `minDurationSec` / `maxDurationSec` | integer | 0 | Exact duration range in seconds. |
| `includeShorts` | boolean | true | Include Shorts. |
| `includeLive` | boolean | true | Include live, upcoming and premiere videos. |
| `includeRegex` / `excludeRegex` | string | – | Case-insensitive regex over title + channel + description. |
| `excludeIds` | string\[] | \[] | Video ids/URLs to skip (e.g. already scraped). |
| `includeVideoDetails` | boolean | false | **Add-on:** full description, keywords/tags, hashtags, likes, comment count, category, exact publish date, chapters, channel subscribers. |
| `includeComments` | boolean | false | Scrape comments of each returned video. |
| `maxCommentsPerVideo` | integer | 20 | Comment limit per video (replies included). |
| `commentsSort` | top | newest | top | Comment order. |
| `includeReplies` | boolean | false | Also fetch reply threads (`parentId` set). |
| `includeChannelInfo` | boolean | false | **Add-on:** one channel row per channel (subscribers, views, videos, country, joined, links). |
| `cacheHours` | integer | 24 | Reuse data fetched in the last N hours (0 = always fresh). |
| `useSharedCache` | boolean | true | Reuse public video details / channel info fetched by other users of this actor. |
| `maxConcurrency` | integer | 5 | Parallel requests. |
| `proxyConfiguration` | object | Apify datacenter | Proxy settings. |

Example – videos about e-bikes from the last month with more than 1,000 views, plus 10 top comments each:

```json
{
    "searchQueries": ["elektrokolo", "e-bike review"],
    "maxItems": 100,
    "uploadDate": "month",
    "minViews": 1000,
    "includeShorts": false,
    "includeVideoDetails": true,
    "includeComments": true,
    "maxCommentsPerVideo": 10
}
```

### Output

Every row has a `type`: `video`, `comment`, `channel` or `error` (errors are free). Dataset views: Videos, Comments, Channels.

```json
{
    "type": "video",
    "id": "nwKPWkERQQw",
    "url": "https://www.youtube.com/watch?v=nwKPWkERQQw",
    "title": "LEVNÉ SKLÁDACÍ ELEKTROKOLO | TOUROLL S3 | RECENZE",
    "channelName": "Jenda z Lesa",
    "channelId": "UCeenU_SVl8CgKcPVSBCBDzg",
    "channelUrl": "https://www.youtube.com/@JendazLesaa",
    "channelHandle": "@JendazLesaa",
    "publishedText": "2 months ago",
    "publishedAt": "2026-08-31T17:30:17.000Z",
    "publishedAtPrecision": "exact",
    "durationSec": 528,
    "durationText": "8:48",
    "viewCount": 3798,
    "thumbnail": "https://i.ytimg.com/vi/nwKPWkERQQw/hq720.jpg",
    "isShort": false,
    "isLive": false,
    "isUpcoming": false,
    "descriptionSnippet": "V dnešním videu se podíváme na levné skládací elektrokolo TOUROLL S3…",
    "badges": ["4K"],
    "source": { "type": "search", "value": "elektrokolo", "position": 10 },
    "likeCount": 56,
    "commentCount": 7,
    "description": "► V dnešním videu se podíváme na levné skládací elektrokolo…",
    "keywords": ["elektrokolo", "touroll s3"],
    "hashtags": ["#elektrokolo"],
    "category": "Autos & Vehicles",
    "uploadDate": "2026-08-31T17:30:17.000Z",
    "channelSubscriberCount": 14300,
    "channelVerified": false,
    "chapters": [{ "title": "Intro", "startSec": 0 }],
    "scrapedAt": "2026-11-12T23:18:26.284Z"
}
```

```json
{
    "type": "comment",
    "videoId": "KfODG5REyss",
    "commentId": "UgxPvQeVzqKtAU2D1Gx4AaABAg",
    "parentId": null,
    "author": "@veritasium",
    "authorChannelId": "UCHnyfMqiRRG1u-2MsSQLbXA",
    "authorUrl": "https://www.youtube.com/channel/UCHnyfMqiRRG1u-2MsSQLbXA",
    "text": "Get all sides of every story at https://ground.news/ve …",
    "likeCount": 582,
    "replyCount": 142,
    "publishedText": "8 days ago (edited)",
    "publishedAt": "2026-11-04T23:14:13.633Z",
    "isEdited": true,
    "isPinned": true,
    "isHearted": false,
    "isCreator": true
}
```

```json
{
    "type": "channel",
    "id": "UCHnyfMqiRRG1u-2MsSQLbXA",
    "url": "https://www.youtube.com/channel/UCHnyfMqiRRG1u-2MsSQLbXA",
    "handle": "@veritasium",
    "name": "Veritasium",
    "subscriberCount": 21400000,
    "videoCount": 549,
    "viewCount": 4750687645,
    "description": "An element of truth - videos about science, education, and anything else we find interesting.",
    "country": "United States",
    "joinedDate": "2010-07-21",
    "links": [{ "title": "Patreon", "url": "https://patreon.com/veritasium" }],
    "thumbnail": "https://yt3.googleusercontent.com/…=s900-c-k-c0x00ffffff-no-rj",
    "isVerified": true
}
```

`publishedAtPrecision` is `exact` (from the video details), `day` (watch page date) or `estimate` (computed from
YouTube's relative "3 weeks ago" text in listings).

### Pricing (pay per event)

| Event | Price | When |
|---|---|---|
| `video-scraped` | $0.0018 ($1.80 / 1,000 videos) | Each video row stored (after all filters). |
| `video-details` | $0.001 | Add-on, per video when `includeVideoDetails` is on. |
| `comment-scraped` | $0.0006 ($0.60 / 1,000 comments) | Each comment or reply row. |
| `channel-info` | $0.002 | Add-on, per channel row. |

Skipped, duplicate, filtered, failed and blocked items are never charged. Example: 1,000 videos with details and 20
comments each = $1.80 + $1.00 + $12.00.

### Why this instead of streamers/youtube-scraper

| | This actor | streamers/youtube-scraper |
|---|---|---|
| Price per 1,000 videos | **$1.80** | $2.40–$4.00 (by plan) |
| Comments | **$0.60 / 1,000**, same run | separate actor ($0.90 / 1,000) |
| Videos + comments + channel info in one run | **yes** | three actors |
| Filters applied before charging (views, duration, regex, dates, ids) | **yes** | partly; date range on channels is a paid add-on |
| Date filter on channels | free, stops paging early | extra charge |
| Shared cache across users + per-user cache | **yes** – reruns are faster and get fewer blocks | no |
| Engine | YouTube JSON API, no browser, small memory, starts in seconds | – |
| Extra fields | chapters, hashtags, pinned / hearted / creator flags on comments, channel links & country, `publishedAtPrecision` | varies |
| Transcripts / subtitles | no (see Limitations) | yes |

### Limitations

- **No transcripts, subtitles or media downloads.** YouTube protects caption files with a proof-of-origin token; generating
  it would mean circumventing anti-bot protection, which this actor does not do.
- Shorts in search shelves and on the Shorts tab come without channel, duration and date unless `includeVideoDetails` is on
  (with a date filter, the actor quietly checks their date without charging the add-on).
- YouTube treats `sortBy: date` and `rating` in search as a hint rather than a strict order; combine with `uploadDate`.
- Texts like `publishedText` stay in English (hl=en) so numbers and dates parse reliably; `country` changes the result region.
- YouTube sometimes asks datacenter IPs to "sign in to confirm you're not a bot" on the video details endpoint. The actor
  retries with a new proxy session and then falls back to watch-page data; if everything is refused it stores one free
  `blocked: true` row and stops. Lower `maxConcurrency` or pick another proxy group in that case.
- Hidden like counts are `null`; videos with comments turned off have `commentCount: null` and no comment rows.

### Integrations & API

Run it from your code with the Apify API client:

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('budoucnost-ai/youtube-scraper').call({
    channelUrls: ['@veritasium'],
    maxItems: 20,
    publishedAfter: '90 days',
    includeVideoDetails: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.filter((i) => i.type === 'video').map((v) => `${v.viewCount}\t${v.title}`).join('\n'));
```

Works with Apify integrations (Make, Zapier, n8n, Google Sheets, webhooks) and schedules – e.g. a daily run with
`uploadDate: "today"` and `excludeIds` from the previous run gives you a feed of only new videos.

# Actor input Schema

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

YouTube search terms, one per line. Each query is a separate source (see maxItemsPerSource). Searches always return videos (no playlists/channels); use sortBy, uploadDate, durationFilter and features to narrow them on YouTube’s side.

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

Channel URL (https://www.youtube.com/@veritasium, /channel/UC…, /c/name), @handle or UC… channel id. Lists the Videos tab (newest first, or most popular with sortBy = views), plus the Shorts and Live tabs when includeShorts / includeLive are on.

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

Individual videos: watch, youtu.be, /shorts/, /live/ URLs or 11-character video ids. Combine with includeComments to scrape comments of known videos.

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

Stop after this many video rows across all sources. Comments and channel rows are not counted here (see maxCommentsPerVideo).

## `maxItemsPerSource` (type: `integer`):

0 = only the total limit applies.

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

Sent to YouTube. For channels, "views" switches to the Popular chip, anything else lists newest first. YouTube treats date/rating sorting as a hint, not a strict order.

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

YouTube search filter, also enforced client-side (on channels too) before charging.

## `durationFilter` (type: `string`):

YouTube search filter. For exact limits use minDurationSec / maxDurationSec.

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

Search only: videos must have all selected features.

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

Two-letter region for search results and trending context, e.g. US, CZ, DE. Texts stay in English so counts and dates parse reliably.

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

ISO date (2026-01-31) or relative ("30 days", "6 months"). Without the details add-on, YouTube's relative date ("3 weeks ago") is used conservatively; with it, the exact publish date. On channels the listing stops paging once videos are older.

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

ISO date or relative ("1 year").

## `minViews` (type: `integer`):

0 = off.

## `maxViews` (type: `integer`):

0 = off. Useful to find small, emerging videos.

## `minDurationSec` (type: `integer`):

0 = off.

## `maxDurationSec` (type: `integer`):

0 = off.

## `includeShorts` (type: `boolean`):

Shorts from search shelves and the channel Shorts tab. Shorts in listings have no channel/duration/date unless the details add-on is on.

## `includeLive` (type: `boolean`):

Live streams, premieres and scheduled streams (channel Live tab included).

## `includeRegex` (type: `string`):

Keep only videos whose title, channel name or description (snippet, or full description with the details add-on) match. Case-insensitive.

## `excludeRegex` (type: `string`):

Drop videos matching this regex (same text as includeRegex).

## `excludeIds` (type: `array`):

Video ids or URLs to skip, e.g. those you already have from a previous run.

## `includeVideoDetails` (type: `boolean`):

Full description, tags/keywords, hashtags, like count, comment count, category, exact publish date, chapters, channel subscriber count and verified flag. Two extra requests per video; charged as video-details per video.

## `includeComments` (type: `boolean`):

Scrape comments of every returned video (charged per comment).

## `maxCommentsPerVideo` (type: `integer`):

Including replies.

## `commentsSort` (type: `string`):

Top comments (YouTube ranking, pinned first) or newest first.

## `includeReplies` (type: `boolean`):

Fetch reply threads (rows have parentId). Counted in maxCommentsPerVideo.

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

One channel row per channel: subscribers, total views, video count, country, joined date, description, external links, avatar, banner. Charged as channel-info per channel.

## `cacheHours` (type: `integer`):

Reuse listing pages, video details and channel info fetched within this many hours (named store youtube-scraper-cache in your account). 0 = always fresh, also disables the shared cache.

## `useSharedCache` (type: `boolean`):

Also read video details and channel info that any user of this actor fetched recently (public data only, never search listings or anything about you). Faster, fewer blocks.

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

Parallel requests. Lower it if you see blocked rows.

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

Apify datacenter proxy by default. Residential is your choice if YouTube blocks datacenter IPs.

## Actor input object example

```json
{
  "searchQueries": [
    "elektrokolo"
  ],
  "channelUrls": [],
  "videoUrls": [],
  "maxItems": 50,
  "maxItemsPerSource": 0,
  "sortBy": "relevance",
  "uploadDate": "any",
  "durationFilter": "any",
  "features": [],
  "country": "US",
  "minViews": 0,
  "maxViews": 0,
  "minDurationSec": 0,
  "maxDurationSec": 0,
  "includeShorts": true,
  "includeLive": true,
  "excludeIds": [],
  "includeVideoDetails": false,
  "includeComments": false,
  "maxCommentsPerVideo": 20,
  "commentsSort": "top",
  "includeReplies": false,
  "includeChannelInfo": false,
  "cacheHours": 24,
  "useSharedCache": true,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "searchQueries": [
        "elektrokolo"
    ],
    "channelUrls": [],
    "videoUrls": [],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("budoucnost-ai/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": ["elektrokolo"],
    "channelUrls": [],
    "videoUrls": [],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("budoucnost-ai/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": [
    "elektrokolo"
  ],
  "channelUrls": [],
  "videoUrls": [],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call budoucnost-ai/youtube-scraper --silent --output-dataset

```

## MCP server setup

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