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

Scrape comments from any public YouTube video without a login. Pass video URLs or IDs and get clean structured comment rows with author, like and reply counts, and text. Walks pagination up to your chosen limit.

- **URL**: https://apify.com/goat255/youtube-comments-scraper.md
- **Developed by:** [Goutam Soni](https://apify.com/goat255) (community)
- **Categories:** Social media, Videos
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Comments Scraper

Scrape comments from any public YouTube video with no login and no API key. Pass video URLs or IDs and get clean, structured comment data: author, like count, reply count, full comment text, published time, and verified/creator flags. Pagination is walked automatically up to the limit you set.

### What it does

- **Extract comments by video.** Give it a watch link, a short link, a shorts link, or a bare 11 character video ID and it returns the full comment feed for that video.
- **Top or newest order.** Choose whether the most engaged comments or the most recent ones come first.
- **Deep pagination.** Walks page after page automatically until your `maxCommentsPerVideo` target is reached or the video runs out of comments.
- **Rich, normalized rows.** Every comment carries the author name, author channel, like count, reply count, whether the creator hearted it, verified and creator flags, published time, avatar, and the full comment text.
- **Multiple videos at once.** Queue a list of videos and process them in parallel.
- **Clean numeric counts.** Like and reply counts are returned as real integers (the original display form like "256K" is kept too).

No account, no password, no API key. Give it a list of videos and it returns structured rows ready for analysis or export to CSV, JSON, or Excel.

### Use cases

- **Audience research.** Read what viewers actually say under your videos or any channel in your niche to find recurring questions, objections, and language.
- **Sentiment and feedback monitoring.** Pull comments at scale to track reactions to a launch, a campaign, or a trending topic.
- **Lead generation.** Surface engaged commenters and their public channels for outreach lists.
- **Market and competitor analysis.** Mine the comment sections of videos in your market to understand demand, pain points, and what resonates.
- **Content ideation.** Find the most liked comments and the questions people ask most, then turn them into your next video or post.

### Input

| Field | Type | Description |
|---|---|---|
| `videos` | array | Video links or IDs to pull comments from. Full watch links, short links, shorts links, or bare 11 character IDs. Required. |
| `maxCommentsPerVideo` | integer | Cap on comments returned per video. Pagination is walked across pages until this is reached or the video has no more comments. Default 100. |
| `sortBy` | string | Comment order: `top` (most engaged first) or `newest` (most recent first). Default `top`. |
| `concurrency` | integer | How many videos to process in parallel. Default 5. |
| `proxyConfig` | object | Proxy settings. Residential proxy is the default and recommended option for the most reliable results. |

#### Example input

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/dQw4w9WgXcQ"
  ],
  "maxCommentsPerVideo": 500,
  "sortBy": "top"
}
````

### Output

Each comment is one row. Example:

```json
{
  "type": "comment",
  "commentId": "UgxExampleCommentId",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=UgxExampleCommentId",
  "videoId": "dQw4w9WgXcQ",
  "videoTitle": "Example video title",
  "channelTitle": "Acme Channel",
  "authorName": "@example_user",
  "authorChannelId": "UCexampleChannelId",
  "authorChannelUrl": "https://www.youtube.com/channel/UCexampleChannelId",
  "likeCount": 1024,
  "replyCount": 12,
  "isHearted": false,
  "authorIsVerified": false,
  "authorIsCreator": false,
  "text": "An example comment.",
  "authorAvatar": "https://example.com/avatar.jpg",
  "publishedTimeText": "2 months ago",
  "likeCountText": "1K",
  "scrapedAt": "2026-01-01T00:00:00.000Z"
}
```

#### Key fields

- **`text`** is the full comment body.
- **`likeCount`** and **`replyCount`** are real integers. `likeCountText` keeps the original abbreviated display value (for example "256K") when one is shown.
- **`isHearted`** is true when the video's creator hearted the comment.
- **`authorIsVerified`** and **`authorIsCreator`** flag verified accounts and the channel owner.
- **`authorChannelUrl`** links straight to the commenter's public channel, handy for building outreach lists.
- **`url`** opens the comment in context on the video.

### FAQ

**Do I need a login, account, or API key?**
No. This scraper reads public comments only. There is nothing to sign in to and no key to manage.

