# YouTube Comments Scraper: Comments, Replies & Likes (`deepmine/youtube-comments-scraper`) Actor

Scrape the comments and replies of any YouTube video or Short: text, author, likes (exact under 1,000), reply count, pinned and creator-heart flags, author channel and avatar, video title and comment count. Top or newest first. No login, no API key.

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

## Pricing

from $0.45 / 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: comments, replies and likes

Scrape the comments and replies of any YouTube video or Short: paste video links and get one row per comment with its text, author, likes (**exact under 1,000**, YouTube's rounded count above: 2.3K = 2300), reply count, pinned and creator-heart flags, the author's channel and avatar, and the video's title and total comment count. Top comments or newest first. No login, no API key, no browser.

| Type | Comment | Author | Likes | Replies | Posted |
|---|---|---|---|---|---|
| comment | You get 5 stars from me for your innovative contribution to manufacturing! | @rah4822 | 16 | 0 | 4 days ago |
| comment | here reading the comments instead of watching the video. i already know everything about shipping logistics. | @brendonmueller | 141 | 1 | 6 days ago |
| reply | Mining landfills?  Gold hit 4k-5k$/oz.  All those Pentium processors and electronics had gold plated pins... | @Derived_One | 2 | – | 4 days ago (edited) |

<sub>Collected 2026-10-07 by the prefilled run below (3 of its 90 rows, shortened).</sub>

**$0.99 per 1,000 comments on Free, $0.75 on Starter, $0.59 on Scale and $0.45 on Business.** The prefilled run (2 videos, up to 50 comments each, 100 at most) costs up to **$0.075** on Starter; the measured run saved 90 rows for $0.0675. Nothing per run.

### What you get

| Field | Example |
|---|---|
| `comment` | "This talk highlights how rethinking gravity in manufacturing could…" |
| `cid`, `commentUrl` | `UgwcvLTAAUM9iFYfAMx4AaABAg`, link that opens the video at this comment |
| `type`, `replyToCid` | `comment` / `reply`, and for a reply the comment it answers |
| `voteCount` | 7 (exact up to 999; above that YouTube's rounded count, 2.3K = 2300) |
| `replyCount` | replies under the comment |
| `publishedTimeText`, `isEdited` | "4 days ago", false |
| `isPinned`, `hasCreatorHeart` | pinned by the creator, hearted by the creator |
| `author`, `authorChannelId`, `authorChannelUrl`, `authorAvatarUrl` | @InnovationAI and their channel |
| `authorIsChannelOwner`, `authorIsVerified`, `authorIsArtist` | the creator answering, verified badge, music artist badge |
| `videoId`, `pageUrl`, `title`, `commentsCount`, `videoChannelId`, `videoChannelName` | the video the comment is on |
| `sortedBy`, `order`, `input`, `scrapedAt` | how the row was found |

A full row:

```json
{
  "cid": "UgwcvLTAAUM9iFYfAMx4AaABAg",
  "replyToCid": null,
  "type": "comment",
  "comment": "This talk highlights how rethinking gravity in manufacturing could unlock new engineering possibilities. I'm curious how scalable these approaches are for mainstream production.",
  "publishedTimeText": "4 days ago",
  "isEdited": false,
  "voteCount": 7,
  "replyCount": 0,
  "hasCreatorHeart": false,
  "isPinned": false,
  "author": "@InnovationAI",
  "authorChannelId": "UCdxyVVNuuhAMOo22_Lq459w",
  "authorChannelUrl": "https://www.youtube.com/@InnovationAI",
  "authorIsChannelOwner": false,
  "authorIsVerified": false,
  "authorIsArtist": false,
  "commentUrl": "https://www.youtube.com/watch?v=r63spwe1LCI&lc=UgwcvLTAAUM9iFYfAMx4AaABAg",
  "videoId": "r63spwe1LCI",
  "pageUrl": "https://www.youtube.com/watch?v=r63spwe1LCI",
  "commentsCount": 40,
  "title": "The Gravity-Defying Future of Manufacturing | Schendy Kernizan | TED",
  "sortedBy": "TOP_COMMENTS",
  "order": 1
}
```

Top-level comments come first: "Max comments per video" is spent on them, in YouTube's order or newest first. Replies (`type: reply`, with `replyToCid`) are added after them, only when the video has fewer top-level comments than your maximum, up to "Max replies per comment" for each comment, in the order of the comments. The run's `OUTPUT` record lists every video with how many comments and replies it gave, its total comment count, and why a video gave nothing (unavailable, comments turned off).

### Input

- **YouTube video or Shorts links**: `https://www.youtube.com/watch?v=…`, `https://youtu.be/…`, `https://www.youtube.com/shorts/…`.
- **Max comments per video** (default 100): comments and replies together. Top-level comments first; replies fill what is left.
- **Sort**: Top comments (YouTube's order, pinned first) or Newest first.
- **Max replies per comment** (default 10, 0 = top-level comments only): so one comment with hundreds of replies doesn't take a video's whole budget. Only used when the top-level comments don't fill "Max comments per video".
- **Comments newer than**: a date (2026-09-01) or an age (7 days). YouTube shows comment ages as "3 days ago", so the cut is to the day for recent comments and coarser for old ones.

The input keys of `streamers/youtube-comments-scraper` (`startUrls`, `maxComments`, `sortCommentsBy`, `oldestCommentDate`) work unchanged.

### Speed (measured on Apify, 256 MB, 2026-10-07)

| Input | First row | Total |
|---|---|---|
| 1 video, 20 top comments | 5.3 s | 5.5 s |
| 2 videos, 50 each | 4.0 s | 5.3 s |
| 1 video, 1,000 comments + replies | 8.0 s | 19.5 s |

Times are from starting the run to the row in your dataset.

### Pricing

You pay per comment or reply saved, nothing per run:

| Plan | Free | Starter | Scale | Business |
|---|---|---|---|---|
| Per 1,000 comments | $0.99 | $0.75 | $0.59 | $0.45 |

A comment is charged once per run, even when two links point to the same video.

### FAQ

**Do I need a YouTube account or API key?** No. The Actor reads what YouTube shows anyone who isn't logged in.

**Can I get all comments of a video?** Yes: set Max comments to the video's comment count or above. YouTube's own count includes replies.

**Why does a video give no comments?** Its comments are turned off, or it is private or removed. The `OUTPUT` record says which.

### Did it help?

A short review on the Actor's page helps other people find it and tells us what to improve: https://apify.com/deepmine/youtube-comments-scraper/reviews. Something missing or wrong? Write to us through the Actor's Issues tab.

# Actor input Schema

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

Video links (https://www.youtube.com/watch?v=..., https://youtu.be/...) or Shorts links, one per line.

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

Comments and replies saved per video, counted together. Top-level comments come first; replies only fill what is left when the video has no more top-level comments.

## `sortCommentsBy` (type: `string`):

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

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

Replies saved per comment (type 'reply', with replyToCid) once the video's top-level comments are all saved and the maximum above isn't reached yet. 0 = top-level comments only.

## `oldestCommentDate` (type: `string`):

Leave out comments older than this date (2026-09-01) or age (7 days, 2 weeks, 3 months). YouTube shows comment ages as '3 days ago', so the cut is to the day for recent comments and coarser for old ones. Works best with Newest first.

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

Leave as is: Apify datacenter proxy works for every YouTube call this Actor makes.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=ONAuUyml0yI"
    },
    {
      "url": "https://www.youtube.com/watch?v=r63spwe1LCI"
    }
  ],
  "maxComments": 50,
  "sortCommentsBy": "TOP_COMMENTS",
  "maxRepliesPerComment": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.youtube.com/watch?v=ONAuUyml0yI"
        },
        {
            "url": "https://www.youtube.com/watch?v=r63spwe1LCI"
        }
    ],
    "maxComments": 50
};

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

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

```

## MCP server setup

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