# YouTube Comments Scraper - Replies, Likes & Sort by Newest (`tenfoldfleet/youtube-comments-scraper`) Actor

Get the comments of a YouTube video with replies, likes, reply counts and author channel, sorted by top or newest. Bulk videos and Shorts: text, author, channel ID, verified, creator, pinned and hearted flags. $0.60 per 1,000 comments; videos without comments and failures are free.

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

## Pricing

from $0.60 / 1,000 comment scrapeds

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

### What does YouTube Comments Scraper do?

**YouTube Comments Scraper** gets the **comments and replies of any YouTube video** or Short, in bulk, through a simple **API**. Paste video URLs from [YouTube](https://www.youtube.com) and get every comment's text, author, author channel ID, like count, reply count, publish time and the **pinned** and **hearted** flags, sorted by **top comments** or **newest first**.

It uses plain HTTP requests (no browser), so it is fast and cheap: you pay **$0.60 per 1,000 comments**, and videos without comments, videos with comments turned off and failed videos are free.

### Why use this YouTube comments scraper?

- **Audience research and sentiment analysis**: feed real viewer opinions into a spreadsheet, BI tool or LLM.
- **Brand and product monitoring**: track what people say under reviews, launches and sponsored videos, newest first.
- **Creator analytics**: see which comments the creator pinned, hearted or replied to (creator replies are flagged).
- **Lead and community insight**: find the most liked questions and complaints, with the author's channel link.
- **AI training and RAG datasets**: clean comment text with stable comment IDs, deduplicated.

### What data can it extract?

| Field | Example |
|---|---|
| `text` | can confirm: he never gave us up |
| `author`, `authorChannelId`, `authorChannelUrl` | @YouTube, UCBR8-60-B28hp2BmDPdntcQ |
| `likeCount`, `replyCount` | 323000, 962 |
| `publishedTime`, `isEdited` | 1 year ago, false |
| `isPinned`, `isHearted` | true, true |
| `authorIsVerified`, `authorIsChannelOwner` | true, false |
| `isReply`, `parentCommentId` | false, null |
| `commentId`, `commentUrl` | direct link to the comment |
| `videoId`, `videoTitle`, `videoChannel`, `videoCommentCount` | video context on every row |

### How to scrape YouTube comments

1. Open the Actor and paste one or more YouTube video or Shorts URLs (or 11-character video IDs).
2. Set **Max comments per video** and choose **Top comments** or **Newest first**.
3. Turn on **Include replies** if you want reply threads, and set the max replies per comment.
4. Click **Start**, then download the comments as JSON, CSV or Excel, or read them through the API.

### How much does it cost to scrape YouTube comments?

Pay per result: **$0.0006 per comment or reply ($0.60 per 1,000 comments)**, plus a tiny $0.00005 start fee per run. There is no per-video fee and no extra fee for reply threads. Videos with no comments, comments turned off, private or removed videos and any failed request are **free**. Set a maximum cost per run and the Actor stops cleanly when it is reached.

### Input

```json
{
    "videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ", "https://www.youtube.com/shorts/vVTa1_hm4n4"],
    "maxComments": 100,
    "sortBy": "newest",
    "includeReplies": true,
    "maxRepliesPerComment": 20
}
```

### Output

One row per comment or reply. Replies follow their parent comment. You can download the dataset as JSON, CSV, Excel, XML or HTML.

```json
{
    "videoId": "dQw4w9WgXcQ",
    "videoTitle": "Rick Astley - Never Gonna Give You Up",
    "videoCommentCount": 2458225,
    "sortBy": "top",
    "commentId": "Ugzge340dBgB75hWBm54AaABAg",
    "parentCommentId": null,
    "isReply": false,
    "text": "can confirm: he never gave us up",
    "author": "@YouTube",
    "authorChannelId": "UCBR8-60-B28hp2BmDPdntcQ",
    "authorChannelUrl": "https://www.youtube.com/@YouTube",
    "authorIsVerified": true,
    "authorIsChannelOwner": false,
    "likeCount": 323000,
    "replyCount": 962,
    "publishedTime": "1 year ago",
    "isEdited": false,
    "isPinned": true,
    "isHearted": true,
    "commentUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=Ugzge340dBgB75hWBm54AaABAg",
    "error": null
}
```

Videos that cannot be scraped return one free row with an `error` message (for example "Comments are turned off for this video. Not charged.").

### Tips

- **Newest first** is the best choice for monitoring: schedule the Actor daily with a small max comments value.
- Like counts above 1,000 are rounded by YouTube itself (for example 323K becomes 323000).
- `maxComments` includes replies, so raise it when you turn on replies.
- Comments are deduplicated by `commentId`, so the pinned comment never appears twice.

### FAQ

#### Can I scrape comments from YouTube Shorts?

Yes. Paste the Shorts URL (youtube.com/shorts/...) like any other video.

#### Can I scrape all comments of a channel or playlist?

Not directly. Paste the individual video URLs; channel and playlist URLs return a free error row.

#### Do I need a YouTube account, cookies or an API key?

No. The Actor reads public comments only, without logging in.

#### Why did a video return an error?

The video may be private, removed, age-restricted or have comments turned off. These rows are never charged.

### Disclaimer

This Actor extracts only publicly available comments. Comments can contain personal data protected by GDPR and other laws. Do not scrape personal data unless you have a legitimate reason, and check with your lawyer if you are unsure. YouTube is a trademark of Google LLC; this Actor is not affiliated with or endorsed by YouTube or Google.

### More tools from Tenfold Fleet

| Actor | Price |
|---|---|
| [ATS Jobs Scraper - Greenhouse, Lever, Ashby & 5 More](https://apify.com/tenfoldfleet/ats-jobs-scraper) | $2 per 1,000 (job posting) |
| [Website Contact Scraper - Emails, Phones & Socials](https://apify.com/tenfoldfleet/company-contact-finder) | $8 per 1,000 (website with contacts) |
| [Google Ads Transparency Center Scraper - Competitor Ads by Site](https://apify.com/tenfoldfleet/google-ads-transparency-scraper) | $1 per 1,000 (ad scraped) |
| [Google News Scraper - Articles, Real URLs & Full Text](https://apify.com/tenfoldfleet/google-news-scraper) | $2 per 1,000 (article) |
| [Keyword Search Volume, CPC & Difficulty Checker (Bulk)](https://apify.com/tenfoldfleet/keyword-search-volume) | $5 per 1,000 (keyword with data) |
| [Remote Jobs Aggregator - RemoteOK, WWR, Himalayas & 4 more](https://apify.com/tenfoldfleet/remote-jobs-aggregator) | $1.2 per 1,000 (unique remote job) |
| [SEO Audit Tool - Technical On-Page SEO Checker & Score](https://apify.com/tenfoldfleet/seo-audit-tool) | $20 per 1,000 (page audited) |
| [Shopify Products Scraper - Prices, Variants & Stock](https://apify.com/tenfoldfleet/shopify-products-scraper) | $0.8 per 1,000 (product) |
| [Shopify App & Theme Detector - Store Analyzer & Contacts](https://apify.com/tenfoldfleet/shopify-store-analyzer) | $8 per 1,000 (shopify store analyzed) |
| [Sitemap URL Extractor - All URLs from sitemap.xml & robots.txt](https://apify.com/tenfoldfleet/sitemap-url-extractor) | $0.4 per 1,000 (url extracted) |
| [Technology Detector - Wappalyzer & BuiltWith Alternative](https://apify.com/tenfoldfleet/tech-stack-detector) | $10 per 1,000 (website analyzed) |
| [URL to Markdown - Web Page to LLM-Ready Text for AI Agents](https://apify.com/tenfoldfleet/url-to-markdown) | $1 per 1,000 (page converted) |
| [Workday Jobs Scraper - myworkdayjobs.com API with Salary](https://apify.com/tenfoldfleet/workday-jobs-scraper) | $1.5 per 1,000 (job posting) |
| [YouTube Transcript Scraper - Captions & Subtitles API](https://apify.com/tenfoldfleet/youtube-transcript-scraper) | $3 per 1,000 (transcript extracted) |

# Actor input Schema

## `videos` (type: `array`):

Videos to get comments from: watch URLs, youtu.be links, Shorts URLs or bare 11-character video IDs. Channel and playlist URLs are not supported.

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

Maximum number of comments (replies included) to return per video. You pay only for comments returned.

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

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

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

Also return replies to each comment, right after their parent comment. Replies count toward the max comments per video.

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

When replies are included: the maximum number of replies to return for each top-level comment.

## `maxConcurrency` (type: `integer`):

How many videos to scrape in parallel.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/shorts/vVTa1_hm4n4"
  ],
  "maxComments": 50,
  "sortBy": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "maxConcurrency": 5
}
```

# Actor output Schema

## `results` (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 = {
    "videos": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://www.youtube.com/shorts/vVTa1_hm4n4"
    ],
    "maxComments": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("tenfoldfleet/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 = {
    "videos": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://www.youtube.com/shorts/vVTa1_hm4n4",
    ],
    "maxComments": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("tenfoldfleet/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 '{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/shorts/vVTa1_hm4n4"
  ],
  "maxComments": 50
}' |
apify call tenfoldfleet/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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