**How many comments can I get per video?**
Set `maxCommentsPerVideo` to whatever you need. Pagination is walked across as many pages as required to reach your target. If a video has fewer comments than your cap, you get everything available.

**Is it free?**
Running the scraper uses Apify platform usage and any proxy you select, billed through your Apify account. Check the pricing tab on this page for the current model.

**How fast is it?**
Comments are paged continuously, and you can process several videos in parallel with the `concurrency` setting. Throughput depends on how many comments you request and your proxy.

**Which video link formats are supported?**
Full watch links, short links, shorts links, embed links, and bare 11 character video IDs all work.

**Why are some comments missing?**
Comments are only returned for videos that have comments enabled. Videos with comments turned off, or with no comments, return no rows for that video.

**Can I export the data?**
Yes. Results can be downloaded as JSON, CSV, or Excel, or pulled through the Apify API and integrations.

### Related actors

Part of the scraper suite by goat255:

- [YouTube Channel Scraper](https://apify.com/goat255/youtube-channel-scraper) - a channel's videos with metadata.
- [YouTube Transcript Scraper](https://apify.com/goat255/youtube-transcript-scraper) - transcripts and captions.

# Actor input Schema

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

YouTube videos to pull comments from. Each entry is a full watch link, a short link, a shorts link, or a bare 11 character video ID. Example: https://www.youtube.com/watch?v=dQw4w9WgXcQ, https://youtu.be/dQw4w9WgXcQ, or dQw4w9WgXcQ.

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

Cap on comments returned per video. Pagination is walked across multiple pages until this is reached or the video has no more comments.

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

Comment order. Top puts the most engaged comments first. Newest puts the most recent first.

## `concurrency` (type: `integer`):

How many videos to process in parallel. Higher is faster but puts more load on proxies.

## `proxyConfig` (type: `object`):

Apify proxy. RESIDENTIAL is the default and recommended option for the most reliable results.

## Actor input object example

```json
{
  "videos": [
    "dQw4w9WgXcQ"
  ],
  "maxCommentsPerVideo": 100,
  "sortBy": "top",
  "concurrency": 5,
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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": [
        "dQw4w9WgXcQ"
    ],
    "proxyConfig": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("goat255/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": ["dQw4w9WgXcQ"],
    "proxyConfig": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("goat255/youtube-comments-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 '{
  "videos": [
    "dQw4w9WgXcQ"
  ],
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call goat255/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Comments Scraper",
        "description": "Scrape comments from any public YouTube video without a login. Pass video URLs or IDs and get clean structured comment rows with author, like and reply counts, and text. Walks pagination up to your chosen limit.",
        "version": "0.1",
        "x-build-id": "phCgSafiZDMfGYyB9"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/goat255~youtube-comments-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-goat255-youtube-comments-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/goat255~youtube-comments-scraper/runs": {
            "post": {
                "operationId": "runs-sync-goat255-youtube-comments-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/goat255~youtube-comments-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-goat255-youtube-comments-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": [
                    "videos"
                ],
                "properties": {
                    "videos": {
                        "title": "Video URLs or IDs",
                        "type": "array",
                        "description": "YouTube videos to pull comments from. Each entry is a full watch link, a short link, a shorts link, or a bare 11 character video ID. Example: https://www.youtube.com/watch?v=dQw4w9WgXcQ, https://youtu.be/dQw4w9WgXcQ, or dQw4w9WgXcQ.",
                        "default": [
                            "dQw4w9WgXcQ"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxCommentsPerVideo": {
                        "title": "Max comments per video",
                        "minimum": 1,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Cap on comments returned per video. Pagination is walked across multiple pages until this is reached or the video has no more comments.",
                        "default": 100
                    },
                    "sortBy": {
                        "title": "Sort order",
                        "enum": [
                            "top",
                            "newest"
                        ],
                        "type": "string",
                        "description": "Comment order. Top puts the most engaged comments first. Newest puts the most recent first.",
                        "default": "top"
                    },
                    "concurrency": {
                        "title": "Concurrency",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "How many videos to process in parallel. Higher is faster but puts more load on proxies.",
                        "default": 5
                    },
                    "proxyConfig": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify proxy. RESIDENTIAL is the default and recommended option for the most reliable results.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
