# YouTube Comment Scraper \[FAST] | Likes, Replies & Authors (`apizy/youtube-comment-scraper`) Actor

Turn any YouTube video's comments into a clean dataset. Pull comment text, authors, like counts, reply counts, and publish dates for up to 1,000 comments, great for sentiment analysis and audience research. Sort by top or newest. Pay $0.0005 per comment, only on success. Failures are 100% free.

- **URL**: https://apify.com/apizy/youtube-comment-scraper.md
- **Developed by:** [Apizy](https://apify.com/apizy) (community)
- **Categories:** Videos, Social media, Developer tools
- **Stats:** 4 total users, 2 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Comment Scraper

Scrape comments from any YouTube video and get the full comment text, author details, like counts, reply counts, publish dates, and engagement flags. Works on any video URL format and returns clean JSON in seconds.

You are only charged for comments that come back with real data. Failed requests and empty results are free.

### What does YouTube Comment Scraper do?

YouTube Comment Scraper pulls comment data directly from any YouTube video and turns it into a clean, structured dataset ready to use.

It can extract:

- Comment text and comment IDs
- Author name, channel URL, and profile image
- Like counts (normalized integer)
- Reply counts and whether a comment has replies
- Publish dates (raw string and `YYYY-MM-DD`)
- Engagement flags: pinned, edited, and reply status

### Why Scrape YouTube Comments?

A video's comment section is where the real audience reaction lives. Likes, replies, and timing together reveal what people actually think, which comments drive conversation, and how sentiment shifts as a video gains traction.

Here are some ways you could use this data:

- Run sentiment and feedback analysis on your own or competitor videos
- Surface the most-liked and most-discussed comments in any niche
- Monitor brand mentions and audience reactions over time
- Build datasets for NLP, sentiment models, or trend research
- Feed comment data into dashboards, spreadsheets, or automation tools

### How to Use

Scraping a YouTube video's comments takes about 10 seconds. No setup needed beyond the video URL.

1. Click **Try for free**
2. Enter the YouTube video URL, for example: `https://www.youtube.com/watch?v=dQw4w9WgXcQ`
3. Pick how many comments to fetch: 10, 20, 50, 100, 300, 500, or 1,000
4. Choose how to sort: **Top comments** or **Newest first**
5. Click **Run**
6. When done, preview or download your data from the Dataset tab

### Input

```json
{
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "maxComments": "100",
  "sortBy": "top"
}
````

#### Input Fields

| Field         | Type   | Default | Description                                                                                         |
| ------------- | ------ | ------- | --------------------------------------------------------------------------------------------------- |
| `videoUrl`    | string | none    | YouTube video URL **(required)**. Supports `watch?v=`, `youtu.be/`, `/shorts/`, and `/embed/` links |
| `maxComments` | string | `"20"`  | How many comments to scrape. Options: `10`, `20`, `50`, `100`, `300`, `500`, `1000`                 |
| `sortBy`      | string | `"top"` | Comment sort order. `top` for YouTube's ranked comments, `newest` for chronological order           |

### Output

Each comment is saved as one item in the Dataset. The run summary goes to the Key-Value Store under `OUTPUT`.

**Comment item**

```json
{
  "commentId": "UgxABC123def456",
  "text": "This is exactly what I needed, thank you!",
  "authorName": "Jane Doe",
  "authorChannelUrl": "https://www.youtube.com/@janedoe",
  "authorProfileImageUrl": "https://yt3.ggpht.com/ytc/abc123...",
  "publishedAt": "2026-06-24",
  "publishedAtRaw": "2 days ago",
  "likeCount": 1240,
  "replyCount": 18,
  "hasReplies": true,
  "isReply": false,
  "parentCommentId": null,
  "isPinned": false,
  "isEdited": false,
  "videoId": "dQw4w9WgXcQ"
}
```

**Run summary**

```json
{
  "summary": {
    "videoId": "dQw4w9WgXcQ",
    "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "videoTitle": "Rick Astley - Never Gonna Give You Up",
    "channelName": "Rick Astley",
    "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
    "viewCount": 1600000000,
    "totalCommentCount": 2300000,
    "successCount": 100,
    "failedCount": 0,
    "successRate": "100%",
    "totalCharged": 0.05,
    "startedAt": "2026-06-25T10:00:00.000Z",
    "finishedAt": "2026-06-25T10:00:05.000Z",
    "totalDurationSeconds": 5
  }
}
```

#### Output Fields

**Comment data**

| Field                   | Description                                                |
| ----------------------- | ---------------------------------------------------------- |
| `commentId`             | YouTube comment ID                                         |
| `text`                  | Full comment text                                          |
| `authorName`            | Display name of the comment author                         |
| `authorChannelUrl`      | Link to the author's channel                               |
| `authorProfileImageUrl` | Author's profile picture URL                               |
| `publishedAt`           | Publish date in `YYYY-MM-DD` format                        |
| `publishedAtRaw`        | Raw publish string from YouTube (e.g. `"2 days ago"`)      |
| `likeCount`             | Like count as an integer (`1240`, not `"1.2K"`)            |
| `replyCount`            | Number of replies on the comment                           |
| `hasReplies`            | `true` if the comment has at least one reply               |
| `isReply`               | `true` if the item is a reply to another comment           |
| `parentCommentId`       | ID of the parent comment, or `null` for top-level comments |
| `isPinned`              | `true` if the comment is pinned by the creator             |
| `isEdited`              | `true` if the comment was edited                           |
| `videoId`               | YouTube video ID the comment belongs to                    |

### Pricing

Pay per successfully scraped comment. Failed requests are free.

| Comments | Cost   | Est. time |
| -------- | ------ | --------- |
| 10       | $0.005 | ~2s       |
| 100      | $0.05  | ~5s       |
| 300      | $0.15  | ~15s      |
| 500      | $0.25  | ~20s      |
| 1,000    | $0.50  | ~40s      |

$0.0005 per comment.

For runs over 500 comments, set **No timeout** in Run options.

### Notes

- All video URL formats work: `watch?v=`, `youtu.be/`, `/shorts/`, and `/embed/`.
- Like counts are integers, not strings. `1240` instead of `"1.2K"`, ready to sort and filter without extra parsing.
- Sort by `top` to get YouTube's ranked comments, or `newest` to catch the freshest reactions first.
- Videos with comments disabled will return an error explaining no comment section was found.

### More Actors You Might Like

Built by the same team and backed by the same transparent pricing philosophy: no hidden attempts, no wasted credits, no charge for failed results.

| Actor                                                                                     | Description                                                                                                    |
| ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| [YouTube Video Scraper](https://apify.com/apizy/youtube-video-scraper)                    | Scrape every video from a channel with views, durations, thumbnails, and insights.                             |
| [YouTube Video Detail Scraper](https://apify.com/apizy/youtube-video-detail-scraper)      | Full video metadata: views, likes, comments, keywords, duration, and engagement insights.                      |
| [YouTube Channel Scraper](https://apify.com/apizy/youtube-channel-scraper)                | Channel profiles with subscriber counts, engagement rates, contact info, and links.                            |
| [YouTube Channel Scraper Fast](https://apify.com/apizy/youtube-channel-scraper-innertube) | Same channel data as Channel Scraper but significantly faster. Better for high-volume and large-scale lookups. |
| [YouTube Transcript Scraper](https://apify.com/apizy/youtube-transcript-scraper)          | Extract the full transcript from any YouTube video, with optional timestamps per segment.                      |

### Get in Touch

Have questions, need custom scraping solutions, or want to integrate with your existing stack? We're here to help!

- **Email:** apizy.studio@gmail.com

We build custom scraping solutions tailored to your specific needs that are fast, reliable, and transparent.

# Actor input Schema

## `videoUrl` (type: `string`):

YouTube video URL to scrape comments from.

## `maxComments` (type: `string`):

Number of comments to scrape per run.

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

How to sort the comments.

• Top comments — YouTube's default ranking. Combines like count, reply engagement, recency, and creator interactions (pinned/hearted). High-quality comments surface first even if they're older.

• Newest first — Chronological order, most recent comments first. Useful for monitoring live activity or catching fresh reactions.

## Actor input object example

```json
{
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "maxComments": "20",
  "sortBy": "top"
}
```

# Actor output Schema

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

Dataset containing one item per scraped comment.

## `output` (type: `string`):

Video info, success/fail counts, and total charge for this run.

## `pagination` (type: `string`):

Current page, total pages, and nextCursor to pass into the next run.

# 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 = {
    "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
};

// Run the Actor and wait for it to finish
const run = await client.actor("apizy/youtube-comment-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 = { "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }

# Run the Actor and wait for it to finish
run = client.actor("apizy/youtube-comment-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}' |
apify call apizy/youtube-comment-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=apizy/youtube-comment-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Comment Scraper [FAST] | Likes, Replies & Authors",
        "description": "Turn any YouTube video's comments into a clean dataset. Pull comment text, authors, like counts, reply counts, and publish dates for up to 1,000 comments, great for sentiment analysis and audience research. Sort by top or newest. Pay $0.0005 per comment, only on success. Failures are 100% free.",
        "version": "0.0",
        "x-build-id": "qWFhowOnYisHcHo6K"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/apizy~youtube-comment-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-apizy-youtube-comment-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/apizy~youtube-comment-scraper/runs": {
            "post": {
                "operationId": "runs-sync-apizy-youtube-comment-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/apizy~youtube-comment-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-apizy-youtube-comment-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "videoUrl"
                ],
                "properties": {
                    "videoUrl": {
                        "title": "Video URL",
                        "type": "string",
                        "description": "YouTube video URL to scrape comments from."
                    },
                    "maxComments": {
                        "title": "Max Comments",
                        "enum": [
                            "10",
                            "20",
                            "50",
                            "100",
                            "300",
                            "500",
                            "1000"
                        ],
                        "type": "string",
                        "description": "Number of comments to scrape per run.",
                        "default": "20"
                    },
                    "sortBy": {
                        "title": "Sort By",
                        "enum": [
                            "top",
                            "newest"
                        ],
                        "type": "string",
                        "description": "How to sort the comments.\n\n• Top comments — YouTube's default ranking. Combines like count, reply engagement, recency, and creator interactions (pinned/hearted). High-quality comments surface first even if they're older.\n\n• Newest first — Chronological order, most recent comments first. Useful for monitoring live activity or catching fresh reactions.",
                        "default": "top"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
