# YouTube Data Scraper: Videos, Channels, Search & Comments (`logicbase_systems/youtube-data-scraper`) Actor

Scrape YouTube videos, channels, playlists and search results: title, description, views, likes, comment count, channel subscribers, tags, duration, publish date, Shorts and live flags. Optional comments. $2 per 1,000 videos, $1.50 per 1,000 comments; failures are free.

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

## Pricing

from $2.00 / 1,000 videos

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 Data Scraper: Videos, Channels, Search & Comments

Turn YouTube searches, channels, playlists and video links into one clean table: title, description, **views, likes, comment count, channel subscribers**, tags, category, duration, publish date, and flags for **Shorts** and live streams. Switch on **comments** to get the top or newest comments of every video as extra rows. Paste six search queries and press Start: **150 videos in 66 seconds** on our test run of 16 November 2026. **$0.002 per video** ($2 per 1,000) and **$0.0015 per comment** ($1.50 per 1,000). Videos that fail are never charged.

### Why choose this actor?

Stitching a video list from one tool, a comment export from another, and subscriber numbers from a third? Paying for a scraper that fails on one run in seven? Fighting with a quota-limited API key?

- **Searches, channels, playlists and single videos in one input.** Mix them freely; a video found twice is returned once. Search accepts YouTube's own filters (sort by relevance, date, views or rating; uploaded in the last hour, day, week, month or year; under 4, 4 to 20 or over 20 minutes; videos only, or videos plus Shorts). A channel can be read by its Videos, Shorts or past-live-streams tab.
- **The numbers people actually ask for sit on the same row.** In our runs of 16 November 2026 we fetched 855 different videos (searches, three channels, MrBeast's channel, Shorts, a playlist, live streams). Title, channel, channel id, handle and link, views, duration, publish date, category and thumbnail were filled on **100%** of them; description 98%, subscribers 99%, likes 99%, comment count 95%. The gaps are real: YouTube hides the subscriber count for some channels, hides likes on a few videos, shows no comment count on live streams, and some videos have no description or tags.
- **Comments are part of the same run, charged only when you switch them on.** Tick *Include comments*, set *Max comments per video* and the order (top or newest). We fetched 1,000 comments of one video in **29 seconds**, all 1,000 unique, and 100 top comments each for five videos at once (the sixth video had comments turned off and returned none). Comment rows carry author, text, likes, reply count, and flags for pinned and "hearted by the creator". A video with comments turned off returns no comment rows and costs nothing extra.
- **It held up at volume.** On 16 November 2026: **150/150** videos from six searches (25 each), **180/180** from three channels, **300/300** from MrBeast's channel, **61/61** from a mixed run of searches, channels, a playlist and Shorts, and **15/15** Shorts from a channel's Shorts tab. In a repeat of the six-search run at 512 MB, 1 video in 150 was refused by YouTube after several tries and came back as a free error row.
- **How it compares.** The most used YouTube scraper on the Store, [streamers/youtube-scraper](https://apify.com/streamers/youtube-scraper) (209,803 lifetime users, 17,977 in the last 30 days and a 4.06★ rating from 198 reviews as of 16 November 2026), is listed at $4.00 per 1,000 videos on the Free plan, and falls with higher plans (its Store card says from $2.40). Its listing sends you to a separate comments Actor, [streamers/youtube-comments-scraper](https://apify.com/streamers/youtube-comments-scraper), listed at $2.00 per 1,000 comments on the Free plan. [apidojo/youtube-scraper](https://apify.com/apidojo/youtube-scraper) is cheaper, at $0.50 per 1,000 videos, but its own listing shows 85.2% of runs succeeding over the last 30 days and a 3.29★ rating from 21 reviews. We are not the cheapest. We charge one flat price at every plan level and deliver videos, subscribers and comments in one run.

### Try your first run

Paste this input in the JSON tab, or keep the prefilled form and press Start. It searches YouTube for "python tutorial" and returns the five top results with full details. Searches of 15 videos took 9 and 11 seconds on our runs.

```json
{
  "searchQueries": ["python tutorial"],
  "maxResults": 5
}
```

Runs on the Apify Free plan: sign up, open the actor, press Start. Each video lands as one row, which you can open as a table, download as CSV, Excel or JSON, or read from the API. Five videos cost $0.01. Add `"includeComments": true` to get the comments as well.

### Copy to your AI assistant

Paste this block into Claude, ChatGPT or Cursor to give it the full picture of this scraper before you ask it to write code or plan a dataset:

```
You have access to the YouTube data scraper on Apify: logicbase_systems/youtube-data-scraper
It reads public YouTube pages (no login, no API key). Rows: type "video" (one per video), type "comment" (one per comment, only when includeComments is true) and type "error" (free).

Input (all optional; an empty run falls back to one sample video for Apify's daily test):
- searchQueries (array of strings): YouTube searches, one per entry. Example: ["python tutorial", "best budget laptop"]
- videoUrls (array of strings): watch, youtu.be, shorts, embed, live links or 11-character IDs.
- channelUrls (array of strings): https://www.youtube.com/@3blue1brown, /channel/UC..., or just "@3blue1brown". Newest first.
- playlistUrls (array of strings): playlist links (contain list=PL...).
- maxResults (integer, default 10, max 5000): videos taken from each search, channel or playlist.
- maxVideosTotal (integer, optional): hard cap across the whole run.
- searchSort ("relevance" | "date" | "views" | "rating", default "relevance"), uploadDate ("any" | "hour" | "today" | "week" | "month" | "year"), videoDuration ("any" | "short" under 4 min | "medium" 4-20 min | "long" over 20 min), searchContentType ("video" | "any" = videos and Shorts). These apply to searches only.
- channelTab ("videos" | "shorts" | "streams", default "videos"), channelSort ("newest" | "popular" = most viewed among the 500 newest videos).
- includeComments (boolean, default false), maxComments (integer, default 20, per video), commentSort ("top" | "newest", default "top").
- maxConcurrency (integer, default 5), proxyStrategy ("auto" | "residential" | "datacenter" | "none", default "auto").

Output, type "video": id, url, title, description, channelName, channelId, channelUrl, channelHandle, channelSubscribers (rounded by YouTube), channelSubscribersText, viewCount, likeCount, commentCount, commentCountText, commentCountIsExact, commentsDisabled, durationSeconds, duration, publishDate (ISO 8601), uploadDate, tags[], category, thumbnailUrl, thumbnails[], isShort, isLive, isLiveContent, isUpcoming, isFamilySafe, isUnlisted, liveStartedAt, liveEndedAt, source {type: "search"|"video"|"channel"|"playlist", url|query, rank}.
Output, type "comment": commentId, text, author, authorChannelId, authorChannelUrl, authorThumbnail, authorIsChannelOwner, authorIsVerified, likeCount (rounded above 1,000), likeCountText, likeCountIsExact, replyCount, isPinned, isHearted, isEdited, publishedTimeText ("3 days ago"), position, sort, videoId, videoUrl, videoTitle.
Output, type "error": id, url, source, error {code, message}. Codes: VIDEO_UNAVAILABLE, PRIVATE_VIDEO, AGE_RESTRICTED, MEMBERS_ONLY, INVALID_URL, SOURCE_NOT_FOUND, BLOCKED, RATE_LIMITED, NETWORK_ERROR, YOUTUBE_ERROR. Errors are never charged.
Absent values are null. Rows are written as videos finish, so use source.rank for input order. No transcripts, no replies to comments, no dislikes.

Use apify-client for Python or JavaScript: client.actor("logicbase_systems/youtube-data-scraper").call(run_input=...)
```

### How to scrape YouTube data

Each input below runs as it is.

#### Search YouTube and get stats for the top results

```json
{
  "searchQueries": ["iphone review"],
  "maxResults": 15,
  "searchSort": "date",
  "uploadDate": "week",
  "videoDuration": "medium"
}
```

Returns the 15 newest videos of the past week that are 4 to 20 minutes long. On our run of 16 November 2026 all 15 videos were from 9 to 15 November and between 342 and 1,169 seconds long. Add more queries to the list; each is searched separately.

#### Read a channel's latest videos, Shorts or streams

```json
{
  "channelUrls": ["@Fireship", "https://www.youtube.com/@3blue1brown"],
  "maxResults": 20,
  "channelTab": "videos"
}
```

`@handle`, `/@handle` links and `/channel/UC...` links all work. Set `channelTab` to `"shorts"` or `"streams"`. On 16 November 2026 the Shorts tab of MrBeast returned 15 of 15 videos, all flagged `isShort: true`. Set `"channelSort": "popular"` to get the most viewed videos among the channel's 500 newest.

#### Get the comments of videos

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://youtu.be/dQw4w9WgXcQ"
  ],
  "includeComments": true,
  "maxComments": 100,
  "commentSort": "top"
}
```

Each video row is followed by up to 100 comment rows, tagged `type: "comment"` and carrying `videoId`, so you can join them. With comments switched on, `commentCount` on the video row is the exact number YouTube shows (9,537 for the 3Blue1Brown video on 16 November 2026). Without comments it is the rounded number YouTube prints (for example 9.5K).

#### Check a list of videos

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://www.youtube.com/shorts/sHpEqeSByPI",
    "dQw4w9WgXcQ"
  ]
}
```

