# YouTube Comments & Replies Scraper

Extract comments and replies from YouTube videos by URL. Collect usernames, comment text, likes, publish time, and reply threads for analysis, research, or moderation.

- Template page: [https://www.octoparse.com/template/youtube-comments-replies-scraper](https://www.octoparse.com/template/youtube-comments-replies-scraper)
- Categories: Social Media
- Status: `PUBLISHED`
- Run mode: `CLOUD`

## Pricing

Current price: **$0.2/1,000 lines**. Billing is based on output rows; an Octoparse subscription may be required.

## What is an Octoparse template?

An Octoparse template is a ready-to-use scraping workflow with predefined inputs and structured outputs. Use the exact parameter keys below; do not invent parameters.

## Overview

This ready-to-use template collects structured data from comment pages.

## Output

The current workflow extracts 12 fields, including `CrawlTime`, `comment_time`, `comment_user`, `like_count`, `post_comment_count`, `post_like_count`, `reply_comment_time`, `reply_content`, `reply_count`, `reply_like_count`, `reply_user`, `video_url`.

## Use Cases

- Use structured results for research, comparison, and monitoring.
- Collect rows without building the extraction workflow from scratch.
- Combine results with other templates for downstream enrichment.
- Review a representative result before starting a large batch.

## Why Octoparse

- **No coding required:** complete Video URLs (up to 500 per run), Maximum Number of Comments (1–10,000), Maximum Number of Replies (0–100) and start the template in cloud mode.
- **Flexible export:** review and export results as CSV, Excel, or JSON.

## Input

### Video URLs (up to 500 per run)

Required. Enter one or multiple video URLs. Supports up to 500 URLs per run (one per line). Constraints: minItems=1; maxItems=500; items.minLength=1; items.maxLength=10000.

### Maximum Number of Comments (1–10,000)

Required. Set the maximum number of comments to extract for each video. Constraints: minimum=1, maximum=10000.

### Maximum Number of Replies (0–100)

Required. Set the maximum number of replies to extract per comment. Constraints: minimum=0, maximum=100.

## How to Use

# YouTube Comments & Replies Scraper

Use this template to collect top-level comments and replies from YouTube videos in bulk. It captures publicly visible comment threads and exports structured data.

## How to Use

1. **Start the template**  
   Click **"Try it!"** or **"Start"**.

2. **Enter scraping parameters**

| Parameter | Required? | Description | Example |
|---|---|---|---|
| Video URLs (up to 500 per run) | Yes | Enter one or multiple video URLs, one per line. Supports up to 500 URLs per run. | `https://youtube.com/watch?v=abc123` |
| Maximum Number of Comments (1–10,000) | Yes | Maximum number of comments to extract for each video. | `500` |
| Maximum Number of Replies (0–100) | Yes | Maximum number of replies to extract per comment. | `50` |

3. **Run the scraper**  
   Click **"Start"** and select a run mode. Greyed-out modes are not supported for this template. Octoparse automatically browses YouTube, loads results, scrolls pages, and extracts matching data.

4. **Monitor and handle interruptions**  
   Scraping duration varies with the number of results. If a CAPTCHA appears, pause the task, solve it manually, then resume.

5. **Export data**  
   When scraping completes, review the output and export results, e.g. as CSV or Excel.

## Important Notes

- Only public comments and replies can be scraped. Private, deleted, or restricted comments are not accessible. Private or unlisted videos, age-restricted content, and videos with disabled comments cannot be scraped.
- Large comment volumes may take longer; results depend on comment availability and loading limits.
- For high-volume videos:
  - Start with 1,000–2,000 comments to test extraction speed.
  - Set **"Maximum Number of Replies"** to 10–20 unless you need complete threads.
  - Use cloud extraction for longer runs.
  - Split viral videos across multiple runs or batches.
- Non-English comments are captured exactly as they appear on YouTube. Multilingual analysis may require translation or language detection during post-processing.
- Cloud runs may consume usage credits based on data volume. You pay for what you extract.

## Legal and Compliance

Scraping publicly available comment data is generally permitted for research, analysis, and business intelligence. Consider that YouTube's Terms of Service restrict certain automated access; personal data such as usernames linked to real identities may fall under GDPR/CCPA; commercial use of scraped data has additional restrictions.

See "[Is Web Scraping Legal](https://www.octoparse.com/blog/is-web-crawling-legal-well-it-depends)?" If handling EU user data, see the [GDPR compliance guide](https://www.octoparse.com/blog/gdpr-compliance-in-web-scraping).

## Limitations

Results depend on what the source site exposes at run time. Fields may be empty when a source page does not provide a value. The template enforces the input limits shown above.

## Tips

Use specific, valid inputs and review a representative result before starting a large batch. Remove duplicate inputs when repeated records are not needed.

## FAQ

### What do I need to enter?

Use the exact inputs and limits listed above.

### What data does this template return?

See Output Schema below; availability can vary by source record.

### How is usage billed?

See the Pricing section above for current pricing and billing details.

## Related Templates

- [YouTube Details & Comments Scraper (Free)](https://www.octoparse.com/template/youtube-details-comments-scraper-free)
- [YouTube Details & Comments Scraper](https://www.octoparse.com/template/youtube-details-comments-scraper)
- [YouTube Comments Scraper (Short Video)](https://www.octoparse.com/template/youtube-comments-scraper-shortvideo)

## Input Schema

```json
{
  "title": "YouTube Comments & Replies Scraper input",
  "description": "Input parameters configured for the current published template version.",
  "type": "object",
  "schemaVersion": 1,
  "additionalProperties": false,
  "properties": {
    "video_URLs": {
      "title": "Video URLs (up to 500 per run)",
      "description": "Enter one or multiple video URLs. Supports up to 500 URLs per run (one per line).",
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 10000
      },
      "minItems": 1,
      "maxItems": 500,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "maximum_Number_of_Comments": {
      "title": "Maximum Number of Comments (1–10,000)",
      "description": "Set the maximum number of comments to extract for each video.\n",
      "type": "integer",
      "minimum": 1,
      "maximum": 10000,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "maximum_Number_of_Replies": {
      "title": "Maximum Number of Replies (0–100)",
      "description": "Set the maximum number of replies to extract per comment.",
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "x-octoparse": {
        "apiEnabled": true
      }
    }
  },
  "required": [
    "video_URLs",
    "maximum_Number_of_Comments",
    "maximum_Number_of_Replies"
  ]
}
```

## Input JSON Example

Example 1

```json
{
  "maximum_Number_of_Comments": 10,
  "maximum_Number_of_Replies": 10,
  "video_URLs": [
    "https://www.youtube.com/watch?v=ku-N-eS1lgM",
    "https://www.youtube.com/watch?v=iFqDyWFuw1c",
    "https://www.youtube.com/watch?v=Pb6XHGi542A",
    "https://www.youtube.com/watch?v=9EGtawwvlNs",
    "https://www.youtube.com/watch?v=mci0f2dy7G0"
  ]
}
```

Example 2

```json
{
  "maximum_Number_of_Comments": 20,
  "maximum_Number_of_Replies": 3,
  "video_URLs": [
    "https://www.youtube.com/watch?v=LMjniLF8FZA"
  ]
}
```

Example 3

```json
{
  "maximum_Number_of_Comments": 20,
  "maximum_Number_of_Replies": 3,
  "video_URLs": [
    "https://www.youtube.com/watch?v=rng_yUSwrgU"
  ]
}
```

Example 4

```json
{
  "maximum_Number_of_Comments": 10000,
  "maximum_Number_of_Replies": 100,
  "video_URLs": [
    "https://www.youtube.com/watch?v=e6My6S_QFJk",
    "https://www.youtube.com/watch?v=6pz9Jg680gw",
    "https://www.youtube.com/watch?v=SRMUijiQ9Mo&pp=0gcJCccHAYcqIYzv",
    "https://www.youtube.com/watch?v=AmPwi9TLxOk",
    "https://www.youtube.com/watch?v=79Ldk59yQwM"
  ]
}
```

Example 5

```json
{
  "maximum_Number_of_Comments": 10,
  "maximum_Number_of_Replies": 2,
  "video_URLs": [
    "https://www.youtube.com/watch?v=xBBAD407zzU"
  ]
}
```


## Output Schema

```json
{
  "schemaVersion": 1,
  "type": "object",
  "properties": {
    "CrawlTime": {
      "type": "string",
      "description": ""
    },
    "comment_time": {
      "type": "string",
      "description": ""
    },
    "comment_user": {
      "type": "string",
      "description": ""
    },
    "like_count": {
      "type": "string",
      "description": ""
    },
    "post_comment_count": {
      "type": "string",
      "description": ""
    },
    "post_like_count": {
      "type": "string",
      "description": ""
    },
    "reply_comment_time": {
      "type": "string",
      "description": ""
    },
    "reply_content": {
      "type": "string",
      "description": ""
    },
    "reply_count": {
      "type": "string",
      "description": ""
    },
    "reply_like_count": {
      "type": "string",
      "description": ""
    },
    "reply_user": {
      "type": "string",
      "description": ""
    },
    "video_url": {
      "type": "string",
      "description": ""
    }
  },
  "title": "YouTube Comments & Replies Scraper output",
  "description": "Initial output fields derived from the current published implementation. Field descriptions are maintained by Data Center; production field names and types should be refreshed from recent successful runs.",
  "additionalProperties": false
}
```

## Output Example

Example 1

```json
{
  "CrawlTime": "Fri, 20 Nov 2026 08:04:53 GMT",
  "comment_time": "11 months ago",
  "comment_user": "@GordonGeko84",
  "like_count": "87",
  "post_comment_count": "254",
  "post_like_count": "2.9K",
  "reply_comment_time": "11 months ago",
  "reply_content": "Wow PC crowdidit",
  "reply_count": "2",
  "reply_like_count": "1",
  "reply_user": "@DominickZollinger-e3r",
  "video_url": "https://www.youtube.com/watch?v=iFqDyWFuw1c"
}
```

Example 2

```json
{
  "CrawlTime": "Fri, 20 Nov 2026 06:31:21 GMT",
  "comment_time": "9 months ago (edited)",
  "comment_user": "@XJ04861",
  "like_count": "41",
  "post_comment_count": "130",
  "post_like_count": "957",
  "reply_comment_time": "9 months ago (edited)",
  "reply_content": "Or if comparing 15 vs 17. No one literally needs buying every year for upgrading purposes.",
  "reply_count": "1",
  "reply_like_count": "9",
  "reply_user": "@nihtmare01",
  "video_url": "https://www.youtube.com/watch?v=LMjniLF8FZA"
}
```

Example 3

```json
{
  "CrawlTime": "Fri, 20 Nov 2026 06:24:11 GMT",
  "comment_time": "1 year ago",
  "comment_user": "@Ostap1974",
  "like_count": "13K",
  "post_comment_count": "5,822",
  "post_like_count": "176K",
  "reply_comment_time": "1 year ago",
  "reply_content": "Lol",
  "reply_count": "62",
  "reply_like_count": "105",
  "reply_user": "@vxnova1",
  "video_url": "https://www.youtube.com/watch?v=rng_yUSwrgU"
}
```

Example 4

```json
{
  "CrawlTime": "Fri, 20 Nov 2026 04:31:04 GMT",
  "comment_time": "2 weeks ago",
  "comment_user": "@umairyaseenjutt",
  "like_count": "1",
  "post_comment_count": "3",
  "post_like_count": "18",
  "reply_comment_time": "2 weeks ago (edited)",
  "reply_content": "Hi, sorry to hear that. Contact support@apify.com with your run link and a short description of what went wrong, and the support team will look into it.",
  "reply_count": "1",
  "reply_like_count": "1",
  "reply_user": "@Apify",
  "video_url": "https://www.youtube.com/watch?v=AmPwi9TLxOk"
}
```

Example 5

```json
{
  "CrawlTime": "Thu, 19 Nov 2026 07:31:26 GMT",
  "comment_time": "9 years ago",
  "comment_user": "@FileHorsecom",
  "like_count": "2",
  "post_comment_count": "22",
  "post_like_count": "45",
  "reply_comment_time": "9 years ago",
  "reply_content": "Thanks for your great support! By the way, we have released our new version now, see here http://www.octoparse.com/blog/new-version-641-released-octoparse/",
  "reply_count": "1",
  "reply_like_count": "1",
  "reply_user": "@Octoparsewebscraping",
  "video_url": "https://www.youtube.com/watch?v=xBBAD407zzU"
}
```

## API

`POST https://openapi.octoparse.com/api/agentTools/executeTask`

This is the OpenAPI Agent Tools `executeTask` endpoint. Authenticate with a Bearer token.

Request body:

`templateName` is the template slug; `parameters` is a JSON object string whose keys match Input Schema; `taskName`, `idempotencyKey`, and `maxCollectedRows` are optional.

Obtain a token:

```http
POST https://openapi.octoparse.com/token
Content-Type: application/json

{
  "username": "YOUR_USERNAME",
  "password": "YOUR_PASSWORD",
  "grant_type": "password"
}
```

Use `data.access_token` as `Authorization: Bearer <token>`. After starting, poll `getTaskStatus` and export with `exportData`.

```json
{
  "templateName": "youtube-comments-replies-scraper",
  "taskName": "YouTube Comments & Replies Scraper",
  "parameters": "{\"maximum_Number_of_Comments\":10,\"maximum_Number_of_Replies\":10,\"video_URLs\":[\"https://www.youtube.com/watch?v=ku-N-eS1lgM\",\"https://www.youtube.com/watch?v=iFqDyWFuw1c\",\"https://www.youtube.com/watch?v=Pb6XHGi542A\",\"https://www.youtube.com/watch?v=9EGtawwvlNs\",\"https://www.youtube.com/watch?v=mci0f2dy7G0\"]}"
}
```

## Python Example

```python
import json
import requests

OPENAPI_BASE = "https://openapi.octoparse.com"
ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"

parameters = json.loads("{\"maximum_Number_of_Comments\":10,\"maximum_Number_of_Replies\":10,\"video_URLs\":[\"https://www.youtube.com/watch?v=ku-N-eS1lgM\",\"https://www.youtube.com/watch?v=iFqDyWFuw1c\",\"https://www.youtube.com/watch?v=Pb6XHGi542A\",\"https://www.youtube.com/watch?v=9EGtawwvlNs\",\"https://www.youtube.com/watch?v=mci0f2dy7G0\"]}")

response = requests.post(
    f"{OPENAPI_BASE}/api/agentTools/executeTask",
    headers={
        "Authorization": f"Bearer {ACCESS_TOKEN}",
        "Content-Type": "application/json",
    },
    json={
        "templateName": "youtube-comments-replies-scraper",
        "taskName": "YouTube Comments & Replies Scraper",
        "parameters": json.dumps(parameters, ensure_ascii=False),
    },
    timeout=60,
)
print(response.status_code)
print(response.json())
```

## HTTP/cURL Example

```bash
curl -X POST "https://openapi.octoparse.com/api/agentTools/executeTask" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "templateName": "youtube-comments-replies-scraper",
  "taskName": "YouTube Comments & Replies Scraper",
  "parameters": "{\"maximum_Number_of_Comments\":10,\"maximum_Number_of_Replies\":10,\"video_URLs\":[\"https://www.youtube.com/watch?v=ku-N-eS1lgM\",\"https://www.youtube.com/watch?v=iFqDyWFuw1c\",\"https://www.youtube.com/watch?v=Pb6XHGi542A\",\"https://www.youtube.com/watch?v=9EGtawwvlNs\",\"https://www.youtube.com/watch?v=mci0f2dy7G0\"]}"
}
JSON
```

## MCP Setup

Connect an MCP-compatible AI client to `https://mcp.octoparse.com` using browser OAuth or an Octoparse API key. Find `youtube-comments-replies-scraper`, inspect its inputs, create a cloud task with the exact Input Schema keys, and export JSON results.

## Machine-readable Resources

- [Template contract](https://www.octoparse.com/templates/youtube-comments-replies-scraper.json)
- [Manifest](https://www.octoparse.com/templates/youtube-comments-replies-scraper-manifest.json)
