# YouTube Comments & Video Scraper (`dataji/youtube-comments-scraper`) Actor

Scrape YouTube comments and replies plus video details (views, likes, exact comment count, channel, subscribers) from video links, channels or searches, without logging in. Sort by top or newest, collect only new comments on repeat runs. You only pay for rows delivered; failed videos are free.

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

## Pricing

from $0.30 / 1,000 comments

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 Comments & Video Scraper

Scrape **YouTube comments and replies, plus the video's details**, with no login and no YouTube account. Paste video links, channel links, playlist links or search terms and get clean rows: every comment with its author, likes, reply count, pinned and hearted flags, and one row per video with views, likes, the **exact comment count**, publish date, hashtags and the channel's subscribers.

**You only pay for rows that are delivered.** Videos that don't exist, have comments turned off or could not be loaded come back as error rows that cost nothing, and so do comments you filter out.

> **What YouTube doesn't show, this actor can't give you:** comments have **no exact date** (only "3 weeks ago", so you get an approximate date and its precision), there are **no dislike counts**, and **transcripts or subtitles** are not collected. See the [FAQ](#faq).

### What can this YouTube comments scraper do?

- 💬 Get **comments** from any public video: text, author handle and channel, avatar, likes, reply count, time posted
- ↩️ Get **replies** under each comment (optional), linked to their parent comment
- 📌 See which comment is **pinned**, which ones the creator **hearted** or **replied to**, which were **edited** and which were written by the **channel owner**
- 🔗 Get the **links** and the **video timestamps** (`12:34` → 754 seconds) mentioned in each comment
- 🔃 Read comments in YouTube's **Top** order or **Newest first**
- 📅 **Only comments newer than** a date or a period (`2026-11-01`, `7 days`, `3 months`): older comments are skipped and not charged
- 🔍 **Filter before you pay**: only comments containing your keywords, without spam words, with a minimum of likes, in the languages you want, or one per author. Filtered comments are free
- 🌐 **Comment language** on every comment (detected offline, a best guess for very short comments)
- 📊 **Coverage on every video row**: how many comments and replies were delivered, how many were filtered, what share of YouTube's comment count was read, and why reading stopped (`maxReached`, `endOfComments`, ...)
- 🆕 **Only new comments** on repeat runs: comments already delivered in earlier runs are skipped and not charged, ideal for scheduled monitoring
- 🎬 Get **video details**: title, description, views, exact likes (`20,039`, not `20K`), exact comment count, publish date, hashtags, **chapters**, live-now flag and thumbnail. Need only the stats? Set **Max comments per video** to `0` (see [Video stats only](#video-stats-only))
- 📺 Get **channel details** with each video: name, @handle, link, verified badge and subscriber count
- 🔎 Start from **videos, playlists, channels** (newest videos from the **Videos, Shorts and Live** tabs) **or YouTube searches**. Paste links as you copied them: share links with `?si=...`, mobile (`m.youtube.com`), YouTube Music, embed and `youtu.be` links all work, and plain text becomes a search
- 🆓 **Failed videos are free**: not found, comments off, age-restricted and blocked videos return a free error row with the reason
- 📦 Export to **JSON, CSV, Excel, XML or HTML**, or pull the data through the Apify API

### Why use this scraper?

- **Fair billing.** One `comment` event per comment or reply delivered and one `video` event per video row. Error rows are free, duplicates are removed (a video given as a link and found again in a search is read once), and comments skipped by "Only new comments", by the date filter or by any comment filter are free.
- **You can see what you got.** Each video row says how many comments were delivered out of YouTube's count and why reading stopped, and the run's status says it for the whole run: `8 videos: 4,210 of 5,030 shown comments (84%); 2 hit Max comments`.
- **Comments and video stats in one run.** No second actor needed to get the views, likes and comment count of the videos you scrape.
- **Every column, every time.** Video, comment and error rows share one layout with `null` for what doesn't apply, so CSV and Excel exports always line up. The `recordType` column tells the rows apart, and the author is also in flat columns (`authorHandle`, `authorName`, `authorChannelId`).
- **Gentle and reliable.** Low default concurrency, pauses between requests, a fresh proxy IP for retries, and a run that stops cleanly at your spending limit.

### How to scrape YouTube comments

1. Click **Try for free**.
2. Paste one or more **video links** (or channel links), or type **search queries**.
3. Set how many comments per video you want, the sort order, and whether to include replies.
4. Click **Start** and download your data when the run finishes.

### Input

| Field | Description |
|---|---|
| **Videos, channels and playlists** | Video links (`watch?v=`, `youtu.be/`, `/shorts/`, `/live/`, `/embed/`, also from `m.youtube.com`, `music.youtube.com` and `youtube-nocookie.com`) or bare 11-character video ids; channel links (`/@handle`, `/channel/UC...`, `/c/...`, `/user/...`) or a bare `@handle`; playlist links (`/playlist?list=...`); or a search results link. Tracking parameters (`si`, `feature`, `pp`, `t`, ...) are ignored. Plain text that is not a link is searched on YouTube (the log says so). You can also upload a text or CSV file with one link per line. |
| **Search queries** | Texts to search on YouTube; the top video results are read. |
| **Channel tabs** | Which channel tabs to read: `videos`, `shorts`, `streams` (the Live tab). Default `videos`. |
| **Max videos per channel** | Newest videos to read from each chosen channel tab. Default 10. |
| **Max videos per search** | Video results to read per search. Default 10. |
| **Max videos per playlist** | Videos to read from each playlist, in its order. Default 50. |
| **Max comments per video** | Top-level comments to read per video. Default 100. `0` = video rows only. Filtered comments count toward it. |
| **Sort comments by** | `top` (YouTube's default: pinned comment first, then the most engaging) or `newest`. |
| **Include replies** / **Max replies per comment** | Off by default. When on, up to 20 replies (default) are read under each comment. |
| **Only comments newer than** | Optional filter. A date (`2026-11-01`, UTC) or a period before the run started (`7 days`, `2 weeks`, `3 months`; a month counts as 30 days). Older comments and replies are skipped free. Works best with **Newest first**, see below. |
| **Only comments containing** | Optional filter. Keep comments that contain any of these words or phrases (not case-sensitive; `price` also matches `prices`). |
| **Skip comments containing** | Optional filter. Drop comments that contain any of these words or phrases. |
| **Minimum likes** | Optional filter. Keep comments with at least this many likes. Default 0 (no minimum). |
| **Comment languages** | Optional filter. Keep comments detected as these languages (`en`, `es`, `pt`, `hi`, ...). |
| **One comment per author** | Optional filter. Per video, only the first comment or reply of each author. |
| **Include video details** | On by default: one video row per video. |
| **Only new comments** | Off by default. Skips comments delivered for the same video in your earlier runs. |
| **Max concurrency** | Videos read at the same time. Default 3. |
| **Proxy configuration** | Apify Proxy (datacenter) by default. Switch to residential if many videos come back `blocked`; it costs you nothing extra (see [Pricing](#pricing)). |

Example input:

```json
{
  "startUrls": [
    { "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" },
    { "url": "https://www.youtube.com/@LinusTechTips" }
  ],
  "searchQueries": ["mechanical keyboard review"],
  "maxVideosPerChannel": 5,
  "maxVideosPerSearch": 5,
  "maxCommentsPerVideo": 200,
  "commentsSort": "newest",
  "includeReplies": true,
  "maxRepliesPerComment": 10
}
```

Monitoring a few videos every day, paying only for new comments (see [Monitoring videos on a schedule](#monitoring-videos-on-a-schedule)):

```json
{
  "startUrls": [{ "url": "https://www.youtube.com/watch?v=-5rtUVyxH5w" }],
  "maxCommentsPerVideo": 300,
  "commentsSort": "newest",
  "onlyNewComments": true
}
```

Last week's comments on a channel's 10 newest videos:

```json
{
  "startUrls": [{ "url": "https://www.youtube.com/@LinusTechTips" }],
  "maxVideosPerChannel": 10,
  "maxCommentsPerVideo": 5000,
  "commentsSort": "newest",
  "commentsNewerThan": "7 days"
}
```

Brand mentions with some traction, in English or Spanish, one per person, from a list of review videos:

```json
{
  "startUrls": [
    { "url": "https://youtu.be/dQw4w9WgXcQ?si=Ab12Cd34" },
    { "url": "https://www.youtube.com/watch?v=-5rtUVyxH5w" }
  ],
  "maxCommentsPerVideo": 2000,
  "commentsSort": "newest",
  "commentKeywords": ["secretlab", "office chair"],
  "excludeKeywords": ["giveaway"],
  "minLikes": 2,
  "commentLanguages": ["en", "es"],
  "oneCommentPerAuthor": true
}
```

#### Comment filters

Filters are checked before a row is delivered, so you **don't pay for filtered comments**. Each video row counts them in `commentsSkippedByFilters`.

- **They apply to replies too**, and replies are read only under comments that pass (a reply under a filtered comment is not looked for).
- **They count toward Max comments per video.** That number is how many top-level comments are read per video, filtered or not, so a filter never makes the actor page through a huge video without end. If a filter keeps only a few comments, raise **Max comments per video**; you still pay only for the comments delivered.
- **Keywords** match anywhere in the text, whatever the case (`price` also matches `Prices`), in any language or script.
- **Languages** come from an offline detector (the `commentLanguage` column). It is reliable for a sentence and a best guess for one or two words; comments with no words (only emoji or a link) have no language and are skipped by this filter.
- **One comment per author** keeps the first comment or reply each author wrote on the video, in the order they were read.

#### Only comments newer than a date

YouTube shows comment times only as "3 weeks ago", so the actor works out an approximate date (`publishedAtApprox`) and keeps a comment when that date is on or after your cutoff. A period such as `7 days` counts back from when the run started, and stays the same if the run is restarted.

- **With Newest first (recommended)** the actor reads from the newest comment down and stops a video after a full page (20) of older comments in a row (`stopReason: dateCutoff`). That page is a safety margin for the approximate times; its comments are skipped and not charged. You can set a high **Max comments per video** and only the comments in your range are read, so this is the efficient way to get recent comments.
- **With Top comments** YouTube's order is not by date, so the actor can't stop early: it reads up to **Max comments per video** comments and keeps the newer ones. Older comments are free, but they still count toward that maximum, so you may get fewer comments than with Newest first.
- **Replies** are filtered the same way, and are read only under comments inside the range (a new reply to an old comment is not looked for).

Every comment on a course playlist, and the newest Shorts of a channel:

```json
{
  "startUrls": [
    { "url": "https://www.youtube.com/playlist?list=PLxxxxxxxxxxxxxxxxxxxxxxxx" },
    { "url": "https://www.youtube.com/@LinusTechTips" }
  ],
  "channelTabs": ["shorts"],
  "maxVideosPerChannel": 20,
  "maxVideosPerPlaylist": 200,
  "maxCommentsPerVideo": 1000,
  "commentsSort": "newest"
}
```

### Monitoring videos on a schedule

To get each new comment once, as it appears:

1. Create a **task** with your videos (or a channel), **Sort comments by: Newest first**, **Only new comments: on**, and **Max comments per video** set to more than the new comments you expect between runs (for example 500).
2. Add a **schedule** to the task (for example every hour) in Apify Console → Schedules.
3. Add a **webhook** or an integration to the task (Slack, Google Sheets, Zapier, Make, or your own URL on "Run succeeded"), so new comments go where you work.

```json
{
  "startUrls": [{ "url": "https://www.youtube.com/@LinusTechTips" }],
  "maxVideosPerChannel": 5,
  "maxCommentsPerVideo": 500,
  "commentsSort": "newest",
  "onlyNewComments": true,
  "includeReplies": true
}
```

Each run delivers only comments it hasn't delivered before (they are free to skip) plus a fresh video row with the latest views, likes and comment count. Every comment's `firstSeenAt` is the run that first saw it, so with an hourly schedule you know **within the hour** when a comment appeared, which is closer than YouTube's "3 days ago". Add **Only comments newer than: 2 days** to keep each run short on busy videos.

### Video stats only

Set **Max comments per video** to `0` and the actor becomes a fast **YouTube video stats scraper**: one row per video with views, likes, comment count, publish date, hashtags, description and the channel with its subscribers, and nothing else. It needs one request per video, so thousands of videos take minutes, and you pay only the `video` event. Useful for tracking a channel's latest uploads, comparing videos in a search, or checking a campaign's numbers every day.

```json
{
  "startUrls": [{ "url": "https://www.youtube.com/@LinusTechTips" }],
  "searchQueries": ["mechanical keyboard review"],
  "maxVideosPerChannel": 50,
  "maxVideosPerSearch": 50,
  "maxCommentsPerVideo": 0
}
```

In this mode `commentCount` is YouTube's rounded figure (`1.7K` → 1700). When comments are read, it is the exact count. The coverage columns are `null`, since no comments were read (on a video with comments turned off, `stopReason` is `commentsDisabled`).

### Output example

A video row (description and chapters shortened). It comes **after** the video's comments, so it can say how reading went:

```json
{
  "recordType": "video",
  "input": "https://www.youtube.com/watch?v=-5rtUVyxH5w",
  "videoId": "-5rtUVyxH5w",
  "videoUrl": "https://www.youtube.com/watch?v=-5rtUVyxH5w",
  "videoTitle": "Tesla “Hater” Uses Full Self-Driving for a Month",
  "description": "Upgrade your setup with Secretlab’s Black Friday & Cyber Monday Sale, ...",
  "publishedDateText": "Nov 16, 2026",
  "publishedDate": "2026-11-16",
  "viewCount": 1156637,
  "likeCount": 20039,
  "commentCount": 1732,
  "commentsDelivered": 100,
  "repliesDelivered": 0,
  "commentsSkippedByFilters": 0,
  "coveragePct": 5.8,
  "stopReason": "maxReached",
  "channelId": "UCXuqSBlHAE6Xw-yeJA0Tunw",
  "channelName": "Linus Tech Tips",
  "channelHandle": "@LinusTechTips",
  "channelUrl": "https://www.youtube.com/@LinusTechTips",
  "channelSubscribersText": "16.9M subscribers",
  "channelSubscribers": 16900000,
  "channelVerified": true,
  "hashtags": [],
  "chapters": [{ "title": "Intro", "startSeconds": 0 }, { "title": "Tesla Take the Wheel", "startSeconds": 116 }],
  "isShort": null,
  "isLiveNow": false,
  "thumbnailUrl": "https://i.ytimg.com/vi/-5rtUVyxH5w/hqdefault.jpg",
  "scrapedAt": "2026-11-18T07:30:00+00:00"
}
```

A comment row (the channel's own pinned comment):

```json
{
  "recordType": "comment",
  "input": "https://www.youtube.com/watch?v=-5rtUVyxH5w",
  "videoId": "-5rtUVyxH5w",
  "videoUrl": "https://www.youtube.com/watch?v=-5rtUVyxH5w",
  "videoTitle": "Tesla “Hater” Uses Full Self-Driving for a Month",
  "commentId": "Ugwp-Iqf3CyQu3slV2B4AaABAg",
  "commentUrl": "https://www.youtube.com/watch?v=-5rtUVyxH5w&lc=Ugwp-Iqf3CyQu3slV2B4AaABAg",
  "text": "Upgrade your setup with Secretlab’s Black Friday & Cyber Monday Sale, running November 12 to December 4! ...",
  "commentLanguage": "en",
  "publishedTimeText": "1 day ago",
  "publishedAtApprox": "2026-11-17",
  "publishedAtPrecision": "day",
  "firstSeenAt": "2026-11-18T07:30:00+00:00",
  "likeCount": 48,
  "replyCount": 8,
  "repliesDelivered": 0,
  "isReply": false,
  "parentCommentId": null,
  "isPinned": true,
  "isHearted": false,
  "isEdited": false,
  "hasCreatorReply": false,
  "links": ["https://www.dpbolvw.net/click-101929796-17295612?sid=ltt-pr2-26"],
  "videoTimestamps": [],
  "authorChannelId": "UCXuqSBlHAE6Xw-yeJA0Tunw",
  "authorHandle": "@LinusTechTips",
  "authorName": "@LinusTechTips",
  "author": {
    "channelId": "UCXuqSBlHAE6Xw-yeJA0Tunw",
    "handle": "@LinusTechTips",
    "displayName": "@LinusTechTips",
    "avatarUrl": "https://yt3.ggpht.com/...=s88-c-k-c0x00ffffff-no-rj",
    "isVerified": true,
    "isChannelOwner": true
  },
  "scrapedAt": "2026-11-18T07:30:00+00:00"
}
```

A reply has `"isReply": true` and its parent's id in `parentCommentId`, and comes right after its parent. An error row (free):

```json
{
  "recordType": "error",
  "input": "https://youtu.be/e_04ZrNroTo",
  "videoId": "e_04ZrNroTo",
  "videoUrl": "https://www.youtube.com/watch?v=e_04ZrNroTo",
  "videoTitle": "Wheels on the Bus | @CoComelon Nursery Rhymes & Kids Songs",
  "error": "commentsDisabled",
  "errorMessage": "YouTube says: Comments are turned off.",
  "scrapedAt": "2026-11-18T07:30:00+00:00"
}
```

Every row has every field; fields that don't apply to the row type are `null` (left out above to keep the examples short).

### Output fields

| Field | Rows | Description |
|---|---|---|
| `recordType` | all | `video`, `comment` or `error` |
| `input` | all | The link, @handle or search text the row came from |
| `videoId`, `videoUrl`, `videoTitle` | all | The video |
| `description`, `hashtags` | video | Description text and its hashtags (also those shown above the title) |
| `chapters` | video | The video's chapters: `[{"title": "Intro", "startSeconds": 0}, ...]`, empty when it has none |
| `publishedDateText`, `publishedDate` | video | As shown (`Premiered Jun 26, 2026`) and as an ISO date |
| `viewCount`, `likeCount` | video | Exact numbers. `viewCount` is `null` while a stream is live (YouTube shows viewers instead) |
| `commentCount` | video | Exact count when comments are read; YouTube's rounded figure (`1.7K` → 1700) when `maxCommentsPerVideo` is 0. YouTube counts replies in it |
| `commentsDelivered`, `repliesDelivered` | video | Comment and reply rows this run delivered for the video |
| `commentsSkippedByFilters` | video | Comments and replies read but not delivered because of a filter (date, keywords, likes, language, one per author). Free |
| `coveragePct` | video | Comments read (delivered, filtered, or skipped as seen in earlier runs) as a percentage of `commentCount`. `null` when comments were not read |
| `stopReason` | video | Why reading stopped: `maxReached` (Max comments per video), `endOfComments` (YouTube's list ended), `dateCutoff` (reached "Only comments newer than", Newest order), `topSortExhausted` (the Top list ended before its comments and the replies they show added up to YouTube's count; see the FAQ), `commentsDisabled`, `blocked` (an error row explains), `spendingLimit`. `null` when comments were not read |
| `channelId`, `channelName`, `channelHandle`, `channelUrl`, `channelVerified` | video | The channel |
| `channelSubscribersText`, `channelSubscribers` | video | As shown (`16.9M subscribers`) and as a number (YouTube rounds it) |
| `isShort` | video | `true` for `/shorts/` links and Shorts in search results, `false` for videos from a channel's Videos or Live tab or a regular search hit, `null` when not known (a plain watch link or a playlist entry) |
| `isLiveNow`, `thumbnailUrl` | video | Live right now; thumbnail image link |
| `commentId`, `commentUrl` | comment | Comment id and a direct link to it |
| `text` | comment | The comment text |
| `commentLanguage` | comment | Language code (`en`, `es`, `hi`, ...), detected offline. A best guess for very short comments; `null` for comments without words |
| `publishedTimeText`, `publishedAtApprox` | comment | As shown (`2 years ago`) and an **approximate** ISO date computed from it (YouTube shows only relative times) |
| `publishedAtPrecision` | comment | How precise that date is: `minute`, `hour`, `day`, `week`, `month` or `year` (`2 years ago` can be 2 to 3 years) |
| `firstSeenAt` | comment | When this actor delivered the comment. With **Only new comments** on a schedule, that is the first run that saw it |
| `likeCount`, `replyCount` | comment | Likes (YouTube rounds big numbers: `1.2K`) and replies (as YouTube counts them) |
| `repliesDelivered` | comment | Replies delivered under this comment (`0` with replies off, `null` on replies) |
| `isReply`, `parentCommentId` | comment | Reply flag and the id of the comment it answers |
| `isPinned`, `isHearted`, `isEdited` | comment | Pinned by the channel, hearted by the channel, edited |
| `hasCreatorReply` | comment | The channel replied under this comment (`null` on replies). Finds unanswered questions without reading the replies |
| `links`, `videoTimestamps` | comment | Links in the comment (YouTube's redirect removed) and the video times it mentions, in seconds |
| `authorChannelId`, `authorHandle`, `authorName` | comment | The author in flat columns, easy to use in CSV and Excel |
| `author` | comment | `channelId`, `handle`, `displayName`, `avatarUrl`, `isVerified`, `isChannelOwner` |
| `scrapedAt` | all | When the row was scraped |
| `error`, `errorMessage` | error | Error code and the reason |

### Pricing

This actor uses **pay per event** pricing. You pay only for rows delivered, and the price drops with your Apify plan. Prices per 1,000 rows:

| Event | Charged for | Free plan | Bronze | Silver | Gold |
|---|---|---|---|---|---|
| `comment` | each comment or reply row | **$0.50** per 1,000 ($0.0005 each) | $0.45 | $0.40 | $0.30 |
| `video` | each video row | **$1.00** per 1,000 ($0.001 each) | $0.85 | $0.70 | $0.50 |

What it costs, for example:

- **20 videos with 200 comments each** (4,000 comments and 20 video rows): $2.00 + $0.02 = **$2.02** on the free plan, $1.20 + $0.01 = **$1.21** on Gold.
- **Video stats only for 1,000 videos** (`maxCommentsPerVideo: 0`): **$1.00** on the free plan, **$0.50** on Gold.

Error rows (not found, comments turned off, age-restricted, blocked, invalid input) and comments skipped by "Only new comments", by "Only comments newer than" or by a comment filter are **never charged**.

**Proxy costs are included, residential too.** The default datacenter proxy works for most runs. If you switch to residential proxies because videos come back `blocked`, you pay nothing extra: YouTube sends comments compressed, about 15-35 KB per page of 20, so 1,000 comments use roughly 2 MB of proxy traffic, about 2 cents at residential rates, and that is covered by the price above.

The run stops cleanly when it reaches the spending limit you set: room in the limit is reserved before each page is requested, so it never fetches what it can't deliver, and the status message tells you how many videos were left.

### Limits

- **Public videos only.** Private, deleted and members-only videos can't be read (`notFound`). **Age-restricted** videos are only shown to signed-in adults, so they return a free `ageRestricted` row.
- **Live streams:** while a stream is live YouTube shows a live chat instead of comments, so you get the video row only. Live chat is not collected.
- **Not included:** video transcripts or subtitles, video downloads, the video player data (streams, formats), community posts, comment dislikes (YouTube doesn't show them). **Mix playlists** (made for each viewer) and private lists (Watch later, Liked videos) can't be read; other playlists work.
- **Counts YouTube rounds:** comment likes over 1,000 (`1.2K`), subscriber counts, and comment times (`3 weeks ago`) are as precise as YouTube shows them. `publishedAtPrecision` says how precise each date is.
- **Speed:** YouTube sends 20 comments per request (replies: about 10 on the first request of a thread, then 40-50) and the actor paces its requests, so 10,000 comments take roughly 500 requests, a few minutes per video. `maxCommentsPerVideo` keeps runs predictable.
- YouTube changes its web app often. If a field goes missing, please open an issue.

### Use cases

- **Audience research**: what viewers praise, ask and complain about, across your videos or a competitor's
- **Brand and product monitoring**: scheduled runs with "Only new comments" and **Only comments containing** your brand on review videos and launches
- **Sentiment analysis and AI datasets**: clean comment text with likes and reply structure
- **Creator and campaign reports**: views, likes and comment counts of every video in a campaign (video stats only, from $0.50 per 1,000 videos)
- **Recent reactions**: what viewers said in the last week, with "Only comments newer than: 7 days" and Newest first
- **Community management**: find unanswered questions in the newest comments (`hasCreatorReply` is `false`, keyword `?`)
- **Giveaways**: everyone who commented with your keyword, one entry per person (**One comment per author**)
- **Course and series feedback**: every comment on a playlist, with the video timestamps viewers talk about

### FAQ

#### Do I need a YouTube account or API key?

No. The actor reads what YouTube shows to a visitor who is not logged in. It never logs in, uses no cookies or API keys of its own, and never tries to get around YouTube's checks.

#### Which videos fail, and why?

Each failed input or video gets one free error row with an `error` code:

| Code | Meaning |
|---|---|
| `notFound` | The video does not exist, is private or was removed; or the channel or playlist does not exist or is private; or a channel tab, playlist or search gave no videos. |
| `commentsDisabled` | The channel turned comments off (common on videos made for kids). The video row is still delivered. |
| `ageRestricted` | YouTube only shows this video to signed-in adults. |
| `blocked` | YouTube did not answer after 3 tries on 3 different proxy IPs, or refused access. Comments read before the problem are kept. Try again later or with residential proxies. |
| `invalidInput` | A link that is not YouTube, or a YouTube page this actor doesn't read (for example a Mix playlist or a hashtag page). |
| `failed` | An unexpected problem. Please report it in the **Issues** tab. |

#### How does "Only new comments" work?

After each video, the actor stores the ids of the comments it saw in a key-value store named `youtube-comments-seen` in your account (one record per video). On later runs those comments are skipped for free. Use it with **Newest first**, and set **Max comments per video** to roughly how many new comments you expect between runs. The video row is delivered on every run, so you also get the latest views, likes and comment count.

#### Why did I get fewer comments than the video's comment count?

Check the video row first: `coveragePct` says what share of YouTube's count was read and `stopReason` says why reading stopped. The usual reasons:

- **The count includes replies.** YouTube's comment count adds up comments and their replies. Turn on **Include replies** (and raise **Max replies per comment**) to collect those too.
- **Held and hidden comments.** Comments held for review, removed as spam or hidden by the channel can still be counted, but YouTube doesn't show them to anyone who isn't the channel owner, so no tool can collect them.
- **Top comments is a ranking, not a full list.** YouTube picks and orders the comments it shows in Top order, and on big videos that list can end before every comment has appeared (`stopReason: topSortExhausted`).
- **Newest first walks everything.** It pages through every visible top-level comment, from the newest down to the oldest (`stopReason: endOfComments` when it got to the end), so use it with a high **Max comments per video** when you need as many comments as possible.
- **Your limits and filters.** `maxReached` means **Max comments per video** was reached; filtered comments are counted in `commentsSkippedByFilters`.

#### Can I get the exact date of a comment?

No. YouTube shows a logged-out visitor only "3 weeks ago" or "2 years ago". The actor turns that into `publishedAtApprox` and tells you how precise it is in `publishedAtPrecision` (`2 years ago` means somewhere between 2 and 3 years). For new comments you can do better: monitor with **Only new comments** on a schedule, and `firstSeenAt` tells you the run that first saw each comment (see [Monitoring](#monitoring-videos-on-a-schedule)).

#### Can I get dislikes or transcripts?

No. YouTube doesn't show comment or video dislike counts publicly, and transcripts and subtitles are only served to YouTube's video player, which this actor doesn't use. Live chat is not collected either.

#### Does "Max comments per video" include replies?

No. It counts top-level comments read (including those skipped by filters). Replies are limited separately by **Max replies per comment**, so the most rows a video can give is about `maxCommentsPerVideo × (1 + maxRepliesPerComment)`.

#### How accurate is `commentLanguage`?

It comes from a small language detector that runs inside the actor (no data leaves the run, no extra cost). It is reliable for a sentence or more. For one or two words (`nice`, `first`, `Grazie mille`) it is a best guess, leaning towards the languages most used on YouTube. Comments with no words (emoji, a link, a number) get `null`.

#### Why is `publishedAtApprox` approximate?

YouTube shows comment times only as "3 weeks ago" or "2 years ago". The actor turns that into a date by counting back from the scrape time (a month as 30 days, a year as 365), so older comments can be off by days or months.

#### Can I use it through the API?

Yes. You can start runs and download results with the [Apify API](https://docs.apify.com/api/v2), the Apify JavaScript and Python clients, or integrations like Make, Zapier and Google Sheets.

### Is it legal to scrape YouTube comments?

This actor only collects what YouTube shows publicly to any visitor who is not logged in. Comments are written by people, though, so please use the data responsibly:

- **Personal data.** Commenters' handles, channel ids, avatars and words are personal data under the **GDPR** (EU and UK) and similar laws. You need a lawful basis, such as legitimate interest, to store and use them; keep only what you need, and honour people's rights, including the right to object and to erasure. Consider removing or pseudonymising author fields before sharing datasets.
- **No contact harvesting.** Don't use commenter data for unsolicited messages.
- **YouTube's terms.** YouTube's terms restrict automated collection. You are responsible for how you use this actor and the data.

You can read more in Apify's blog post on [the legality of web scraping](https://blog.apify.com/is-web-scraping-legal/), and check with a lawyer if you are unsure.

**Removal requests.** If your information appears in output from this actor and you want it removed, or have a privacy question, email **privacy@dataji.io**. We aim to answer within 30 days.

### Need something custom?

This actor is one of many data tools we build at Dataji. If you need something different, we can build it for you, whether that's a change to this actor or a scraper for any other website or data source.

Popular requests include:

- every video of a channel or playlist, delivered daily to your tools
- sentiment or topic tags added to each comment
- tracking views, likes and comment counts of a list of videos over time
- delivery straight to Google Sheets, your BI tool or a webhook

These are only examples. If the data is online, we can most likely collect it for you. Tell us what you're trying to build through the [contact form](https://dataji.io/contact-us/) or email support@dataji.io. For bugs or questions about this actor, please use the **Issues** tab.

### Support

Found a bug or need a field that is missing? Open an issue in the **Issues** tab and we'll take a look.

# Changelog

This Actor's version history is a separate document: https://apify.com/dataji/youtube-comments-scraper/changelog.md

# Actor input Schema

## `startUrls` (type: `array`):

YouTube links, one per line. Videos: watch?v= links, youtu.be links, /shorts/, /live/ and /embed/ links (also from m.youtube.com, music.youtube.com and youtube-nocookie.com) or bare 11-character video ids. Channels: https://www.youtube.com/@handle, /channel/UC..., /c/... or /user/... links, or a bare @handle; the newest videos of the tabs chosen in 'Channel tabs' are read. Playlists: https://www.youtube.com/playlist?list=... links (public playlists; Mix playlists and Watch later can't be read). A search results link (youtube.com/results?search_query=...) For searches, use Search queries below. Tracking parameters (si, feature, pp, t, ...) are ignored and duplicates are removed. You can also upload a text or CSV file with one link per line.

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

Search YouTube for these texts and read the top video results (videos only, in YouTube's order). 'Max videos per search' sets how many.

## `channelTabs` (type: `array`):

Which tabs of each channel to read: 'videos' (the Videos tab), 'shorts' and 'streams' (the Live tab: past and upcoming live streams). 'Max videos per channel' applies to each tab. A tab the channel doesn't have is skipped.

## `maxVideosPerChannel` (type: `integer`):

How many of the newest videos to read from each channel tab chosen in 'Channel tabs' (with Videos and Shorts on, up to twice this number per channel).

## `maxVideosPerSearch` (type: `integer`):

How many video results to read for each search query.

## `maxVideosPerPlaylist` (type: `integer`):

How many videos to read from each playlist, in the playlist's order.

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

How many top-level comments to read per video (replies are counted separately, see below). Comments skipped by the filters below count toward it. 0 = no comments, only the video rows.

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

'Top' is YouTube's default order (the pinned comment first, then the most engaging); on big videos YouTube may end this list before every comment. 'Newest first' walks every visible comment from the newest down: best for monitoring, for 'Only comments newer than' and for getting as many comments as possible.

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

Also read the replies under each comment. Replies are comment rows with isReply = true and the parent's id in parentCommentId.

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

How many replies to read under each comment (when 'Include replies' is on).

## `commentsNewerThan` (type: `string`):

Keep only comments (and replies) posted on or after this date (YYYY-MM-DD, UTC) or within this period before the run started ('7 days', '2 weeks', '3 months'; a month counts as 30 days). YouTube shows comment times only as '3 weeks ago', so the date check is approximate. Use 'Newest first': the actor then stops reading a video once it reaches older comments. With 'Top comments' older comments are skipped but still count toward 'Max comments per video'. Replies are read only under comments inside the range.

## `commentKeywords` (type: `array`):

Keep only comments that contain at least one of these words or phrases (any of them; not case-sensitive; part of a word counts, so 'price' also matches 'prices'). Empty = every comment.

## `excludeKeywords` (type: `array`):

Skip comments that contain any of these words or phrases (not case-sensitive), for example spam phrases or 'giveaway'.

## `minLikes` (type: `integer`):

Keep only comments with at least this many likes. YouTube rounds counts over 1,000 ('1.2K' = 1,200). 0 = no minimum.

## `commentLanguages` (type: `array`):

Keep only comments detected as one of these languages (see commentLanguage in the output). Detection runs offline and is a best guess: reliable for a sentence, often wrong for one or two words. Comments without words (emoji, links) are skipped when this is set.

## `oneCommentPerAuthor` (type: `boolean`):

For each video, deliver only the first comment (or reply) read from each author. Handy for giveaways and for counting unique commenters.

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

Add one video row per video: title, description, views, likes, exact comment count, publish date, hashtags, chapters and channel (name, handle, subscribers), plus how many comments were delivered and why reading stopped (coveragePct, stopReason). The row comes after the video's comments.

## `onlyNewComments` (type: `boolean`):

Skip comments this actor already delivered for the same video in earlier runs of your account (remembered in a key-value store named 'youtube-comments-seen'). Use with 'Newest first' on a schedule to monitor videos: each comment is delivered once, and its firstSeenAt tells you which run first saw it. Skipped comments are not charged.

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

How many videos are read at the same time, each through its own proxy IP. Keep it low: YouTube is gentler with slow, steady traffic.

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

Apify Proxy (datacenter) is used by default. If many videos come back as 'blocked', switch to the RESIDENTIAL group. Proxy costs are included in the price, residential too.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "channelTabs": [
    "videos"
  ],
  "maxVideosPerChannel": 10,
  "maxVideosPerSearch": 10,
  "maxVideosPerPlaylist": 50,
  "maxCommentsPerVideo": 100,
  "commentsSort": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "minLikes": 0,
  "oneCommentPerAuthor": false,
  "includeVideoDetails": true,
  "onlyNewComments": false,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Video rows, comment rows and error rows (free) in one table; the recordType column tells them apart.

## `comments` (type: `string`):

Comment and reply columns: author, text, likes, replies, pinned, hearted, time.

## `videos` (type: `string`):

Video columns: title, views, likes, comment count, channel, subscribers, date.

## `errors` (type: `string`):

Why an input or video failed (not found, comments turned off, age-restricted, blocked, invalid input). Error rows are free.

# 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 = {
    "startUrls": [
        {
            "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("dataji/youtube-comments-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 = {
    "startUrls": [{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("dataji/youtube-comments-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 '{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call dataji/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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