Watch links, `youtu.be` links, Shorts, embed and live links and bare 11-character IDs all work. A made-up ID or a deleted video comes back as a free `type: "error"` row.

### Input parameters

| Field | Type | Default | What it does |
|---|---|---|---|
| `searchQueries` | array of strings | none | YouTube searches, one per line. |
| `videoUrls` | array of strings | none (form prefills one sample video) | Video links or 11-character IDs. |
| `channelUrls` | array of strings | none | Channel links or `@handles`. |
| `playlistUrls` | array of strings | none | Playlist links. |
| `maxResults` | integer | 10 | Videos per search, channel or playlist (1 to 5,000). |
| `maxVideosTotal` | integer | none | Hard cap on videos for the whole run. |
| `searchSort` | string | `relevance` | `relevance`, `date`, `views` or `rating`. |
| `uploadDate` | string | `any` | `hour`, `today`, `week`, `month`, `year`. |
| `videoDuration` | string | `any` | `short` (under 4 min), `medium` (4 to 20 min), `long` (over 20 min). |
| `searchContentType` | string | `video` | `video` or `any` (videos and Shorts mixed, as YouTube shows them). |
| `channelTab` | string | `videos` | `videos`, `shorts` or `streams`. |
| `channelSort` | string | `newest` | `newest`, or `popular` (most viewed of the 500 newest). |
| `includeComments` | boolean | false | Also return comments as extra rows. Charged per comment. |
| `maxComments` | integer | 20 | Top-level comments per video. |
| `commentSort` | string | `top` | `top` or `newest`. |
| `maxConcurrency` | integer | 5 | Videos fetched at the same time. |
| `proxyStrategy` | string | `auto` | `auto` (recommended), `residential`, `datacenter` or `none`. |

