# YouTube Scraper — Search, Channels, Shorts & Comments (`rp_openpro.ai/youtube-scraper-search-channels-comments`) Actor

Scrape YouTube without an API key: search results with filters, every video or Short of a channel, and comments with replies. Views, duration, channel, likes. $1.50/1,000.

- **URL**: https://apify.com/rp_openpro.ai/youtube-scraper-search-channels-comments.md
- **Developed by:** [Rémi Pelloux](https://apify.com/rp_openpro.ai) (community)
- **Categories:** Videos, Social media, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.05 / 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 — Search, Channels, Shorts & Comments (No API Key)

Scrape **YouTube** like an API, without a YouTube Data API key or quota. One actor covers the three things people need most:

- **YouTube search scraper** — results for any keyword with YouTube's own filters (videos, Shorts or channels; upload date; duration; sort by views).
- **YouTube channel scraper** — every video, **Short** or live stream of a channel, latest, most popular or oldest first.
- **YouTube comments scraper** — comments of any video or Short, top or newest first, with **replies**, likes and reply counts.

Fast HTTP scraping through the JSON API youtube.com itself uses — no browser, no login, no cookies. Built for **creator research, influencer discovery, competitor tracking, trend and keyword research, sentiment analysis and AI/LLM datasets**.

### What you get

**Videos and Shorts** (`type: "video"`)

| Field | Example |
|---|---|
| `title`, `videoId`, `url` | "Apify Tutorial For Beginners", `3rrpfW0bEdc`, watch or /shorts/ link |
| `channelName`, `channelId`, `channelUrl`, `channelVerified` | "Speak About Digital", `UCqD-…`, `https://www.youtube.com/@SpeakAboutDigital` |
| `views`, `viewsText` | 44508, "44,508 views" |
| `durationSeconds`, `durationText` | 641, "10:41" |
| `publishedText` | "3 years ago" |
| `thumbnail`, `description` (snippet), `badges` | |
| `isShort`, `isLive` | |
| `searchQuery` or `sourceChannel`, `position` | what was scraped and the rank |

With **Add a row with each video's details** (for the videos you list for comments): exact `views`, `publishedDate` ("Oct 24, 2009"), `channelSubscribersText` and the full `description`.

**Channels** (`type: "channel"`, from channel searches): `channelName`, `handle`, `subscribers`, `channelVerified`, `description`, `channelUrl`, `thumbnail`.

**Comments** (`type: "comment"`)

| Field | Example |
|---|---|
| `text`, `commentId`, `videoId` | |
| `author`, `authorChannelId`, `authorIsChannelOwner`, `authorVerified` | "@bdr8823" |
| `likes`, `likesText`, `replyCount` | 70000, "70K", 654 |
| `publishedText` | "7 years ago" |
| `heartedByCreator` | true if the creator hearted it |
| `isReply`, `parentId` | replies point to their parent comment |

```json
{
    "type": "video",
    "videoId": "3rrpfW0bEdc",
    "url": "https://www.youtube.com/watch?v=3rrpfW0bEdc",
    "title": "Apify Tutorial For Beginners | How To Use Apify",
    "channelName": "Speak About Digital",
    "channelUrl": "https://www.youtube.com/@SpeakAboutDigital",
    "views": 44508,
    "durationSeconds": 641,
    "durationText": "10:41",
    "publishedText": "3 years ago",
    "isShort": false,
    "searchQuery": "apify tutorial",
    "position": 1
}
```

Export to JSON, CSV, Excel or HTML, or use the Apify API, webhooks, Make, Zapier, n8n or Google Sheets.

### How to use

1. Add **search queries**, **channels** and/or **videos** (for comments). Mix them freely in one run.
2. Set the limits (`0` = everything YouTube returns) and filters.
3. Run. Results arrive at about 20 per request; a few hundred videos or comments take seconds.

#### Examples

Most-viewed Shorts about a topic this month:

```json
{
    "searchQueries": ["air fryer recipes"],
    "searchType": "shorts",
    "uploadDate": "month",
    "maxResultsPerQuery": 200
}
```

A creator's 100 most popular videos:

```json
{
    "channelUrls": ["https://www.youtube.com/@mkbhd"],
    "channelSort": "popular",
    "maxChannelVideos": 100
}
```

1,000 newest comments with replies, for sentiment analysis:

```json
{
    "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "maxCommentsPerVideo": 1000,
    "commentsSort": "newest",
    "includeReplies": true
}
```

Find channels in a niche (influencer discovery):

```json
{
    "searchQueries": ["vegan cooking"],
    "searchType": "channel",
    "maxResultsPerQuery": 100
}
```

### FAQ

**Do I need a YouTube API key?**
No, and there is no daily quota. The actor reads the same data youtube.com shows to visitors.

**Are view and like counts exact?**
Search and channel views are exact where YouTube shows them exactly ("44,508 views"); on channel tabs and Shorts YouTube only shows rounded numbers ("6M views"), which the actor converts to 6000000 and keeps the original text in `viewsText`. Comment likes are rounded the same way by YouTube ("70K"). The video-details row has the exact view count.

**Why is the publish date relative ("3 years ago")?**
That is what YouTube lists in search and on channel pages. The video-details row adds the exact date.

**Does it download videos or transcripts?**
No. It collects metadata and comments only.

**Do I need proxies?**
The default Apify Proxy is enough; if YouTube limits it, the actor switches to residential proxies by itself.

### Related actors

- [TikTok Ultimate Scraper](https://apify.com/rp_openpro.ai/tiktok-ultimate-scraper) — TikTok videos, profiles, hashtags and trends.
- [CapCut Trending Templates Scraper](https://apify.com/rp_openpro.ai/capcut-trending-scraper) — trending CapCut templates ranked by usage.
- [Contact Details Scraper](https://apify.com/rp_openpro.ai/contact-details-scraper) — emails and social links from creators' websites.

# Actor input Schema

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

What you would type in the YouTube search box. Each query returns videos (and Shorts/channels, depending on the type filter).

## `maxResultsPerQuery` (type: `integer`):

0 = as many as YouTube returns.

## `searchType` (type: `string`):

Same as the YouTube “Type” filter.

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

Same as the YouTube “Upload date” filter.

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

Same as the YouTube “Duration” filter.

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

Order of search results.

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

Channel links (https://www.youtube.com/@mkbhd, /channel/UC…, /c/…), @handles or UC… ids. Returns the channel’s videos, Shorts or live streams.

## `channelContent` (type: `string`):

Which channel tab to scrape.

## `channelSort` (type: `string`):

Same as the Latest / Popular / Oldest buttons on the channel page.

## `maxChannelVideos` (type: `integer`):

0 = all.

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

Video or Shorts links (watch?v=, youtu.be/, /shorts/) or 11-character video ids.

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

Top-level comments. 0 = all.

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

Same as YouTube’s “Sort by” on comments.

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

Also return replies under each comment (each reply is a row).

## `maxRepliesPerComment` (type: `integer`):

0 = all.

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

Exact view count, publish date, channel and full description of each video in the list above.

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

YouTube interface language (hl). Keep “en” for the most reliable number parsing.

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

YouTube region (gl), e.g. US, GB, FR, IN. Changes search ranking.

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

Apify Proxy (datacenter) is enough. If YouTube limits it, the actor switches to residential proxies by itself.

## Actor input object example

```json
{
  "searchQueries": [
    "apify tutorial"
  ],
  "maxResultsPerQuery": 50,
  "searchType": "all",
  "uploadDate": "any",
  "duration": "any",
  "sortBy": "relevance",
  "channelContent": "videos",
  "channelSort": "latest",
  "maxChannelVideos": 50,
  "maxCommentsPerVideo": 100,
  "commentsSort": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 10,
  "includeVideoDetails": true,
  "language": "en",
  "country": "US",
  "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": [
        "apify tutorial"
    ],
    "maxResultsPerQuery": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("rp_openpro.ai/youtube-scraper-search-channels-comments").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": ["apify tutorial"],
    "maxResultsPerQuery": 50,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("rp_openpro.ai/youtube-scraper-search-channels-comments").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": [
    "apify tutorial"
  ],
  "maxResultsPerQuery": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call rp_openpro.ai/youtube-scraper-search-channels-comments --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rp_openpro.ai/youtube-scraper-search-channels-comments"
        }
    }
}
```

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/VOBDeztf4u9i1rrO0/builds/1rnb8nU01nVFdVw4g/openapi.json
