# YouTube Comments Scraper (`cliqtomedia/youtube-comments-scraper`) Actor

Get and export public YouTube comments and replies from video URLs or IDs. Choose Top or Newest order, set result limits, and download the table as JSON, CSV, or Excel. No YouTube API key or account is needed.

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

## Pricing

$0.80 / 1,000 stored comment or replies

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## YouTube Comments Scraper

YouTube Comments Scraper gets public comments and replies from YouTube videos.
Add one or more video URLs or video IDs, choose Top or Newest order, and set a
result limit. The Actor saves one row for each comment or reply in a results
table that you can download or use in other tools.

- Add up to 50 videos in one run.
- Get top-level comments, with optional replies.
- Keep comment IDs and reply links for easy matching.
- No Google API key, YouTube account, cookies, or browser setup is needed.

> **Independent tool:** This Actor is not made, approved, or sponsored by
> YouTube or Google.

### Quick start

1. Add at least one public YouTube video URL or 11-character video ID.
2. Choose **Top comments** or **Newest first**.
3. Set how many results you want. Turn on replies if you need them.
4. Start the Actor and open **Comments and replies** when it finishes.

This small example gets up to 20 top-level comments from one public video. It
uses Top order and does not load replies. The Actor selects the connection and
bounded safety settings automatically.

```json
{
  "startUrls": ["https://www.youtube.com/watch?v=aqz-KE-bpKQ"],
  "sort": "TOP",
  "maxComments": 20,
  "includeReplies": false
}
```

### Limits at a glance

The Actor accepts up to **10,000 saved results in one run**. This is the total
for all videos together. Top-level comments and replies both count. The number
you enter is a maximum, not a promise: a video may have fewer public comments,
or YouTube may stop showing more data.

| Input setting                      |       Default | Allowed maximum | What it controls                                                       |
| ---------------------------------- | ------------: | --------------: | ---------------------------------------------------------------------- |
| YouTube videos                     |             — |              50 | Videos in one run.                                                     |
| Maximum total results              |           100 |          10,000 | All saved comments and replies across all videos.                      |
| Top-level comments for each video  |        10,000 |          10,000 | Top-level comments from one video. Replies do not count here.          |
| Replies for each top-level comment |            50 |           1,000 | Replies from one comment when **Include replies** is on.               |
| Maximum requests for each video    |           600 |             600 | Managed safety ceiling for one video.                                  |
| Maximum requests for the run       |         2,000 |           2,000 | Managed safety ceiling across all videos.                              |
| Videos processed at once           |             1 |               4 | Managed at one for predictable pagination and proxy use.               |
| Maximum run time                   | 1,800 seconds |   1,800 seconds | Work time before the Actor saves its final report. This is 30 minutes. |

The Actor also stops after 256 MiB of downloaded source data. This fixed safety
limit cannot be changed in the Input form. If any safety limit is reached, the
Actor keeps the rows already saved and marks the result as partial.

Choose only **Maximum total results**: the Actor uses direct access below 4,000
and Residential US from 4,000 through 10,000, while keeping the release-tested
request, concurrency, and time ceilings. Residential traffic adds Apify
platform cost. If replies are on, replies use part of the same result total.

### Export YouTube comments and replies

Your results table (the Apify Dataset) contains one unique row for each saved
top-level comment or reply. Main fields include:

- comment text, likes, and the public author name and channel when available;
- video, comment, thread, and parent comment IDs;
- a clear `isReply` value and the reply's link to its parent comment;
- the order you selected and the position seen during this run;
- public signals such as pinned, hearted, creator, and edited when the source
  makes them clear;
- the display time shown by YouTube, such as `2 hours ago`.

The result keeps the time shown by YouTube, such as `10 days ago`, in
`publishedTimeText`. YouTube does not give this Actor the exact posting time, so
`publishedAt` is empty instead of showing a guessed exact date.

Example result:

```json
{
  "videoUrl": "https://www.youtube.com/watch?v=aqz-KE-bpKQ",
  "id": "ExampleComment01",
  "isReply": false,
  "text": "Helpful explanation. Thank you!",
  "likeCount": 7,
  "author": { "displayName": "Example Viewer" },
  "publishedTimeText": "2 hours ago",
  "publishedAt": null
}
```

Download the results table as JSON, CSV, or Excel in Apify. You can also read it
through the Apify API or send it to another tool.

### How charging works

You pay for each unique comment or reply that is saved. A reply is charged in
the same way as a top-level comment. Duplicate results, failed saves, and
results stopped before saving are not charged. Check the current price shown by
Apify before you start, and use the maximum spending setting when you need a
hard cost limit.

### Why you may get fewer comments than expected

The number you enter is a maximum, not a promise. You may get fewer results
because:

- the video has fewer public comments;
- comments are disabled, the video is unavailable, or access is restricted;
- replies are off or their separate limit is reached;
- the total result, request, time, data, or spending limit is reached;
- comments change while the Actor is working;
- YouTube blocks a request or changes the page data used by the Actor.

