# YouTube Comments Scraper — Replies, Exact Likes, Top/Newest (`eliai/youtube-comments-extractor`) Actor

Extract YouTube video comments without API keys or cookies: top-level + replies, top or newest sort, exact like counts (not rounded), author channel IDs, batch videos. $0.0004 per comment — cheaper than comparable scrapers. Videos with disabled comments are never charged.

- **URL**: https://apify.com/eliai/youtube-comments-extractor.md
- **Developed by:** [Anthony Snider](https://apify.com/eliai) (community)
- **Categories:** Social media, Lead generation, Videos
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.40 / 1,000 extracted comments

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/platform/actors/running/actors-in-store#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 Extractor — Replies, Exact Likes, No API Key

Export YouTube comments to a clean dataset: one record per comment, top-level **and** replies,
sorted by **top** or **newest**, with **exact like counts** (not the rounded "56K" you see on
screen). No YouTube API key, no quota, no cookies, no proxy required.

### What you get

One record **per comment**:

```json
{
  "videoId": "dQw4w9WgXcQ",
  "commentId": "Ugzge340dBgB75hWBm54AaABAg",
  "parentId": null,
  "author": "@YouTube",
  "authorChannelId": "UCBR8-60-B28hp2BmDPdntcQ",
  "text": "can confirm: he never gave us up",
  "likeCount": 295000,
  "publishedTimeText": "1 year ago",
  "isReply": false,
  "replyCount": 961
}
```

Replies carry `parentId` and `isReply: true`, so you can rebuild full threads. After each video,
one summary record reports what happened:

```json
{ "videoId": "dQw4w9WgXcQ", "type": "summary", "ok": true,
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "commentsExtracted": 30, "requested": 30, "sort": "top", "tookMs": 2218 }
```

(Real output from a real run — that video, those fields.)

### Why this one

- **Exact like counts.** Parsed from YouTube's accessibility labels (`"56,394 likes"`), not the
  abbreviated display string, so `likeCount` is an integer you can actually sort on.
- **No duplicates, ever.** Records are deduplicated by `commentId` within the run.
- **Clean text.** Zero-width characters stripped, whitespace normalized.
- **Honest billing.** You are charged only for comment records actually delivered. Videos that
  fail (comments disabled, video private) produce a summary record with `ok: false` and an
  `error` — and are never charged.
- **Batch friendly.** Up to 50 videos per run; one failing video never stops the rest.

### Input

| Field | Default | Notes |
|---|---|---|
| `videoUrls` | — | Watch / youtu.be / shorts / embed URLs, or bare 11-char IDs. Max 50. |
| `maxCommentsPerVideo` | 100 | Cap 2000. Replies count toward it — it is your budget cap. |
| `sort` | `top` | `top` (YouTube's ranking) or `newest`. Note: a creator-pinned comment stays first even in `newest` — that is YouTube's own behavior. |
| `includeReplies` | `true` | Fetch reply threads under each comment. |
| `maxRepliesPerComment` | 10 | Cap 100. |

### Honest limits

- Comments come from YouTube's own web feed (InnerTube), not the official Data API. YouTube
  changes this surface occasionally; the client version we present is pinned and maintained. If
  extraction breaks after a YouTube change, expect a fix, not silence — but no forever-guarantee.
- `publishedTimeText` is YouTube's relative label ("7 days ago"), not an absolute timestamp —
  the feed does not expose exact dates.
- Like counts on brand-new comments can lag what the page shows by a few minutes (YouTube's own
  counters disagree with themselves at that horizon).
- Very large requests (2000 comments with replies) take a few minutes; ~100 comments with
  replies typically completes in well under a minute.

*Keywords: youtube comments scraper, export youtube comments, youtube comment extractor, scrape
youtube comments without api key, youtube replies scraper, youtube comment dataset.*

### Pricing

**$0.0004 per comment record delivered** — 1,000 comments cost $0.40. Measured against the category on 2026-08-07: apidojo/youtube-comments-scraper charges $0.0005 per comment **plus** $0.001 per video queried; streamers/youtube-comments-scraper (the most-used) charges $0.002 per result on the free plan and $0.0006–0.0015 on paid tiers. Videos that fail (comments disabled, private, deleted) produce an `ok: false` summary and are never charged.

### Use from code or AI agents

Run it from any HTTP client and get the comments back in the same call:

```bash
curl -X POST "https://api.apify.com/v2/acts/eliai~youtube-comments-extractor/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"], "maxCommentsPerVideo": 100}'
```

Or with the Apify JS client:

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('eliai/youtube-comments-extractor').call({
  videoUrls: ['dQw4w9WgXcQ'], sort: 'newest', maxCommentsPerVideo: 500,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

AI agents can call this actor as a tool through [Apify's MCP server](https://mcp.apify.com) — an MCP-enabled agent can discover it, read the input schema, and pull comment datasets autonomously.

### FAQ

**How do I export YouTube comments to CSV or Excel?** Run the actor, then download the dataset as CSV, Excel, JSON, or JSONL from the run's Storage tab — or request the dataset API with `format=csv`.

**Do I need a YouTube API key or Google Cloud project?** No. Extraction reads YouTube's own web feed — no API key, no quota, no cookies, no proxy required.

**Can it scrape replies, not just top-level comments?** Yes — `includeReplies` is on by default. Replies carry `parentId` and `isReply: true`, so you can rebuild full threads.

**Are the like counts exact?** Yes — parsed from YouTube's accessibility labels ("56,394 likes"), not the rounded "56K" shown on screen, so `likeCount` is an integer you can sort on.

**How many comments can I get from one video?** Up to 2,000 records per video per run, replies included. `maxCommentsPerVideo` is also your budget cap since billing is per comment delivered.

**Can I get the newest comments instead of the top ones?** Set `sort` to `newest`. One YouTube quirk to know: a creator-pinned comment stays first even in newest — that is YouTube's own ordering.

**Does it work on YouTube Shorts?** Yes — watch, youtu.be, shorts, and embed URLs all work, as do bare 11-character video IDs.

# Actor input Schema

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

YouTube videos to extract comments from — watch, youtu.be, shorts, or embed URLs. Bare 11-character video IDs work too. Up to 50 videos per run.

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

Total comment records per video, replies included. You are charged per comment actually delivered, so this is also your budget cap.

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

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

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

Fetch reply threads under each top-level comment. Replies carry parentId so you can rebuild the thread.

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

Cap on replies fetched under each top-level comment.

## Actor input object example

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

# Actor output Schema

## `results` (type: `string`):

Every item this run produced, as JSON.

## `resultsCsv` (type: `string`):

The same items as a spreadsheet-ready CSV.

# 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("eliai/youtube-comments-extractor").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("eliai/youtube-comments-extractor").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 eliai/youtube-comments-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,eliai/youtube-comments-extractor"
        }
    }
}

```

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/4Tse93JPscfGjr3OZ/builds/6dbzuAewfOmHHvAO6/openapi.json