No field is required. If every list is left empty (for example Apify's daily automatic test), the actor runs one sample video so the run succeeds. The form's prefilled video is only a prefill; the API never adds it to your input.

### Output fields

Three row types share one dataset. Filter on `type`: `video`, `comment` or `error`. The dataset has four ready-made views (videos overview, channels, comments, descriptions and tags).

**Video rows**

| Field | Description |
|---|---|
| `id`, `url` | The video. |
| `title`, `description` | As shown on YouTube. |
| `channelName`, `channelId`, `channelUrl`, `channelHandle` | The channel. |
| `channelSubscribers`, `channelSubscribersText` | Subscribers. YouTube rounds this (8.76M becomes 8760000), and some channels hide it (`null`). |
| `viewCount`, `likeCount` | Exact numbers at run time. `likeCount` is `null` when the video hides likes. |
| `commentCount`, `commentCountText`, `commentCountIsExact` | Exact when comments were fetched, otherwise YouTube's rounded figure (below 1,000 it is exact). `null` on live streams and when comments are off. |
| `commentsDisabled` | `true` when the video has comments turned off, `false` when comments were fetched, `null` when unknown. |
| `durationSeconds`, `duration` | Length (`0` for a stream that is live now). |
| `publishDate`, `uploadDate` | ISO 8601 date and time. |
| `tags`, `category`, `thumbnailUrl`, `thumbnails` | Tags can be empty: many videos have none. |
| `isShort` | `true` when YouTube treats the video as a Short (vertical, up to 3 minutes). |
| `isLive`, `isLiveContent`, `isUpcoming`, `liveStartedAt`, `liveEndedAt` | Live stream flags and times. |
| `isFamilySafe`, `isUnlisted` | As reported by YouTube. |
| `source` | `{type, url or query, rank}`: which input found it and at what position. |

**Comment rows**

| Field | Description |
|---|---|
| `commentId`, `text`, `position`, `sort` | The comment, its position in the fetch, and the order used. |
| `author`, `authorChannelId`, `authorChannelUrl`, `authorThumbnail`, `authorIsChannelOwner`, `authorIsVerified` | Who wrote it. |
| `likeCount`, `likeCountText`, `likeCountIsExact` | YouTube rounds likes above 1,000 (1.8K becomes 1800). |
| `replyCount` | Number of replies. The replies themselves are not returned. |
| `isPinned`, `isHearted`, `isEdited` | Pinned by the creator, hearted by the creator, edited. |
| `publishedTimeText` | YouTube's relative time ("3 days ago"). It gives no exact timestamp. |
| `videoId`, `videoUrl`, `videoTitle` | The video the comment belongs to. |

### Good to know

- **Public data only, no login.** Age-restricted, private and members-only videos come back as free error rows.
- **No transcripts, no replies, no dislikes.** For transcripts use [YouTube Transcript Scraper](https://apify.com/logicbase_systems/youtube-transcript). Reply counts are included, reply text is not.
- **Some numbers are rounded by YouTube itself**: channel subscribers, the comment count when comments are not fetched, and comment likes above 1,000. Each has a text field and an `...IsExact` flag so you can tell.
- **Results are written as videos finish**, not in input order. Use `source.rank` to restore the order.
- **English text, US view.** The actor asks YouTube for English pages as seen from the United States, so search results and relative times ("3 days ago") are in English.
- **Proxies.** YouTube's bot check often blocks Apify's data-center proxy (in a 300-video run, 8.2 MB of the 9.0 MB ended up on the residential proxy), so `auto` retries blocked requests on a residential proxy. You never pay for proxy traffic yourself.
- **Popular channel order** is the most viewed among the channel's 500 newest videos, not all-time.
- YouTube changes its pages from time to time. If a run starts failing broadly, please report it in the Issues tab with a run link.
- Check that your use of the data complies with YouTube's terms. This actor only reads public information.

### Example output

From our run of 16 November 2026 on `https://www.youtube.com/watch?v=aircAruvnKk` with comments on (description shortened):

```json
{
  "type": "video",
  "id": "aircAruvnKk",
  "url": "https://www.youtube.com/watch?v=aircAruvnKk",
  "title": "But what is a neural network? | Deep learning chapter 1",
  "description": "What are the neurons, why are there layers, and what is the math underlying it?\nHelp fund future projects: https://www.patreon.com/3blue1brown\n…",
  "channelName": "3Blue1Brown",
  "channelId": "UCYO_jab_esuFRV4b17AJtAw",
  "channelUrl": "https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw",
  "channelHandle": "@3blue1brown",
  "channelSubscribers": 8760000,
  "channelSubscribersText": "8.76M subscribers",
  "viewCount": 25280925,
  "likeCount": 570634,
  "commentCount": 9537,
  "commentCountText": "9,537",
  "commentCountIsExact": true,
  "commentsDisabled": false,
  "durationSeconds": 1120,
  "duration": "18:40",
  "publishDate": "2017-10-05T08:11:25-07:00",
  "tags": [],
  "category": "Education",
  "thumbnailUrl": "https://i.ytimg.com/vi/aircAruvnKk/maxresdefault.jpg",
  "isShort": false,
  "isLive": false,
  "isUpcoming": false,
  "source": { "type": "video", "url": "aircAruvnKk" },
  "error": null
}
```

And the first comment row of the same run (text shortened):

```json
{
  "type": "comment",
  "commentId": "Ugwedfi--9yZVC0eefl4AaABAg",
  "text": "I study mathematics, physics and architecture. By definition this man is an ORACLE in the strict meaning of the word. …",
  "author": "@kummer45",
  "authorChannelId": "UCqArZkt3NAOU0tcgIi6xmFQ",
  "authorIsChannelOwner": false,
  "likeCount": 14000,
  "likeCountText": "14K",
  "likeCountIsExact": false,
  "replyCount": 175,
  "isPinned": false,
  "isHearted": false,
  "isEdited": true,
  "publishedTimeText": "7 years ago",
  "position": 1,
  "sort": "top",
  "videoId": "aircAruvnKk",
  "videoUrl": "https://www.youtube.com/watch?v=aircAruvnKk",
  "videoTitle": "But what is a neural network? | Deep learning chapter 1"
}
```

### Advanced usage

#### Track a competitor's channel every morning

```json
{
  "channelUrls": ["@Fireship"],
  "maxResults": 10,
  "channelTab": "videos"
}
```

Schedule this input daily from the actor's Schedules tab. Compare two runs on `id` to see new videos, and compare `viewCount` and `likeCount` over time to see which ones are taking off.

#### Find what is working on a topic

```json
{
  "searchQueries": ["how to learn guitar", "react tutorial"],
  "maxResults": 25,
  "searchSort": "views",
  "uploadDate": "year"
}
```

Sort by views within the past year and read `title`, `tags`, `channelSubscribers` and `viewCount` side by side. Videos with many views from small channels are the ones worth studying.

#### Pull the data from Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("logicbase_systems/youtube-data-scraper").call(run_input={
    "searchQueries": ["python tutorial"],
    "maxResults": 5,
    "includeComments": True,
    "maxComments": 10,
})
for row in client.dataset(run.default_dataset_id).iterate_items():
    if row["type"] == "video":
        print(row["title"], row["viewCount"], row["likeCount"], row["commentCount"])
    elif row["type"] == "comment":
        print("   ", row["author"], row["text"][:60])