Open the run report (**Run summary**) after every run. It explains what happened
for each video, why collection stopped, and whether the result is complete
inside the chosen limits. Its technical record name is `RUN_SUMMARY`.

### What “complete” means

`COMPLETE_VISIBLE_SNAPSHOT` means the Actor reached the end of the public
comments it could see for the selected order during that run. It does **not**
mean every comment that has ever existed.

The Actor does not promise:

- deleted, hidden, held, spam, private, or member-only comments;
- live chat or comments that need a login;
- a fixed order or an exact historical record;
- an exact posting date;
- that direct access will never be blocked;
- permanent compatibility if YouTube changes its public page data.

YouTube can add, edit, reorder, hide, or delete comments while a run is in
progress. A pinned comment can also appear outside the normal Top or Newest
order. Results are a current public snapshot, not a permanent record.

### Input guide

#### Videos

`startUrls` accepts 1–50 values. You can use a raw 11-character video ID or a
supported HTTPS YouTube watch, `youtu.be`, Shorts, or live video URL. Duplicate
videos are processed once in the order first entered.

#### Order and result limits

- `sort`: `TOP` or `NEWEST`.
- `maxComments`: maximum total saved comments and replies across all videos.
  Allowed range: 1–10,000. Default: 100.
- `maxTopLevelCommentsPerVideo`: maximum top-level comments for each video.
  Allowed range: 1–10,000. Default: 10,000.
- `includeReplies`: turn reply collection on or off.
- `maxRepliesPerComment`: maximum replies for each saved top-level comment.
  Allowed range: 0–1,000. Default: 50.

Replies count toward `maxComments` and your charged results. They do not count toward
`maxTopLevelCommentsPerVideo`.

#### Automatically managed safety limits

- `maxRequestsPerVideo`: page loads and retries for one video. Range: 1–600.
  Default: 600.
- `maxTotalRequests`: page loads and retries across the run. Range: 1–2,000.
  Default: 2,000.
- `concurrency`: videos processed at the same time. Range: 1–4. Default: 1.
- `maxRunSeconds`: Actor work time. Range: 30–1,800 seconds. Default: 1,800.

These bounded fields remain in the JSON API for compatibility, but the visual
Input form hides them and keeps their stable defaults. More allowed work still
may not return more comments. The run can stop earlier because of its
source-data, result, reply, or maximum spending limit.

Connection selection is also automatic when `proxyConfiguration` is omitted:
direct below 4,000 requested results, and Residential US from 4,000 through
10,000. A validation run reached exactly 10,000 unique NEWEST rows with the
Residential setup; corrected Direct access was blocked around 4,780 rows on
the same control, so the threshold includes a safety buffer. Residential
traffic adds platform cost. A Residential session stays sticky for one video,
is isolated to one Actor run, and rotates after a block or transient transport
failure. An explicitly supplied legacy proxy object is still validated;
enabled empty groups are repaired to Residential US.

Invalid values, unsupported URLs, custom proxy URLs, and unknown input fields
are rejected before a YouTube request is made.

### Empty or partial results

First open **Run summary** and find the result code for the video:

- `COMMENTS_DISABLED`: the source clearly says comments are off.
- `ZERO_COMMENTS`: the source clearly returned no visible comments.
- `VIDEO_UNAVAILABLE` or `PRIVATE_OR_RESTRICTED`: the video cannot be read in
  the supported public mode.
- `AMBIGUOUS_EMPTY`: the Actor received no comments but could not prove why.
- `PARTIAL_LIMIT`: a result, request, time, data, reply, or spending limit
  stopped collection.
- `SOURCE_CHANGED` or `SOURCE_UNCLASSIFIED`: the source data was not in a form
  the Actor could safely understand.

An empty results table alone does not prove that a video has no comments.

### Privacy and allowed use

Public comment text, names, and channel details can still be personal data and
user-created content. Collect only data you are allowed to use. Keep it secure,
keep it only as long as needed, and handle valid correction or deletion
requests.

Do not use this Actor for harassment, stalking, doxxing, surveillance, mass
profiling, sensitive-trait guesses, spam, automated outreach, targeting minors,
or bypassing private, member-only, login, location, age, or moderation controls.
The Actor does not give you a license to republish comments.

See [Privacy, terms, and allowed use](docs/PRIVACY-TERMS-AND-ACCEPTABLE-USE.md)
and [Abuse prevention and operations](docs/ABUSE-AND-OPERATIONS.md). These
documents give practical risk guidance, not legal advice or a promise of legal
compliance.

### Troubleshooting

#### The run saved no rows

Open **Run summary**, check the code for each video, and confirm that the video
and its comments are public in a signed-out browser. Do not assume that an empty
table means zero comments.

#### The run stopped early

Check the stop reason and the result, request, time, data, reply, and maximum
spending limits. Raise only the relevant user setting and stay within its shown
maximum. Some data limits are fixed by the Actor and cannot be changed in the
Input form.

