# YouTube Comments Scraper (with Replies) (`locaihost/youtube-comments`) Actor

YouTube comments scraper for any video or Short, or the top videos of a search or channel. Rows have text, likes, reply count, date, public @handle and pinned and hearted flags, with replies after each comment. Top or newest first. No login, no API key. $0.25 per 1,000 comments.

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

## Pricing

from $0.14 / 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 Scraper (with Replies)

Get the public comments on any YouTube video or Short as rows: comment text, likes, reply count, date, the commenter's public @handle, and whether the creator pinned or hearted it. Replies follow the comment they answer. Paste video links, or let a search term or a channel pick the videos. You don't need a login, an API key or a daily quota.

What people use it for:

- Reading reactions to a product launch, a trailer or a competitor's video, top comments or newest first.
- Monitoring: a daily run with **Only new comments** charges only for comments posted since the last run.
- Research datasets: thousands of comments across the top videos for a search term, ready for text analysis.
- Feedback on your own channel: every comment and reply on your latest videos, with the ones you pinned or hearted marked.

### How do I start?

Paste this into the **JSON** tab of the input and click **Start**:

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

That returns the 20 top comments on the video plus one row for the video itself, usually in under 10 seconds.

More examples:

```json
{"videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ", "https://www.youtube.com/shorts/41UzbuW6wJs"], "maxComments": 1000, "includeReplies": true}
```

```json
{"videoUrls": ["https://youtu.be/jNQXAC9IVRw"], "maxComments": 200, "commentsSort": "newest"}
```

```json
{"searchTerms": ["iphone 17 review"], "maxResults": 10, "maxComments": 100}
```

```json
{"channels": ["@mkbhd"], "maxResults": 5, "maxComments": 200, "onlyNew": true}
```

The last one is a monitoring setup. Schedule it daily and each run returns only the new comments on the channel's 5 latest videos.

### What do I get?

There are three kinds of row, set by the `type` field: **comment**, **video** (one per video the comments came from) and **unavailable**. An unavailable row is free and says why: comments turned off, a missing video or an entry we can't use.

| Row | Fields |
|---|---|
| Comment | `videoId`, `videoUrl`, `commentId`, `parentId` (for replies), `isReply`, `text`, `likeCount`, `replyCount`, `publishedText`, `isEdited`, `authorHandle`, `authorChannelUrl`, `authorIsCreator`, `authorIsVerified`, `isPinned`, `isHeartedByCreator`, `sortedBy` |
| Video | `id`, `url`, `title`, `channelName`, `channelHandle`, `channelUrl`, `subscriberCount`, `viewCount`, `likeCount`, `commentCount` (exact), `durationSeconds`, `publishedAt`, `publishDate`, `description`, `tags`, `hashtags`, `category`, `thumbnail`, `isShort`, `commentsFetched` (comment rows this video produced) and `commentsNote` (why that is fewer than `commentCount`, in plain words) and more |
| Every row | `type` and `scrapedAt`; video and free rows also carry `source` (url, search, channel or playlist) and `input` (what you typed) |

A real comment row from a run on 2026-11-03:

```json
{
  "type": "comment",
  "videoId": "dQw4w9WgXcQ",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "commentId": "Ugw10bSluCDSZMIxUSB4AaABAg",
  "parentId": null,
  "isReply": false,
  "text": "Let’s put the meme aside, this is actually a banging song.",
  "likeCount": 221000,
  "replyCount": 613,
  "publishedText": "6 years ago",
  "isEdited": false,
  "authorHandle": "@LK-ht7qz",
  "authorChannelUrl": "https://www.youtube.com/channel/UCHpvHTRSILoOFKWX5oFCYDA",
  "authorIsCreator": false,
  "authorIsVerified": false,
  "isPinned": false,
  "isHeartedByCreator": false,
  "sortedBy": "top",
  "scrapedAt": "2026-11-03T14:58:17.074Z"
}
```

The **Comments** view in the dataset tab shows comments only; the **Videos** view shows the video rows.

### How much does it cost?

You pay per row. The run itself is free apart from a one-time $0.00005 start fee.

