# YouTube Comments Scraper | Only New Comments (`h1018y/anvil-youtube-comments-scraper`) Actor

Scrapes YouTube comments and their replies: give it video links; get one row per comment or reply with text, author, channel id, likes, reply count, pinned and hearted flags, and the comment link. Same field names as the YouTube Comments Scraper, with an only-new mode.

- **URL**: https://apify.com/h1018y/anvil-youtube-comments-scraper.md
- **Developed by:** [ANVIL Tools](https://apify.com/h1018y) (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.81 / 1,000 results

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 | Only New Comments

**YouTube Comments Scraper** - YouTube comments with their replies right under them, the pinned and hearted ones marked, and only the new ones on a schedule.

### What does YouTube Comments Scraper do?

Each comment is followed by its replies (type = reply, replyToCid), the pinned comment and the creator's hearts are marked, every row has the author's channel id and a link to the comment, and onlyNew returns just the new or changed comments - same field names as the most used tool.

- Replies under each comment with replyToCid, capped by maxRepliesPerComment so threads do not eat the quota
- isPinned, hasCreatorHeart, authorIsVerified, authorChannelId and commentUrl on every row
- oldestCommentDate takes 2026-03-01 or '2 days', like the #1
- onlyNew returns only new comments or ones whose likes or replies changed
- Same input and output field names as the most used tool - switch by changing the actor id

### Who uses YouTube Comments Scraper, and for what

- Brands - watch new comments on their videos every hour with onlyNew
- Researchers - export comment threads with replies to CSV
- Creators - list pinned and hearted comments and top fans' channel ids

### What this YouTube Comments Scraper does that users of the usual tools ask for

- **Running it twice does not charge the same comments twice: with onlyNew a repeat run returns only what is new** - in the `changeType` field
- **Comment rows only, never video rows mixed in** - in the `cid` field

#### Switching takes one minute

The input and result field names are the ones the most used YouTube Comments Scraper has, so the input JSON your code already sends works unchanged and your pipeline reads the same fields - plus the new ones above.

### Why this YouTube Comments Scraper?

Tools that lose replies or break when YouTube changes its page lose scheduled users. This YouTube Comments Scraper checks every run and tells you plainly when a page could not be read, instead of returning empty or wrong rows.

### Data you get from YouTube Comments Scraper

Every result is one flat row with these fields (values from a real run):

| Field | Example |
|---|---|
| `comment` | Самый настоящий рикролл Самый настоящий рикролл |
| `cid` | UgxHa6X7KcY4vmY9mJB4AaABAg |
| `author` | @fusdo3255 |
| `authorChannelId` | UCsJ8bkMG9NX-aFeRqV3hhDA |
| `authorIsVerified` | false |
| `authorIsChannelOwner` | false |
| `videoId` | dQw4w9WgXcQ |
| `title` | Rick Astley - Never Gonna Give You Up (Official Video) (4K R... |
| `pageUrl` | https://www.youtube.com/watch?v=dQw4w9WgXcQ |
| `commentUrl` | https://www.youtube.com/watch?v=dQw4w9WgXcQ\&lc=UgxHa6X7KcY4v... |
| `commentsCount` | 2462085 |
| `replyCount` | 0 |
| `voteCount` | 1 |
| `hasCreatorHeart` | false |
| `isPinned` | false |
| `isEdited` | true |
| `type` | comment |
| `replyToCid` | null |
| `publishedTimeText` | 8 minutes ago |
| `changeType` | new |

### How to use YouTube Comments Scraper

1. Press **Start** - the form already holds an example that works.
2. Put in your own input (see the fields on the Input tab).
3. Run it once, or put it on an **Apify Schedule** (with **only new** on, where the form has it) to get just what is new every day; add a **webhookUrl** to get each run's rows sent to your own system, Zapier, Make or Slack.
4. Download the results as JSON, CSV or Excel, or send them to Google Sheets, Zapier, Make, the Apify API or an AI agent (Apify MCP server).

#### Input example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    }
  ],
  "maxComments": 10,
  "sortCommentsBy": "TOP_COMMENTS",
  "includeReplies": true,
  "maxRepliesPerComment": 3,
  "maxItems": 100000,
  "onlyNew": false,
  "useApifyProxy": true
}
```

#### Output example (a real run)

```json
[
  {
    "comment": "Самый настоящий рикролл\nСамый настоящий рикролл",
    "cid": "UgxHa6X7KcY4vmY9mJB4AaABAg",
    "author": "@fusdo3255",
    "authorChannelId": "UCsJ8bkMG9NX-aFeRqV3hhDA",
    "authorIsVerified": false,
    "authorIsChannelOwner": false,
    "videoId": "dQw4w9WgXcQ",
    "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
    "pageUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "commentUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=UgxHa6X7KcY4vmY9mJB4AaABAg",
    "commentsCount": 2462085,
    "replyCount": 0,
    "voteCount": 1,
    "hasCreatorHeart": false,
    "isPinned": false,
    "isEdited": true,
    "type": "comment",
    "replyToCid": null,
    "publishedTimeText": "8 minutes ago",
    "changeType": "new"
  },
  {
    "comment": "Got rickrolled in another video (someone else was dancing with the music) and that reminded me I hadn't watched this masterpiece in a while.",
    "cid": "Ugxwng9mvX-SZcXmfaR4AaABAg",
    "author": "@korsekil",
    "authorChannelId": "UCqbs4JIyWoPAdV_moniYvgw",
    "authorIsVerified": false,
    "authorIsChannelOwner": false,
    "videoId": "dQw4w9WgXcQ",
    "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
    "pageUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "commentUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=Ugxwng9mvX-SZcXmfaR4AaABAg",
    "commentsCount": 2462085,
    "replyCount": 0,
    "voteCount": 0,
    "hasCreatorHeart": false,
    "isPinned": false,
    "isEdited": false,
    "type": "comment",
    "replyToCid": null,
    "publishedTimeText": "26 minutes ago",
    "changeType": "new"
  }
]
```

One flat row per result.

### Built for pipelines

- **Field names never change** - fixes and new features only ever add fields, so your code keeps working.
- **Every row has the same shape** - a missing value is `null`, never a dropped field.
- **A plain status line** on every run - how many results, and on a problem what to change in the input - for your logs and for AI agents.
- **Runs on its own** - put it on an Apify Schedule and add a `webhookUrl`: each run's rows go straight to your system, Zapier, Make or Slack.

### How much does YouTube Comments Scraper cost?

You pay only per result (pay per event) - no monthly fee, no minimum, and the price per result is lower on Apify's Bronze, Silver and Gold plans. The exact price is on the **Pricing** tab. Apify's free plan credit is enough to try it on real input.

| You want | What you pay for |
|---|---|
| A quick test with the example | a few results |
| A daily scheduled run | only the rows that run returns |
| A big one-off export | the results delivered - set a maximum in the input |

### Also searched as

- youtube comment scraper
- youtube comments export
- youtube comments to csv
- youtube replies scraper
- youtube comment monitor

### FAQ

**Does YouTube Comments Scraper need a login, cookies or an API key?** No. It reads public pages only.

**Can I run YouTube Comments Scraper on a schedule?** Yes - with Apify Schedules; each run returns fresh rows.

**Can I call it from Python, JavaScript or an AI agent?** Yes - through the Apify API, the Apify client libraries or the Apify MCP server.

**Is it legal?** It collects only data anyone can see without logging in. You are responsible for using it within the source site's terms and data protection law (GDPR, CCPA).

**What if the site blocks a request?** The run retries from a fresh connection and, if it still cannot read the page, stops with a clear message - never with made-up rows.

**Do I need proxies?** No setup needed - YouTube Comments Scraper uses Apify Proxy by default where the site needs it.

### Troubleshooting

- **No results:** check the input (a public URL or a search term that returns results in a normal browser), then try the example input once.
- **Fewer results than expected:** raise the maximum in the input; some sites show only a part of their data without logging in, and YouTube Comments Scraper never logs in.
- **The run stopped with a message:** the message says what the site answered; run it again later or with fewer items.

### Your feedback

Missing a field, found a bug, or need another site? Open an issue on the **Issues** tab - issues are answered and fixed. If YouTube Comments Scraper saved you time, a short review on this page helps others find it.

Data source: [www.youtube.com](https://www.youtube.com)

### More tools from this developer

- [Tweet Scraper for Twitter & X Posts: By URL, No Login](https://apify.com/h1018y/anvil-tweet-scraper)
- [YouTube Thumbnail Downloader: Bulk, Every Size & Titles](https://apify.com/h1018y/anvil-youtube-thumbnail-downloader)
- [ML Conference Finder: NeurIPS, ICLR & ICML Alternatives](https://apify.com/h1018y/anvil-ml-conference-finder)
- [YouTube Transcript & Captions Scraper: Find Any Word Said](https://apify.com/h1018y/anvil-youtube-transcript-scraper)
- [Facebook Ads Library Scraper & Meta Ad Spy: Only New Ads](https://apify.com/h1018y/anvil-facebook-ads-library-scraper)
- [Twitter Scraper: New Tweets From Any X Account, No Login](https://apify.com/h1018y/anvil-twitter-scraper)
- [Facebook Page & Posts Scraper: New Posts & Engagement Growth](https://apify.com/h1018y/anvil-facebook-posts-scraper)
- [Google Trends Scraper: Rising Searches & Interest by Region](https://apify.com/h1018y/anvil-google-trends-scraper)

# Actor input Schema

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

YouTube video links (watch, youtu.be, shorts or live) or 11-character video ids. Example: https://www.youtube.com/watch?v=dQw4w9WgXcQ

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

Stops each video after this many rows (comments plus their replies). Example: 100.

## `sortCommentsBy` (type: `string`):

Top comments or newest first, as on YouTube. A date filter always uses newest first.

## `oldestCommentDate` (type: `string`):

Keep only comments newer than this date or age, written like 2026-03-01 or '2 days' (YouTube shows ages, so the cut is approximate).

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

Put the replies under each comment right after it (type = reply, replyToCid = the comment's cid).

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

How many replies of each comment are returned at most; 0 returns none. Example: 3.

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

Stops the whole run after this many rows over all videos. Example: 1000.

## `onlyNew` (type: `boolean`):

On a schedule: return only comments that are new, or whose likes or reply count changed, since the last run with the same input.

## `useApifyProxy` (type: `boolean`):

Switches to the Apify proxy when YouTube refuses the direct request. Keep it on for big jobs.

## `proxyGroups` (type: `array`):

Optional Apify proxy groups for that fallback, for example RESIDENTIAL. Empty uses the tool's default.

## `webhookUrl` (type: `string`):

Optional. An https address - your own system, Zapier, Make or a Slack incoming webhook - that gets each run's results as JSON (with 'only new' on: just the new ones). Example: https://hooks.slack.com/services/T000/B000/XXXX

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    }
  ],
  "maxComments": 10,
  "sortCommentsBy": "TOP_COMMENTS",
  "includeReplies": true,
  "maxRepliesPerComment": 3,
  "maxItems": 100000,
  "onlyNew": false,
  "useApifyProxy": true
}
```

# Actor output Schema

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

All result rows (open as table, JSON, CSV or Excel).

# 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": [
        {
            "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw"
        }
    ],
    "maxComments": 10,
    "sortCommentsBy": "TOP_COMMENTS",
    "useApifyProxy": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("h1018y/anvil-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": [{ "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw" }],
    "maxComments": 10,
    "sortCommentsBy": "TOP_COMMENTS",
    "useApifyProxy": True,
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,h1018y/anvil-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/36UK9cmdtzU8tQggh/builds/8IKH25Uj8nyd4Kq9J/openapi.json
