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

Fast YouTube comments scraper. Paste any video URLs and extract every comment plus full reply threads. Author handle, channel id, exact like count, reply count, hearted, pinned, verified, edited flags, published time. Direct InnerTube API reads, no browser. PPE pricing.

- **URL**: https://apify.com/cirkit/youtube-comments-scraper.md
- **Developed by:** [Crikit](https://apify.com/cirkit) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 10 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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.

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

**Scrape every YouTube comment** and full reply thread from any video URL. This **YouTube comments scraper** returns comment text, author handle and channel ID, exact like count, reply count, and the hearted, pinned, verified, and edited flags — with threading preserved through `parentCommentId` and `replyLevel`.

No YouTube API key, no login, and no headless browser. Results land in a structured dataset you can export to JSON, CSV, Excel, or XML, or pull straight from the Apify API.

### What is YouTube Comments Scraper?

YouTube Comments Scraper is an [Apify Actor](https://apify.com/actors) that extracts comments and full reply threads from [YouTube](https://www.youtube.com) and returns them as clean, structured records. Exact like counts are the detail that matters: YouTube's own interface abbreviates them to '1.2K', while this Actor returns the precise integer, which is what ranking and engagement analysis actually needs.

### What data can this YouTube comments scraper extract?

Every run writes one row per comment. Full field list:

| Field | Type | Description |
| --- | --- | --- |
| `videoId` | string | 11-character YouTube video ID the comment belongs to. |
| `videoUrl` | string | Canonical https://www.youtube.com/watch?v=... URL for the source video. |
| `commentId` | string | Stable YouTube comment id. Use as primary key. |
| `parentCommentId` | string | For replies, the id of the top-level comment they reply to. Null for top-level comments. |
| `replyLevel` | integer | 0 for top-level comments, 1 for replies. |
| `text` | string | Plain text rendered from the comment's runs (newlines preserved). |
| `publishedTimeRelative` | string | Free-text relative timestamp as YouTube shows it, for example '1 day ago' or '3 weeks ago (edited)'. |
| `isEdited` | boolean | True if the comment was edited after posting. |
| `likeCount` | integer | Exact integer like count parsed from the accessibility label. |
| `replyCount` | integer | Exact integer reply count. Always 0 on reply rows. |
| `authorChannelId` | string | Canonical channel ID (UC...) of the comment author. |
| `authorHandle` | string | Author @handle (without the @) parsed from the accessibility label, when present. |
| `authorDisplayName` | string | Author's display name as shown on the comment. |
| `authorThumbnailUrl` | string | Avatar image URL of the author. |
| `authorIsVerified` | boolean | True if the author's channel has the verified check. |
| `authorIsCreator` | boolean | True if the comment was posted by the video's channel. |
| `authorIsArtist` | boolean | True if the author is a YouTube Music verified artist. |
| `isHearted` | boolean | True if the video creator gave this comment the heart icon. |
| `isPinned` | boolean | True if the comment is pinned to the top of the comments section. Top-level only. |
| `scrapedAt` | string | ISO-8601 UTC timestamp when this comment was scraped. |

### How to scrape YouTube video comments

1. Open [YouTube Comments Scraper](https://apify.com/cirkit/youtube-comments-scraper) and click **Try for free**.
2. Paste video URLs into `videoUrls`.
3. Choose `sortBy` for top comments or newest first.
4. Turn on `includeReplies` and set `maxRepliesPerComment` for full threads.
5. Set `maxCommentsPerVideo` to bound each video.
6. Click **Start** and watch rows appear live in the **Output** tab.
7. Export the dataset as JSON, CSV, Excel, or XML — or fetch it from the [Apify API](https://docs.apify.com/api/v2) once the run finishes.

### YouTube Comments Scraper input options

| Input | Type | What it does | Default |
| --- | --- | --- | --- |
| `videoUrls` | array | Each entry can be a YouTube watch URL (https://www.youtube.com/watch?v=...), a Shorts URL, a youtu.be short link, or... | **yes** |
| `sortBy` | string | TOP returns YouTube's ranked order (default). NEWEST returns strict reverse-chronological. | `"TOP"` |
| `maxCommentsPerVideo` | integer | Hard cap on top-level comments per video. Leave empty for unlimited (the whole comment section). | `50` |
| `includeReplies` | boolean | If on, fetch the full reply thread under every top-level comment. Adds ~30% to runtime on average. | `true` |
| `maxRepliesPerComment` | integer | Hard cap on replies fetched per top-level comment. Leave empty for unlimited. | `10` |

Proxy is configured through the standard `proxyConfiguration` object; the defaults shipped with this Actor are already tuned for the target site.

### Example output

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/jNQXAC9IVRw",
    "dQw4w9WgXcQ"
  ],
  "sortBy": "TOP",
  "maxCommentsPerVideo": 500,
  "includeReplies": true,
  "maxRepliesPerComment": 50,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

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

This Actor runs on **pay per result** pricing: **$0.0015 per comment** ($1.5 per 1,000). A one-time start fee of $0.00005 applies per run.

| Results | Approximate cost |
| --- | --- |
| 1,000 | $1.50 |
| 10,000 | $15.00 |
| 100,000 | $150.00 |

You pay for rows you actually receive, so a search that returns nothing costs nothing beyond the start fee. Every Apify account includes free monthly usage credit, so you can trial YouTube Comments Scraper at no cost.

### What can you build with YouTube data?

#### Run audience sentiment analysis

Full comment text with like counts lets you weight sentiment by how much the audience actually endorsed each opinion rather than treating every comment equally.

#### Mine product feedback from review videos

Comments on product reviews are an unusually candid source of real user complaints and questions.

#### Find content ideas from audience questions

Comments phrased as questions map directly onto content your audience is telling you they want.

#### Monitor brand sentiment on third-party videos

Track comments on videos that mention your brand, including ones you did not publish.

#### Identify engaged community members

Author channel IDs plus like counts surface the people whose comments consistently resonate — natural candidates for community or advocacy programmes.

### YouTube scraping tips and limits

- `includeReplies` can multiply row count several times over on a heavily discussed video. Set `maxRepliesPerComment` unless you genuinely need every reply.
- Sorting by newest is the right choice for incremental monitoring; sorting by top is better for one-off sentiment snapshots.
- Comment authors are identifiable people. Strip handles and channel IDs if your analysis does not require them.
- Comments can be disabled per video. An empty result usually means comments are off rather than that the run failed.

### Integrations and automation

Run YouTube Comments Scraper on a [schedule](https://docs.apify.com/platform/schedules) to keep a YouTube dataset fresh, or trigger it from your own stack through the [Apify API](https://docs.apify.com/api/v2) and the official [JavaScript](https://docs.apify.com/sdk/js) and [Python](https://docs.apify.com/sdk/python) clients. Native [integrations](https://docs.apify.com/platform/integrations) push results into Google Sheets, Slack, Airtable, Zapier, Make, GitHub, or any webhook endpoint. The Actor also works as an [MCP](https://docs.apify.com/platform/integrations/mcp) tool, so an AI agent can call it directly.

### Related scrapers

| Actor | What it does |
| --- | --- |
| [YouTube Search Scraper](https://apify.com/cirkit/youtube-search-scraper) | Find the videos worth analysing. |
| [YouTube Channel Scraper](https://apify.com/cirkit/youtube-channel-scraper) | Channel profile and full video list. |
| [Reddit Comment Scraper - Posts, Threads & Replies API](https://apify.com/cirkit/reddit-comment-scraper) | The same discussion analysis on Reddit. |
| [Twitch Search & Streams Scraper](https://apify.com/cirkit/twitch-search-scraper) | Live-streaming audience data. |

### Frequently asked questions

#### Does it include replies, not just top-level comments?

Yes. With `includeReplies` on, replies come back as their own rows linked by `parentCommentId`, and `replyLevel` records the depth.

#### Are like counts exact?

Yes. YouTube's interface abbreviates large numbers, but this Actor returns the exact integer like count.

#### Do I need a YouTube API key?

No. YouTube Comments Scraper reads publicly available YouTube pages and endpoints directly, so there is no key to obtain, no OAuth app to register, and no account to connect.

#### Can I export YouTube data to CSV, Excel, or Google Sheets?

Yes. Every run stores results in an Apify dataset that exports to JSON, JSONL, CSV, Excel, XML, or HTML with one click, and the Google Sheets integration writes rows straight into a spreadsheet.

#### Can I run YouTube Comments Scraper on a schedule?

Yes. Apify schedules run the Actor hourly, daily, weekly, or on any cron expression, and webhooks can notify your systems the moment a run finishes.

#### Is it legal to scrape YouTube?

Scraping publicly available data is broadly lawful in the US and EU, but the answer depends on what you collect and how you use it. This Actor is built to gather public comment content YouTube displays publicly — comments are written by identifiable people, so treat author fields as personal data. Personal data carries extra obligations under GDPR and CCPA. Read Apify's guide on [whether web scraping is legal](https://blog.apify.com/is-web-scraping-legal/) and take your own legal advice for your use case.

### Support and feedback

Found a bug, a missing field, or a YouTube page shape this Actor does not handle yet? Open an issue from the **Issues** tab on the Actor page. Feature requests and custom-scraper enquiries are welcome there too.

# Actor input Schema

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

Each entry can be a YouTube watch URL (https://www.youtube.com/watch?v=...), a Shorts URL, a youtu.be short link, or a bare 11-character video ID. Each video is scraped independently.

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

TOP returns YouTube's ranked order (default). NEWEST returns strict reverse-chronological.

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

Hard cap on top-level comments per video. Leave empty for unlimited (the whole comment section).

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

If on, fetch the full reply thread under every top-level comment. Adds ~30% to runtime on average.

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

Hard cap on replies fetched per top-level comment. Leave empty for unlimited.

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

Datacenter proxy is sufficient for steady-state scraping. Switch to Residential if you see 429 throttles at very high volume.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "sortBy": "TOP",
  "maxCommentsPerVideo": 50,
  "includeReplies": true,
  "maxRepliesPerComment": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `items` (type: `string`):

All comments and replies extracted in the latest run.

## `itemsCsv` (type: `string`):

All comments and replies in CSV format.

## `itemsJson` (type: `string`):

All comments and replies in JSON format.

## `consoleRun` (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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ],
    "sortBy": "TOP",
    "maxCommentsPerVideo": 50,
    "includeReplies": true,
    "maxRepliesPerComment": 10,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("cirkit/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"],
    "sortBy": "TOP",
    "maxCommentsPerVideo": 50,
    "includeReplies": True,
    "maxRepliesPerComment": 10,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("cirkit/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"
  ],
  "sortBy": "TOP",
  "maxCommentsPerVideo": 50,
  "includeReplies": true,
  "maxRepliesPerComment": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call cirkit/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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