| Row | Free and Starter plans | Scale | Business |
|---|---|---|---|
| Comment or reply | $0.25 per 1,000 | $0.1875 per 1,000 | $0.1375 per 1,000 |
| Video (one per video) | $0.50 per 1,000 | $0.375 per 1,000 | $0.275 per 1,000 |

So 10 videos with 1,000 comments each cost 10,000 × $0.25 / 1,000 + 10 × $0.50 / 1,000 = $2.505.

**Free rows, never charged:** videos with comments turned off, missing or removed videos, searches with no results, unusable input, and anything skipped by **Only new comments**. Comments left out by **Comments newer than** or **Replies per comment** are never returned and never charged.

Apify's free $5 monthly credit covers about 20,000 comments. On the Free plan a run stops at 1,000 rows; any paid Apify plan removes that cap. Set a **Max cost per run** in the run options and the run stops cleanly at that amount.

### How long does a run take?

Measured on 14 Nov 2026. Cost is at the Free and Starter plan price.

| Run | Time | Rows | Cost |
|---|---|---|---|
| Prefill: 1 video, 20 comments | 5 s | 21 | $0.0055 |
| 2 videos, 100 comments each, replies on, newest first | 30 s | 202 | $0.051 |
| Search term, 3 videos, 30 comments each | 16 s | 71 | $0.019 |
| Channel, 2 latest videos, 25 comments each | 8 s | 52 | $0.014 |
| 1 video, 1,500 comments with replies | 38 s | 1,501 | $0.38 |
| 1 video, 5,000 comments asked, 60 s timeout | 43 s | 841 (stopped in time, with a message) | $0.21 |
| 1 video, 5,000 comments asked, $0.05 max cost | 45 s | 198 (stopped at the max cost) | $0.05 |

A run reads about 40 comments a second per video. For very large videos, raise the run timeout (each 1,000 comments needs about 25 seconds).

### Which options are there?

