# YouTube Comments Scraper - Replies, Likes, Dates, $0.36/1K (`sweet_stickball/youtube-comments-scraper`) Actor

YouTube comments scraper and API alternative: extract comments and replies from YouTube videos and Shorts with text, like and reply counts, pinned and hearted flags and date. Sort by top or newest, flat JSON, no API key or login.

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

## Pricing

from $0.22 / 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 - Replies, Likes, Dates, $0.36/1K

Scrape the public comments of YouTube videos and Shorts, with optional replies. For each comment you get the text, a pseudonymized author, like and reply counts, pinned and hearted flags, an edited flag, the relative date shown by YouTube and an approximate ISO date. One flat JSON record per comment, no API key and no YouTube account needed.

### What it does

- Takes a list of YouTube video URLs or IDs (`videoUrls`): watch URLs, `youtu.be` links, Shorts, embed and live URLs, or raw 11-character IDs.
- Reads the comments the way the YouTube web page loads them (InnerTube `/next` endpoint), sorted by **top** (as on the video page, pinned comment first) or **newest**.
- Optionally adds the **replies** of each comment, right after their parent (`isReply: true`, `parentCommentId` set), with an optional cap per comment.
- Returns at most `maxItems` items **per video** (comments plus replies), deduplicated by `commentId`.
- Skips invalid URLs and reports, per video, why nothing was returned: video not found or private, comments turned off, no comments yet, or blocked.

### Input

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `videoUrls` | array of strings | Yes | - | YouTube video URLs or 11-character video IDs (videos and Shorts). Duplicates are scraped once. |
| `maxItems` | integer | No | 20 | Maximum items (comments + replies) **per video**, 1 to 10,000. 3 videos x 100 = up to 300 items. |
| `sortBy` | string | No | `top` | `top` (most relevant first, as on the video page) or `newest` (most recent first). |
| `includeReplies` | boolean | No | `false` | Also return the replies of each comment. Replies count toward `maxItems`. |
| `maxRepliesPerComment` | integer | No | 0 | With `includeReplies`: maximum replies per comment (0 = no limit other than `maxItems`). |

Example:

```json
{
    "videoUrls": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw",
        "https://www.youtube.com/shorts/5mU6SRS2Bxo"
    ],
    "maxItems": 100,
    "sortBy": "top",
    "includeReplies": true,
    "maxRepliesPerComment": 5
}
```

### Output

One dataset item per comment or reply. Real example (first item of the default input):

```json
{
    "commentId": "UgzuC3zzpRZkjc5Qzsd4AaABAg",
    "videoId": "jNQXAC9IVRw",
    "videoTitle": "Me at the zoo",
    "videoUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "commentUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw&lc=UgzuC3zzpRZkjc5Qzsd4AaABAg",
    "text": "We're so honored that the first ever YouTube video was filmed here!",
    "author": "@San***",
    "authorIsChannelOwner": false,
    "likeCount": 4800000,
    "replyCount": 986,
    "isReply": false,
    "parentCommentId": null,
    "isPinned": true,
    "isHearted": true,
    "isEdited": false,
    "publishedTimeText": "6 years ago",
    "publishedAt": "2020-10-29T06:37:07+00:00",
    "scrapedAt": "2026-10-28T06:37:07+00:00"
}
```

| Field | Description |
|-------|-------------|
| `commentId` | YouTube comment ID. Replies use `<parentId>.<replyId>`. |
| `videoId`, `videoTitle`, `videoUrl` | The video the comment belongs to. |
| `commentUrl` | Opens the video with this comment highlighted. |
| `text` | Comment text (emoji kept). |
| `author` | Pseudonymized author: handles are masked (`@San***`), full names shortened to `First L.`. No channel ID is returned. |
| `authorIsChannelOwner` | `true` when the comment was posted by the video's channel. |
| `likeCount`, `replyCount` | Integers. YouTube rounds counts above 1,000 (`4.8M` becomes 4800000). |
| `isReply`, `parentCommentId` | Reply flag and parent comment ID (`null` for top-level comments). |
| `isPinned`, `isHearted`, `isEdited` | Pinned by the channel, hearted by the creator, edited by its author. |
| `publishedTimeText` | Relative date as shown by YouTube (`6 years ago`, `3 hours ago (edited)`). |
| `publishedAt` | Approximate ISO 8601 date computed from the relative date at scrape time (month = 30 days, year = 365 days). |
| `scrapedAt` | ISO 8601 time of the scrape. |

