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

YouTube comments scraper and YouTube comments API: extract the comments and replies of any video or Short: text, author, likes (exact up to 999,999), reply count, pinned and creator-heart flags, author channel and avatar. A YouTube comment extractor for top or newest comments. 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
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.15 / 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

YouTube comments scraper and YouTube comments API: extract 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 up to 999,999**; YouTube rounds millions: 1.2M), reply count, posting date, 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 | 10 years later there’s gonna be a whole periodic table | @sultanmubarak474 | 3,277 | 11 | 3 weeks ago |
| comment | Derek somewhere underneath a palm tree smilling and drinking a margarita 🥂 | @kancletov | 2,631 | 22 | 3 weeks ago |
| comment | Thank you for everything Veritasium. It has been a good run. | @mixuaquela123 | 156 | 0 | 3 weeks ago |

<sub>Collected 2026-10-28 on build 0.1.12 by the prefilled run below (3 of its 100 rows, shortened).</sub>

**$0.25 per 1,000 comments on Free, $0.19 on Starter, $0.17 on Scale and $0.15 on Business.** The prefilled run (2 videos, up to 50 comments each, 100 at most) costs up to **$0.019** on Starter; the run of 2026-10-28 saved 100 rows (100 × $0.00019 = $0.019). 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` | 291897 where YouTube's page shows 291K: exact up to 999,999 (YouTube rounds millions: 1.2M) |
| `replyCount` | replies under the comment |
| `publishedTimeText`, `isEdited` | "4 days ago", false |
| `publishedAt`, `publishedAtEstimated` | "2026-10-04T22:05:57Z" for "2 weeks ago" read at 2026-10-18T22:05:57Z (scrape time minus the age YouTube shows), true |
| `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": "Ugz5QvehF-hMzEAd8kR4AaABAg",
  "replyToCid": null,
  "type": "comment",
  "comment": "10 years later there’s gonna be a whole periodic table",
  "publishedTimeText": "2 weeks ago",
  "isEdited": false,
  "publishedAt": "2026-10-04T22:05:57Z",
  "publishedAtEstimated": true,
  "voteCount": 3225,
  "replyCount": 11,
  "hasCreatorHeart": false,
  "isPinned": false,
  "author": "@sultanmubarak474",
  "authorChannelId": "UCxJpaPhpwT4eFJWUFRcyYqw",
  "authorChannelUrl": "https://www.youtube.com/@sultanmubarak474",
  "authorIsChannelOwner": false,
  "authorIsVerified": false,
  "authorIsArtist": false,
  "commentUrl": "https://www.youtube.com/watch?v=ONAuUyml0yI&lc=Ugz5QvehF-hMzEAd8kR4AaABAg",
  "videoId": "ONAuUyml0yI",
  "pageUrl": "https://www.youtube.com/watch?v=ONAuUyml0yI",
  "commentsCount": 2523,
  "title": "We're trying something new...",
  "sortedBy": "TOP_COMMENTS",
  "order": 2
}
```

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.25 | $0.19 | $0.17 | $0.15 |

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.

### Where the video links come from

A YouTube comment extractor needs video links. Get them with our other Actors, then paste each row's `url` here:

- [YouTube Search Scraper](https://apify.com/deepmine/youtube-search-scraper): the videos YouTube ranks for a keyword.
- [YouTube Channel Scraper](https://apify.com/deepmine/youtube-channel-scraper): every video of a channel, with its comment count, so you can pick the ones with the most.
- [YouTube Shorts Scraper](https://apify.com/deepmine/youtube-shorts-scraper): a channel's Shorts or a Shorts search; Short links work here too.
- [YouTube Playlist Scraper](https://apify.com/deepmine/youtube-playlist-scraper): the videos of a playlist.
- [YouTube Scraper](https://apify.com/deepmine/youtube-scraper): videos, Shorts, search and playlists in one input.

After the comments: [YouTube Transcript API](https://apify.com/deepmine/youtube-transcript-scraper) gives you what the video says, to read it next to what viewers answer.

### 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/hM73ZeVXWVYWfrP0H/openapi.json