| Field | What it does |
|---|---|
| Video or Shorts links | Watch links, youtu.be links, /shorts/ and /live/ links, or bare video ids. A playlist link works too. |
| Or: search terms | Comments on the top videos YouTube shows for each term. |
| Or: channels | Comments on each channel's latest videos (@handle, link or UC… id). |
| Videos per search, channel or playlist | How many videos each search, channel or playlist contributes. Default 5. |
| Max comments per video | Most comment rows per video, replies included. Default 100, up to 20,000. |
| Comment order | Top comments (YouTube's default) or newest first. |
| Include replies | Replies follow the comment they answer, with `parentId` set. |
| Replies per comment | With replies on: the most replies under each comment, so a few huge threads don't use up the limit. Empty = no cap. |
| Comments newer than | A date (2026-10-01) or a period ("24 hours", "7 days"). Comments are read newest first and each video stops at the first older one; older replies are left out too. |
| Only new comments | Skip comments this input already returned in an earlier run. |

### Why do I get fewer comments than the count?

Each video row says so itself. `commentsFetched` is the number of comment rows that video produced, and `commentsNote` explains any gap with `commentCount` in plain words: the limit you set, the date cutoff, replies not asked for, comments skipped as already returned, or comments YouTube counts but doesn't show publicly (held for review, removed or filtered as spam). For example: `"100 of 2461139: stopped at the comments-per-video limit (100)"`.

### What can't it do?

- Public comments only, read the way a signed-out visitor sees them. Private, members-only and some age-restricted videos (YouTube asks for a signed-in account) return a free "not found" row. We never sign in.
- Dates are YouTube's own relative text ("3 months ago"), because that is the only date YouTube shows on a comment. YouTube rounds comment likes above 1,000 (1.2K).
- "Max comments per video" counts replies too, so a video with long reply threads returns fewer top-level comments for the same number.
- Live chat is not included.
- Email addresses and phone numbers are removed from comment text and replaced with `[email removed]` or `[phone removed]`. Commenters appear only as the public @handle and channel link YouTube shows.

### Which tools does it work with?

- API: start a run and fetch the dataset with Apify's REST API or its JavaScript and Python clients. Every row is JSON.
- n8n and Make: use the Apify node or module, pick this Actor and paste the input JSON.
- AI agents (MCP): the Actor is available as a tool through Apify's MCP server, so an AI assistant can read a video's comments for you.
- Exports: JSON, CSV, Excel, XML or HTML from the dataset tab, or straight to Google Sheets with Apify's integration.

### Other questions

**Can I get only comments, without the video rows?** Use the **Comments** view, or `?view=comments` on the dataset API. The video row costs $0.0005 per video and carries the title and exact comment count, which most people want next to the comments.

**Is it legal to scrape YouTube comments?** This Actor reads only public pages, the way a signed-out visitor sees them, with no account and no cookies. Comments belong to the people who wrote them: use the data for analysis and research, and follow the laws on personal data that apply to you (GDPR, CCPA). If in doubt, ask a lawyer.

**What if YouTube changes its pages?** We run a test of the Actor every day, so we usually see a break before you do and fix it.

### More from locaihost data

- [YouTube Scraper](https://apify.com/locaihost/youtube-scraper): videos, Shorts, channels, playlists and search results with full details.
- [YouTube Channel Scraper](https://apify.com/locaihost/youtube-channels): subscribers, total views, joined date, country and links for any channel.
- [YouTube Transcript Scraper](https://apify.com/locaihost/youtube-transcripts): transcripts and subtitles of videos, channels and playlists.

Did it help? A short rating on the Store helps other people find it.

Questions or a field you need? Open an issue on the **Issues** tab: we answer issues within 24 hours.

*locaihost data*

# Changelog

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

# Actor input Schema

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

Links to videos or Shorts (watch?v=, youtu.be/, /shorts/, /live/) or bare video ids. Each returns up to Max comments per video. A playlist link works too: its first videos (Videos per search, channel or playlist) are used.

## `searchTerms` (type: `array`):

Optional. Comments on the top videos YouTube shows for each term, as many as Videos per search, channel or playlist.

## `channels` (type: `array`):

Optional. Comments on each channel's latest videos, as many as Videos per search, channel or playlist. Channel @handles, links or UC… ids.

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

How many videos each search term, channel or playlist contributes. Video links always count as one video each.

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

Most comment rows per video, replies included.

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

Top comments (YouTube's default order) or newest first.

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

Also return replies, each right after the comment it answers, with parentId set. They count toward Max comments per video.

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

With Replies on: the most replies returned under each comment, so a few huge threads don't use up Comments per video. 0 or empty = no cap beyond Comments per video.

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

Only comments posted after this: a date like 2026-10-01 or a period like "24 hours" or "7 days". Comments are then read newest first and each video's comments stop at the first older one (a pinned comment doesn't end them). Replies older than the cutoff are left out too. Left-out comments are free. Empty = every date.

## `onlyNew` (type: `boolean`):

Return only comments this input hasn't returned in an earlier run (within the latest Max comments per video). For daily or weekly comment monitoring. Skipped comments are not charged.

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

Always on in this Actor.

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

Off in this Actor: channels only pick videos.

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

Searches pick videos in this Actor.

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

A channel's videos come from its Videos tab in this Actor.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/jNQXAC9IVRw",
    "https://www.youtube.com/shorts/41UzbuW6wJs"
  ],
  "searchTerms": [
    "iphone 17 review"
  ],
  "channels": [
    "@mkbhd",
    "https://www.youtube.com/@veritasium"
  ],
  "maxResults": 5,
  "maxComments": 20,
  "commentsSort": "top",
  "includeReplies": false,
  "onlyNew": false,
  "includeComments": true,
  "includeChannelInfo": false,
  "searchType": "videos",
  "channelTabs": [
    "videos"
  ]
}
```

# Actor output Schema

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

One row per comment or reply: text, author handle, likes, replies, date, pinned, hearted.

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

One row per video the comments came from: title, channel, views, likes, exact comment count, date.

## `full` (type: `string`):

Every field of every row, including free rows.

## `summary` (type: `string`):

Counts, free rows by reason, anything that failed, access stats and cost.

# 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=dQw4w9WgXcQ"
    ],
    "maxComments": 20
};

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

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

```

## MCP server setup

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