# YouTube Comments Scraper | Replies for Videos (`datascraperes/youtube-comments-scraper`) Actor

Scrape public YouTube video comments and replies from up to 10 video URLs or IDs. Get one unique Dataset row per comment, with author details, timestamps, likes, and reply relationships; each run has a hard cap of 100,000 comments, with up to 10,000 per video.

- **URL**: https://apify.com/datascraperes/youtube-comments-scraper.md
- **Developed by:** [DataScraperES](https://apify.com/datascraperes) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.75 / 1,000 youtube 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

Collect public comments and replies from YouTube videos with one simple input. **Get structured comment records with author details, timestamps, likes, and reply relationships**, without downloading video files.

Submit one video or a list of videos, choose newest or top comments, and review each unique result in the Apify Dataset.

### What this Actor does

The Actor collects comments and replies from public YouTube videos. It returns one Dataset item per unique comment, including the video, comment text, public author details, publication time, likes, and parent comment when available. Top-level comments have a `null` `parentId`.

The Actor accepts up to 10 video references and can return up to 10,000 comments per video, with a hard cap of 100,000 comments total per run. It does not download video or audio files.

### Use cases

- Review audience responses to a set of public videos.
- Compare comment themes and engagement across videos.
- Export comment threads for research, reporting, or moderation workflows.

### How to use

1. Start with the example video and five comments already shown in the input form, or enter your own YouTube video URLs or IDs.
2. Choose the maximum comments per video and the requested order.
3. Start the Actor and open the Dataset to view or export the results.

### Input

`startUrls` is required. Each entry can be a YouTube watch, Shorts, live, embed, or `youtu.be` video URL, or an 11-character video ID. Duplicate video references are processed once.

`maxComments` applies separately to each unique video and includes replies. The input form starts at 5 to keep a first run small; API and task calls that omit it default to 100. Values from 1 to 10,000 are accepted. Submit up to 10 videos; the Actor enforces a hard cap of 100,000 comments total across the run. `sort` accepts `new` (newest first, the default) or `top` (top comments).

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "sort": "new",
  "maxComments": 5
}
```

### Output

Each Dataset item represents one unique comment or reply. Fields include the video and comment URLs, text, author details, publication time in UTC, likes, reply status, and available pinned, uploader, and verification indicators. Values YouTube does not provide are returned as `null`.

The default key-value store also contains a `SUMMARY` record with the run status, requested and completed video counts, total saved comments, the 100,000-comment run cap, whether that cap was reached, the number of videos skipped after reaching it, and per-video errors. Reaching the cap is a successful bounded run; if a video fails, results already saved remain in the Dataset and the Actor run fails so collection errors are visible.

The run log shows video-by-video collection, periodic updates while comments are being fetched, and saved-comment counts as results are written. The run status message follows the current video and ends with a terminal completion or incomplete-run message. See `SUMMARY.errors` for details about videos that could not be processed.

This is a complete Dataset item from a successful run:

```json
{
  "videoId": "dQw4w9WgXcQ",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "videoTitle": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channel": "Rick Astley",
  "commentId": "Ugzge340dBgB75hWBm54AaABAg",
  "commentUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=Ugzge340dBgB75hWBm54AaABAg",
  "text": "can confirm: he never gave us up",
  "author": "@YouTube",
  "authorId": "UCBR8-60-B28hp2BmDPdntcQ",
  "authorUrl": "https://www.youtube.com/@YouTube",
  "authorThumbnail": "https://yt3.ggpht.com/3s6evpqAiDU9tQR4sC2siJippbH2RWVPnwHgyl4V0th2iuQz0VDQZbUhQBGmsxLYo-mjG6TqZQ=s88-c-k-c0x00ffffff-no-rj",
  "publishedAt": "2025-09-24T00:00:00Z",
  "likeCount": 319000,
  "parentId": null,
  "isReply": false,
  "isPinned": true,
  "isUploader": false,
  "isVerified": true
}
```

### Pricing

The Actor charges one `comment-result` event for each unique comment or reply saved to the run's Dataset. The equivalent per-1,000 amount is shown for comparison; the actual charge is calculated per saved comment.

| Apify tier | Price per comment | Equivalent per 1,000 comments |
|---|---:|---:|
| FREE | $0.001 | $1.00 |
| BRONZE | $0.0009 | $0.90 |
| SILVER | $0.0008 | $0.80 |
| GOLD | $0.00075 | $0.75 |
| PLATINUM | $0.00075 | $0.75 |
| DIAMOND | $0.00075 | $0.75 |

`FREE` is Apify's discount tier; it does not mean that the event price is $0. There is no separate run-start charge. Duplicate comments, failed video requests, and the run summary do not trigger comment charges. The minimum maximum-spend setting is $0.001 per run.

### Related Actors

| Actor | Best for |
|---|---|
| [TikTok Comments Scraper – No Login](https://apify.com/datascraperes/tiktok-comments-scraper) | Compare discussions on YouTube with public TikTok comments and replies. |
| [Instagram Comments Scraper - No Login](https://apify.com/datascraperes/instagram-comments-scraper) | Compare YouTube discussions with public comments from Instagram posts and Reels. |
| [YouTube Channel Videos Scraper | Shorts & Streams](https://apify.com/datascraperes/youtube-channel-scraper) | Find a channel’s public videos, Shorts, or streams before collecting their comments. |
| [YouTube Transcript Extractor - Timestamps](https://apify.com/datascraperes/youtube-transcript-scraper) | Add available spoken captions and timestamps alongside comments from selected videos. |

### Limits and data quality

Results depend on comments being public and available to YouTube at run time. Videos with disabled comments, unavailable recordings, or source-side restrictions can return no comments or an error. YouTube may return fewer comments than requested, and comment ordering can vary with the source response. The requested limit is a maximum for each video, not a guarantee that the source contains that many comments. The Actor stops saving results at 100,000 comments across the run and records any videos skipped due to that cap in `SUMMARY`.

Repeated comment IDs are omitted. When one submitted video cannot be processed, inspect `SUMMARY.errors`; results from other videos remain available, but the run is marked failed or partial rather than reported as fully successful.

### Frequently asked questions

#### Does the comment limit include replies?

Yes. `maxComments` is the maximum number of saved comments and replies combined for each video. You can submit up to 10 videos; the Actor enforces a maximum of 100,000 comments total across one run.

#### What happens if some videos fail?

The Dataset keeps comments already saved from successful videos. The run reports a failure, and `SUMMARY` identifies the videos that could not be processed.

#### Can I submit a live URL?

Yes, if YouTube makes the video or recording and its comments available. Active streams and unavailable recordings may not return comments.

### Responsible use

Use the Actor only for public information you are allowed to collect and process. You are responsible for complying with applicable privacy rules, regulations, and YouTube’s terms.

### Support

For help, open an issue in the Actor's **Issues** tab and include the run ID, a reproducible input, and the relevant `SUMMARY` details.

For ready-to-run Python, JavaScript and cURL requests, see the [public YouTube Comments Scraper integration guide](https://github.com/datacrawler-edu/youtube-comments-scraper-python).

# Actor input Schema

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

YouTube watch, Shorts, live, embed or youtu.be URLs (up to 10).

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

Includes replies. Up to 10,000 per video and 100,000 total per run across all videos. YouTube and yt-dlp may return fewer comments.

## `sort` (type: `string`):

Choose the order requested from YouTube.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "maxComments": 5,
  "sort": "new"
}
```

# Actor output Schema

## `comments` (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 = {
    "startUrls": [
        {
            "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
        }
    ],
    "maxComments": 5,
    "sort": "new"
};

// Run the Actor and wait for it to finish
const run = await client.actor("datascraperes/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" }],
    "maxComments": 5,
    "sort": "new",
}

# Run the Actor and wait for it to finish
run = client.actor("datascraperes/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"
    }
  ],
  "maxComments": 5,
  "sort": "new"
}' |
apify call datascraperes/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datascraperes/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/5oZPQyx6hVQgMZ445/builds/jq95cCh6Yo6bGgkja/openapi.json
