# YouTube Comments Scraper — Comments, Replies & Video Stats (`joyouscam35875/youtube-comments-scraper`) Actor

Scrape YouTube comments and replies from any video with author, likes, timestamps, pinned/creator flags, plus video title, views and channel. No API key, no login, no proxies needed.

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

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 & Video Stats (No API Key)

Export the comments of any YouTube video into a clean dataset: text, author, likes, reply count, pinned and creator-hearted flags, plus the video's title, channel, views and total comment count on every row. Works on regular videos, Shorts and past live streams.

- **No API key, no login, no proxies.** Uses the same internal endpoints as the youtube.com page.
- **Replies included on demand.** Turn on `includeReplies` to get threaded replies with `parentCommentId`.
- **Top or Newest.** Same sort orders YouTube offers.
- **Pay only for what you get.** Billed per comment row delivered. Empty or failed videos cost nothing beyond the run start.
- **Fast.** ~20 comments per request, no browser, 256 MB of memory is enough.

### Quick start

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
  "maxCommentsPerVideo": 200,
  "includeReplies": true,
  "sortBy": "top"
}
```

Video references can be full URLs (`watch?v=`, `youtu.be/`, `/shorts/`, `/live/`) or bare 11-character video IDs.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `videoUrls` | array | required | Video URLs or IDs. |
| `maxCommentsPerVideo` | integer | 100 | Top-level comments per video. `0` = all (can take a while on videos with millions of comments). |
| `includeReplies` | boolean | false | Fetch replies under each collected comment. Replies are billed like comments. |
| `maxRepliesPerComment` | integer | 20 | Cap per thread when replies are on. `0` = all. |
| `sortBy` | string | `top` | `top` or `newest`. |
| `language` | string | `en` | Interface language (`hl`), affects relative dates such as "2 days ago". |
| `country` | string | `US` | Country code (`gl`). |

### Output

One row per comment or reply:

```json
{
  "videoId": "dQw4w9WgXcQ",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "videoTitle": "Rick Astley - Never Gonna Give You Up (Official Video)",
  "channelName": "Rick Astley",
  "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "videoViewCount": 1700000000,
  "videoLikeCount": 18000000,
  "videoPublishDate": "2009-10-24",
  "videoCommentCount": 2457628,
  "commentId": "Ugzge340dBgB75hWBm54AaABAg",
  "commentUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=Ugzge340dBgB75hWBm54AaABAg",
  "parentCommentId": null,
  "isReply": false,
  "text": "can confirm: he never gave us up",
  "author": "@YouTube",
  "authorChannelId": "UCBR8-60-B28hp2BmDPdntcQ",
  "authorUrl": "https://www.youtube.com/@YouTube",
  "authorAvatar": "https://yt3.ggpht.com/...",
  "authorIsVerified": true,
  "authorIsCreator": false,
  "likeCount": 318000,
  "replyCount": 962,
  "publishedTimeText": "1 year ago",
  "isPinned": true,
  "isHearted": true,
  "scrapedAt": "2026-09-21T10:00:00+00:00"
}
```

`videoLikeCount` and `videoPublishDate` can be `null` when YouTube withholds the player metadata for a request; title, channel and view count are always filled. `likeCount` and `replyCount` are parsed from YouTube's abbreviated counters ("318K"), so large values are rounded the way YouTube rounds them. `publishedTimeText` is the relative date YouTube shows; YouTube does not expose exact comment timestamps.

### Pricing

Pay per event: one `comment` event per row delivered (comments and replies alike) plus a tiny actor-start fee. A run that finds no comments only pays the start fee. You can cap spending per run with Apify's "Maximum total charge" setting.

### Use cases

- Sentiment and topic analysis of an audience, campaign or product launch
- Community management: find unanswered questions, pinned threads, creator replies
- Research datasets (comments are ordered as YouTube ranks them)
- Feeding comments into an LLM pipeline or vector database
- Monitoring competitor videos

### Integrations

Run it from the Apify API, the JavaScript or Python client, the Apify CLI, or as an MCP tool. Export the dataset as JSON, CSV, Excel or push it to Google Sheets, Make, Zapier or n8n through the Apify integrations.

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("joyouscam35875/youtube-comments-scraper").call(run_input={
    "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "maxCommentsPerVideo": 500,
    "includeReplies": True,
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["author"], row["likeCount"], row["text"][:80])
```

### FAQ

**Does it need my YouTube API key?** No. The Data API's comment quota is small; this actor reads the public page data instead.

**Can it scrape comments on private, members-only or comments-disabled videos?** No. Those rows come back with an `error` field and are not billed.

**Are exact timestamps available?** YouTube only publishes relative times ("3 weeks ago") for comments. The row includes that text as-is.

**How many comments can I pull?** All of them if you set `maxCommentsPerVideo` to `0`. Very large videos take longer because YouTube serves 20 comments per page.

**Is it legal?** The actor only reads publicly visible data. You are responsible for how you use it and for complying with YouTube's terms and local law.

### Feedback

Missing a field, hit a bug, or need an input this actor doesn't take yet? Open an issue on the actor's **Issues** tab. If the YouTube Comments Scraper saved you time, a short review on the Store page helps other people find it.

### Related actors by the same developer

| Actor | What it does |
|---|---|
| [YouTube Channel Scraper](https://apify.com/joyouscam35875/youtube-channel-scraper) | Channel stats and video metadata via the official API |
| [Google Trends Scraper](https://apify.com/joyouscam35875/google-trends-scraper) | Interest over time, related queries, regions |
| [Google SERP Scraper](https://apify.com/joyouscam35875/google-serp-scraper) | Organic results, People Also Ask, snippets |
| [Website Content Crawler](https://apify.com/joyouscam35875/website-content-crawler) | Clean Markdown for RAG and LLMs |
| [Instagram Profile Scraper](https://apify.com/joyouscam35875/instagram-profile-scraper) | Followers, bio, recent posts |
| [Trustpilot Reviews Scraper](https://apify.com/joyouscam35875/trustpilot-scraper) | Reviews, ratings, company replies |

# Actor input Schema

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

YouTube video URLs (watch, youtu.be, shorts) or bare 11-character video IDs.

## `maxCommentsPerVideo` (type: `integer`):

Top-level comments to collect per video. Set 0 for all comments (can be slow on huge videos).

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

Also fetch the replies under each collected comment. Replies count toward billing like comments.

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

Only used when Include replies is on. 0 = all replies.

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

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

## `language` (type: `string`):

Interface language code, e.g. en, fr, de. Affects relative dates like "2 days ago".

## `country` (type: `string`):

Country code, e.g. US, FR, DE.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxCommentsPerVideo": 100,
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "sortBy": "top",
  "language": "en",
  "country": "US"
}
```

# Actor output Schema

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

One row per comment or reply, with author, likes, flags and video stats.

# 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"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("joyouscam35875/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=dQw4w9WgXcQ"] }

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

```

## MCP server setup

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