```

The same actor works from the JavaScript client, the REST API, n8n, Make, Zapier, and the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) (for example `https://mcp.apify.com?tools=logicbase_systems/youtube-data-scraper`).

### Pricing

**Pay per event: $0.002 per video returned ($2 per 1,000) and $0.0015 per comment returned ($1.50 per 1,000).** There is also Apify's standard Actor-start event of $0.00005 per run.

- Videos that fail or do not exist, and every error row, are **not charged**.
- Comments are only fetched, and only charged, when *Include comments* is on. A video with comments off adds nothing.
- The price is the same on every Apify plan.
- Proxy and compute costs are included in the price. You never pay for proxy traffic yourself.
- To cap spending, set a maximum cost per run in the run options, or use *Max videos in total*. The actor stops when the limit is reached; on our test with a $0.05 cap it stopped at 1 video and 31 comments.

### FAQ

**Do I need a YouTube API key?**
No. The actor reads public YouTube pages and has no quota.

**Can I scrape a whole channel?**
Yes. Add the channel and set *Max videos per query, channel or playlist* (up to 5,000). Choose Videos, Shorts or Past live streams.

**Can I filter search results by date or length?**
Yes: sort by relevance, date, views or rating; uploaded in the last hour, day, week, month or year; under 4, 4 to 20 or over 20 minutes. Videos only, or videos plus Shorts.