#### The source failed or changed

Do not repeat a large batch. Try one small public video. If it fails again, send
the safe support details below.

### Support

For normal technical support, use Apify Issues for Cliqto Media
(`CliqtoMedia`). No response-time promise is offered.

Send only:

- the Actor run ID and build ID;
- the UTC start time;
- the number of videos, selected order, limits, and reply setting;
- result codes, stop reasons, counters, and the safe error hash from the run
  summary.

Never send comment text, author data, screenshots with personal data, cookies,
API keys, authorization headers, raw responses, request bodies, page tokens,
session data, or proxy URLs. Do not place personal data in a public Issue. Use
the publisher's private contact for privacy or security reports.

### FAQ

#### Is this an official YouTube or Google tool?

No. It is an independent Actor. It is not made, approved, or sponsored by
YouTube or Google.

#### Does it use the official YouTube Data API?

No. It reads the public comments data used by YouTube's website. The technical
source name is InnerTube. This source is not a public, supported API.

#### Does this YouTube comment scraper need an API key?

No. The Actor does not accept your Google API key, account, OAuth token, or
cookies.

#### Can I export YouTube comments from multiple videos?

Yes. Add up to 50 supported public video URLs or IDs in one run. Duplicate
videos are processed once.

#### Can I download YouTube comments as CSV or Excel?

Yes. Open the Apify results table and download it as JSON, CSV, or Excel. Each
comment or reply is one row.

#### Can it get every comment or recover deleted comments?

No. It gets the public comments visible during the run and inside your limits.
It cannot recover deleted, hidden, held, private, or member-only comments.

#### Are replies included?

Only when `includeReplies` is on. Each parent comment has its own reply limit,
and every saved reply counts toward the total and charged results.

#### Why is `publishedAt` empty?

YouTube gives this Actor display text such as `2 hours ago` or `10 days ago`.
That text is rounded and changes with time. Turning it into an exact date would
add accuracy that YouTube did not provide. The Actor keeps the original text in
`publishedTimeText` and leaves `publishedAt` empty.

#### Can I use YouTube comments for analysis?

You can export the rows for research or analysis when you have the right to use
the data. The Actor does not run sentiment analysis, profile people, or add data
from other sources.

# Actor input Schema

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

Add 1–50 public videos. Use an 11-character video ID or a supported HTTPS watch, youtu.be, Shorts, or live video URL. Duplicate videos are processed once.

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

Choose the order shown by YouTube. A pinned comment can appear before other comments in either order.

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

The most comments and replies to save across all videos in this run. Both types count toward this number and the price. The Actor automatically selects safe request, time, concurrency, and connection settings for this limit. Runs requesting 4,000–10,000 results use Residential US proxy; smaller runs use a direct connection.

## `maxTopLevelCommentsPerVideo` (type: `integer`):

The most top-level comments to save for one video. Replies do not count here, but all saved rows still count toward Maximum total results. Leave 10,000 if you do not need a smaller limit for each video.

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

Turn this on to get replies after top-level comments. Replies need more requests and count toward the total results and price.

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

The most replies to save for one top-level comment. Set 0 to save no replies.

## `maxRequestsPerVideo` (type: `integer`):

Managed safety ceiling for one video. The visual Input form keeps the release-tested value automatically.

## `maxTotalRequests` (type: `integer`):

Managed safety ceiling for the whole run. The visual Input form keeps the release-tested value automatically.

## `concurrency` (type: `integer`):

Managed concurrency. The Actor processes one video at a time for predictable pagination and proxy use.

## `maxRunSeconds` (type: `integer`):

Managed run-time ceiling. The Actor keeps the release-tested 1,800-second limit and reserves time to save its report.

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

Managed automatically from Maximum total results. Runs below 4,000 use direct access; runs from 4,000 through 10,000 use the release-tested Residential US route. This hidden legacy field remains accepted for API compatibility.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=aqz-KE-bpKQ"
  ],
  "sort": "TOP",
  "maxComments": 100,
  "maxTopLevelCommentsPerVideo": 10000,
  "includeReplies": false,
  "maxRepliesPerComment": 50,
  "maxRequestsPerVideo": 600,
  "maxTotalRequests": 2000,
  "concurrency": 1,
  "maxRunSeconds": 1800
}
```

# Actor output Schema

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

One row for each unique saved top-level comment or reply.

## `runSummary` (type: `string`):

Shows the result for each video, why collection stopped, the limits used, and whether saved rows match charged results.

# 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": [
        "https://www.youtube.com/watch?v=aqz-KE-bpKQ"
    ],
    "includeReplies": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("cliqtomedia/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": ["https://www.youtube.com/watch?v=aqz-KE-bpKQ"],
    "includeReplies": False,
}

# Run the Actor and wait for it to finish
run = client.actor("cliqtomedia/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": [
    "https://www.youtube.com/watch?v=aqz-KE-bpKQ"
  ],
  "includeReplies": false
}' |
apify call cliqtomedia/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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