# ⚡Reddit Comments Scraper (`mikolabs/reddit-comments-scraper`) Actor

Extract complete Reddit comment threads, nested reply trees, author karma, upvotes, and AI sentiment analysis from any Reddit post URL or Post ID. Download clean, structured JSON/CSV records for market research, sentiment analysis, customer feedback discovery, and competitive intelligence.

- **URL**: https://apify.com/mikolabs/reddit-comments-scraper.md
- **Developed by:** [Mikolabs](https://apify.com/mikolabs) (community)
- **Categories:**
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 results

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

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Reddit Comments Scraper — Extract Discussion Trees, Replies & Sentiment

Extract complete Reddit comment threads, nested reply trees, author karma, upvotes, and AI sentiment analysis from any Reddit post URL or Post ID. Download clean, structured JSON/CSV records for market research, sentiment analysis, customer feedback discovery, and competitive intelligence.

### Overview

Reddit Comments Scraper is a purpose-built data extraction tool designed specifically to collect public discussion comments and nested reply hierarchies from [Reddit](https://www.reddit.com/). Simply provide one or more Reddit post links or post IDs, and the actor will extract all discussion comments with full conversation context.

Each record includes comment body text, author username, upvote score, nesting depth, timestamp, canonical URL, parent post details (title, post author, post score, subreddit), and optional AI sentiment scoring (`positive`, `negative`, `neutral`, `mixed`, `uncertain`).

***

### Why Use Reddit Comments Scraper

- **Customer Feedback & Product Review Mining**: Discover real user complaints, unsolicited opinions, and feature requests directly from product-related Reddit threads.
- **Brand Sentiment Analysis**: Monitor brand perception and opinion trends across discussions with built-in AI sentiment analysis.
- **Q\&A & Community Knowledge Gathering**: Extract expert answers, tutorials, and community advice from educational and support subreddits (e.g. `r/AskReddit`, `r/learnprogramming`).
- **Competitive Intelligence**: Analyze what users love or hate about competitor offerings in open discussions.
- **LLM Training & Discourse Datasets**: Collect structured conversation trees and dialogue pairs for AI fine-tuning and natural language processing.

***

### Pricing & Plans (No Hidden Fees)

Transparent and predictable pricing with **no extra proxy costs, no setup fees, and no hidden maintenance charges**.

#### Tiered Pricing Structure

| Tier / Discount Level | Price per 1,000 Comments | Effective Savings | Minimum Scrape |
| :--- | :--- | :--- | :--- |
| **No Discount (Standard / Pay-As-You-Go)** | **$4.00 / 1,000 items** | Standard Rate | 1 item |
| **🥉 Bronze Discount** | **$2.00 / 1,000 items** | **50% OFF** | 20 items |
| **🥈 Silver Discount** | **$1.80 / 1,000 items** | **55% OFF** | 20 items |
| **🥇 Gold Discount** | **$1.60 / 1,000 items** | **60% OFF** | 20 items |

#### Plan Comparison

| Feature | Free Tier | Subscriber / Paid Tier |
| :--- | :--- | :--- |
| **Free Daily Allowance** | **20 comments / run (4 runs / day free)** | Unlimited |
| **Pricing** | $4.00 / 1,000 results (or free allowance) | **Down to $1.60 / 1,000 results** |
| **Additional Fees** | **$0.00 (No extra fees)** | **$0.00 (No extra fees)** |
| **Proxy / Bandwidth Costs** | Included ($0.00) | Included ($0.00) |
| **Full Nested Reply Trees** | ✅ | ✅ |
| **AI Sentiment Analysis** | ✅ | ✅ |
| **Parent Post Details Attached** | ✅ | ✅ |
| **Granular Filters** | ✅ | ✅ |
| **Run Summary Dashboard** | ✅ | ✅ |

*Free users can extract up to 20 comments per run (4 runs/day) completely free. Upgrade for volume discounts down to $1.60 / 1,000 comments with zero hidden fees.*

***

### How to Use — Step by Step

1. **Provide Reddit Post URLs**: Paste one or more Reddit post links into the `Reddit Post URLs` input field (e.g. `https://www.reddit.com/r/technology/comments/...`).
2. **Choose Sort Order**: Select your preferred comment sorting method (`confidence` for Best, `top` for most upvoted, `new` for latest, or `controversial`).
3. **Configure Depth & Limits**: Set `Max Comments per Post` and optional `Max Nesting Depth` (set to `0` for top-level only, or `-1` for full tree).
4. **Enable AI Sentiment (Optional)**: Toggle `AI Sentiment Analysis` to automatically classify comment tone.
5. **Click Start**: Download results in JSON, CSV, Excel, XML, or HTML table format.

***

### Input Parameters

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `urls` | string\[] | – | List of Reddit post URLs to scrape comments from. |
| `postIds` | string\[] | – | Optional list of Reddit post IDs (e.g. `1hvoazn`). |
| `commentsSort` | string | `confidence` | Comment ranking order: `confidence` (Best), `top`, `new`, `controversial`, `old`, `qa`. |
| `maxCommentsPerPost` | integer | `100` | Maximum comments to extract per post thread. |
| `maxTotalComments` | integer | `500` | Safety cap for total comment records across all posts. |
| `depthLimit` | integer | `-1` | Maximum reply nesting depth (`-1` for unlimited, `0` for top-level only). |
| `includePostMetadata` | boolean | `true` | Include parent post title, post author, post score, and subreddit in each comment row. |
| `sentiment_analysis` | boolean | `false` | Adds `sentiment_score`, `sentiment_confidence`, and `sentiment_label` to each comment. |
| `minScore` | integer | – | Only keep comments with at least this upvote score. |
| `textContains` | string | – | Only keep comments containing this keyword. |
| `excludeKeywords` | string\[] | – | Exclude comments containing any of these keywords. |
| `authorContains` | string | – | Only keep comments from authors matching this substring. |
| `excludeAuthors` | string\[] | `["AutoModerator"]` | Exclude comments from these usernames. |

***

### Example Output: Comment Record

```json
{
    "kind": "comment",
    "id": "m5un6bj",
    "postId": "1hvoazn",
    "postUrl": "https://www.reddit.com/r/Baking/comments/1hvoazn/my_best_cheesecake_so_far/",
    "parentId": "t3_1hvoazn",
    "body": "This looks absolutely incredible! Can you share the full recipe?",
    "author": "BakingFanatic",
    "score": 76,
    "subreddit": "Baking",
    "created_utc": "2025-01-07T10:13:48.000Z",
    "url": "https://www.reddit.com/r/Baking/comments/1hvoazn/my_best_cheesecake_so_far/m5un6bj/",
    "permalink": "/r/Baking/comments/1hvoazn/my_best_cheesecake_so_far/m5un6bj/",
    "depth": 0,
    "is_submitter": false,
    "sentiment_score": 3,
    "sentiment_label": "positive",
    "sentiment_confidence": 0.91,
    "sentiment_score_normalized": 0.92,
    "post_title": "My best cheesecake so far",
    "post_author": "ClearlyBulky",
    "post_score": 3489,
    "post_num_comments": 43,
    "post_subreddit": "Baking",
    "post_created_utc": "2025-01-07T10:09:56.000Z"
}
```

***

### API Access

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("YOUR_ACTOR_ID").call(run_input={
    "urls": ["https://www.reddit.com/r/technology/comments/example/"],
    "commentsSort": "top",
    "maxCommentsPerPost": 100,
    "sentiment_analysis": True,
    "includePostMetadata": True,
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"[{item.get('sentiment_label')}] {item['author']}: {item['body'][:80]}...")
```

***

### Support

For help or feature requests, use the **Issues** tab on the actor page in Apify Console.

# Actor input Schema

## `urls` (type: `array`):

Links to Reddit posts or comment permalinks.

## `postIds` (type: `array`):

Optional list of Reddit post IDs (e.g. '1hvoazn') without full URLs.

## `commentsSort` (type: `string`):

Ranking order to fetch comments.

## `maxCommentsPerPost` (type: `integer`):

Maximum number of comments to extract per post thread.

## `maxTotalComments` (type: `integer`):

Safety ceiling for total comment records across all posts.

## `depthLimit` (type: `integer`):

Limit how deep into the reply tree to crawl. Set to 0 for top-level comments only, 1 for direct replies, or -1 for unlimited.

## `includePostMetadata` (type: `boolean`):

When enabled, includes parent post title, post author, post score, and subreddit metadata on each comment row.

## `sentiment_analysis` (type: `boolean`):

Adds sentiment score, confidence, and label (positive, negative, neutral, mixed, uncertain) to each comment.

## `minScore` (type: `integer`):

Only keep comments with at least this score.

## `textContains` (type: `string`):

Only keep comments containing this keyword in the body.

## `excludeKeywords` (type: `array`):

Exclude comments containing any of these keywords.

## `authorContains` (type: `string`):

Only keep comments from authors matching this substring.

## `excludeAuthors` (type: `array`):

Exclude comments from these usernames (e.g. 'AutoModerator').

## Actor input object example

```json
{
  "urls": [
    "https://www.reddit.com/r/Baking/comments/1hvoazn/my_best_cheesecake_so_far/"
  ],
  "commentsSort": "confidence",
  "maxCommentsPerPost": 100,
  "maxTotalComments": 500,
  "depthLimit": -1,
  "includePostMetadata": true,
  "sentiment_analysis": false,
  "excludeAuthors": [
    "AutoModerator"
  ]
}
```

# Actor output Schema

## `dataset` (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 = {
    "urls": [
        "https://www.reddit.com/r/Baking/comments/1hvoazn/my_best_cheesecake_so_far/"
    ],
    "excludeAuthors": [
        "AutoModerator"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mikolabs/reddit-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 = {
    "urls": ["https://www.reddit.com/r/Baking/comments/1hvoazn/my_best_cheesecake_so_far/"],
    "excludeAuthors": ["AutoModerator"],
}

# Run the Actor and wait for it to finish
run = client.actor("mikolabs/reddit-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 '{
  "urls": [
    "https://www.reddit.com/r/Baking/comments/1hvoazn/my_best_cheesecake_so_far/"
  ],
  "excludeAuthors": [
    "AutoModerator"
  ]
}' |
apify call mikolabs/reddit-comments-scraper --silent --output-dataset

```

## MCP server setup

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