### Pricing

Pay-per-event, no start fee: **$0.36 per 1,000 comments** (event `COMMENT`) on the Apify Free plan, lower on paid plans. You only pay for results pushed to the dataset.

| Apify plan | Price per 1,000 comments |
|---|---|
| Free | $0.36 |
| Starter | $0.31 |
| Scale | $0.27 |
| Business | $0.22 |

Set a maximum cost per run in the run options: the Actor stops cleanly when it is reached.

### Limitations

- Only public comments that YouTube shows to a signed-out visitor are returned. Held-for-review and deleted comments are not visible.
- Like and reply counts above 1,000 are rounded by YouTube (`70K`, `4.8M`); exact values are not available.
- `publishedAt` is approximate: YouTube only shows a relative date ("7 years ago"), so the precision is the unit shown.
- The `top` order is YouTube's own ranking and can change between runs; `newest` is better for monitoring new comments.
- With `includeReplies`, replies are collected depth-first: a comment with thousands of replies can use the whole `maxItems` budget of its video unless `maxRepliesPerComment` is set.
- Videos with comments turned off (for example videos made for kids), private or removed videos return no comments; the run status message says which video was skipped and why.
- Live chat messages and community posts are not covered.

### Feedback

Found a bug or need a field? Open an issue on the Issues tab; if the Actor helps you, a review on the Reviews tab helps others find it.

### Related Actors

- [YouTube Transcript Scraper - Bulk, Any Language, $1.10/1K](https://apify.com/sweet_stickball/youtube-transcripts) — Scrape YouTube video transcripts (captions and auto-generated subtitles) with timestamps, video metadata and optional comments.
- [YouTube Channel Scraper - Videos, Shorts & Stats, $0.91/1K](https://apify.com/sweet_stickball/youtube-channel-scraper) — YouTube channel scraper and YouTube Data API alternative: list a channel's videos, Shorts or live streams with exact view counts, duration and publish date, plus subscribers, video count, total views and country.
- [Reddit Scraper - Posts, Comments & New Posts Monitor, $0.90/1K](https://apify.com/sweet_stickball/reddit-scraper) — Scrape Reddit posts and comments from any subreddit: title, text, date, link and author. Reddit data API alternative for social listening, no login.

# Actor input Schema

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

YouTube videos to scrape, one per line. Accepted formats: watch URL (https://www.youtube.com/watch?v=jNQXAC9IVRw), short link (https://youtu.be/jNQXAC9IVRw), Shorts URL (https://www.youtube.com/shorts/5mU6SRS2Bxo), embed or live URL, or the raw 11-character video ID. Duplicates are scraped once; entries that are not YouTube video URLs are skipped with a warning.

## `maxItems` (type: `integer`):

Maximum number of items (comments plus replies, if replies are included) returned FOR EACH video. Example: 3 videos with maxItems 100 return up to 300 items. Each item is billed as one COMMENT event.

## `sortBy` (type: `string`):

Order in which YouTube returns the comments: 'top' (most relevant first, as on the video page; pinned comment first) or 'newest' (most recent first).

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

Also return the replies of each comment, right after their parent comment (isReply = true, parentCommentId set). Replies count toward maxItems and are billed like comments. Off by default.

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

Only used when includeReplies is on: maximum number of replies returned for each comment, so that one very popular thread does not use the whole maxItems budget. 0 = no limit (replies are then only bounded by maxItems).

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "https://www.youtube.com/shorts/5mU6SRS2Bxo"
  ],
  "maxItems": 10,
  "sortBy": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 0
}
```

# Actor output Schema

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

Dataset items (one per comment or reply) shown with the 'comments' view.

# 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=jNQXAC9IVRw"
    ],
    "maxItems": 10
};

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

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

```

## MCP server setup

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