**How many comments can I get per video?**
Set *Max comments per video* as high as you like. We fetched 1,000 from one video in 29 seconds. Only top-level comments are returned; replies are not.

**Are the comment, like and subscriber numbers exact?**
View counts and video likes are exact. Subscribers and comment likes above 1,000 are rounded by YouTube; the comment count is exact when comments are fetched. Every rounded number has a text field and an `...IsExact` flag.

**Why do some videos have a null comment count?**
Live streams and videos with comments turned off have none. Those rows also set `commentsDisabled` when we could tell.

**Does it work with Shorts?**
Yes. Shorts links work like normal video links, a channel's Shorts tab is supported, and `isShort` tells them apart.

**Can it return transcripts?**
No. Use [YouTube Transcript Scraper](https://apify.com/logicbase_systems/youtube-transcript) for captions and subtitles.

**Why did a video return an error row?**
Check `error.code` and `error.message`. Error rows are free. `BLOCKED`, `RATE_LIMITED` or `NETWORK_ERROR` after several retries usually means YouTube refused the request; run those videos again later or lower *Parallel videos*.

**How do I try it for a fraction of a cent?**
Press *Try for free* on this page. New Apify accounts include free monthly platform credit; a first run on five videos costs $0.01.

**Is scraping YouTube allowed?**
The actor only reads public information without logging in. You are responsible for using the data in line with YouTube's terms, the rights of the videos' owners and your local law.

**It stopped working. What now?**
Open an issue on this actor's page with a run link. We monitor runs daily.

### More Logicbase Systems scrapers

- [YouTube Transcript Scraper](https://apify.com/logicbase_systems/youtube-transcript): transcripts and subtitles for videos, playlists and channels, with title, channel, date and views. Pair it with this actor: find videos here, then pull their transcripts there.
- [Google Trends Scraper](https://apify.com/logicbase_systems/google-trends): interest over time, related queries, regions, comparisons and trending now. Check whether a topic is growing before you pick which YouTube videos to study.

# Actor input Schema

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

What to search for on YouTube, one per line. Each query returns up to 'Max videos per query, channel or playlist' results.

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

YouTube video links (watch, youtu.be, shorts, embed, live) or 11-character video IDs. One per line.

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

Channel links such as https://www.youtube.com/@3blue1brown, /channel/UC... , or just @3blue1brown. Newest videos first.

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

YouTube playlist links (contain list=PL...).

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

How many videos to take from each search, channel or playlist. Set a low number to control cost.

## `maxVideosTotal` (type: `integer`):

Hard cap on videos for the whole run, across all inputs. Leave empty for no cap.

## `searchSort` (type: `string`):

How YouTube orders search results.

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

Only videos uploaded within this period.

## `videoDuration` (type: `string`):

Only videos of this length.

## `searchContentType` (type: `string`):

Videos only (default), or videos plus Shorts the way YouTube mixes them.

## `channelTab` (type: `string`):

Which part of a channel to read.

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

Newest first, or the most viewed among the channel's 500 newest videos.

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

Also return the comments of every video as extra rows (type = comment). Comments are charged separately, per comment returned. Off by default.

## `maxComments` (type: `integer`):

Top-level comments to return per video (only used when 'Include comments' is on).

## `commentSort` (type: `string`):

YouTube's 'Top comments' ranking, or the newest comments first.

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

How many videos to fetch at the same time. Lower it if you see many rate-limit retries.

## `proxyStrategy` (type: `string`):

Auto (recommended) tries cheap Apify data-center proxy first and switches to residential proxy when YouTube blocks it. Residential is the most reliable. None only works from a home IP, not on Apify.

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

Advanced: your own proxy URLs. Only used when you enter custom proxy URLs, otherwise the strategy above applies.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk"
  ],
  "maxResults": 10,
  "searchSort": "relevance",
  "uploadDate": "any",
  "videoDuration": "any",
  "searchContentType": "video",
  "channelTab": "videos",
  "channelSort": "newest",
  "includeComments": false,
  "maxComments": 20,
  "commentSort": "top",
  "maxConcurrency": 5,
  "proxyStrategy": "auto"
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=aircAruvnKk"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("logicbase_systems/youtube-data-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 = { "videoUrls": ["https://www.youtube.com/watch?v=aircAruvnKk"] }

# Run the Actor and wait for it to finish
run = client.actor("logicbase_systems/youtube-data-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 '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk"
  ]
}' |
apify call logicbase_systems/youtube-data-scraper --silent --output-dataset

```

## MCP server setup

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