# Reddit Comments Scraper: Nested Reply Trees & Sentiment 💬 (`unitbytes/reddit-comments-scraper`) Actor

Extract full Reddit comment trees and discussions from any post URL. Scrapes deep nested hierarchies, author sentiment, upvotes, and timestamps with zero API keys. Clean tabular CSV/JSON export.

- **URL**: https://apify.com/unitbytes/reddit-comments-scraper.md
- **Developed by:** [UnitBytes | Enterprise Web Data](https://apify.com/unitbytes) (community)
- **Categories:** Social media, AI, Automation
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 result scrapeds

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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

<p align="center">
  <a href="https://console.apify.com/actors/BJ7hfKqV757hkZV5m/input" target="_blank">
    <img src="https://raw.githubusercontent.com/unitbytes/.github/main/assets/banners/unitbytes-reddit-scraper-subreddits-posts-comments-api-banner.jpg" alt="Reddit Comments Scraper API by UnitBytes" width="100%" />
  </a>
</p>

<p align="center">
  <a href="https://console.apify.com/actors/BJ7hfKqV757hkZV5m/input" target="_blank">
    <img src="https://raw.githubusercontent.com/unitbytes/.github/main/assets/try-it-for-free.svg" width="240" height="48" alt="Try it for Free">
  </a>
  <br>
  <sub>⚡ <b>1-Click Free Trial:</b> Extract live Reddit discussions & full reply trees • No API keys required • Instant results</sub>
</p>

***

## 💬 Reddit Comments Scraper \[From $0.50💰] — Extract Full Discussion Threads & Replies at Scale

<p align="center">
  <strong>The easiest, most reliable way to extract complete Reddit discussions, reply trees, and user sentiment.</strong><br>
  Harvest full discussion threads, nested comment chains, upvotes, and unfiltered customer opinions without API keys, accounts, or developer approvals.
</p>

<p align="center">
  <a href="#-predictable-pricing--volume-discounts"><img src="https://img.shields.io/badge/Pricing-From_$0.50/1k-brightgreen.svg" alt="Pricing" /></a>
  <a href="#-30-second-quick-start-no-code-required"><img src="https://img.shields.io/badge/Setup-Zero_API_Keys-blue.svg" alt="Zero API Keys" /></a>
  <a href="#-key-advantages--what-you-get"><img src="https://img.shields.io/badge/Speed-Instant_1--2s-orange.svg" alt="Speed" /></a>
  <a href="#-key-advantages--what-you-get"><img src="https://img.shields.io/badge/Hierarchy-Full_Reply_Trees-blue.svg" alt="Reply Trees" /></a>
  <a href="#-key-advantages--what-you-get"><img src="https://img.shields.io/badge/Data_Export-1--Click_Excel_&_CSV-purple.svg" alt="Excel & CSV" /></a>
</p>

***

### ⚡ 30-Second Quick Start (No Code Required)

Extract complete comment discussions in 3 quick steps:

1. **Paste Target Discussion Link**: Copy any Reddit post URL (e.g. `https://www.reddit.com/r/technology/comments/1x0b0f5/...`) and paste it into **`startUrls`**.
2. **Choose Comment Limit**: Set **`maxCommentsPerPost`** (e.g. `100` or `500`).
3. **Click "Start" & Export**: Hit **Start**. Within 1–2 seconds, click **Export** to download your conversation tree cleanly in **Excel**, **CSV**, or **JSON**.

> 💡 **Sentiment & Hierarchy Ready**: Every row includes explicit `parentId` and `depth` indicators so you can instantly reconstruct who replied to whom or filter exclusively for top-level feedback.

***

### 💡 What You Can Do With This Scraper

- 📊 **Customer Voice & Brand Sentiment** — Discover what real people say about your products, brand, competitors, or pricing across authentic community discussions.
- 🤖 **AI & LLM Training Datasets** — Generate high-quality conversational datasets, multi-turn dialogues, Q\&A pairs, and debate transcripts ready for fine-tuning.
- 🎯 **Product Feedback & Bug Discovery** — Find unfiltered user reviews, bug reports, feature requests, and workarounds shared in tech and niche subreddits.
- 📈 **Market & Trend Research** — Track community reactions to breaking industry news, viral announcements, and policy changes with full context.

***

### ⭐ Key Advantages & What You Get

- 🌳 **Complete Discussion Trees** — Extracts every layer of conversation—from top-level thoughts to deep back-and-forth replies (`depth=0, 1, 2, 3...`) with clear parent-child connections (`parentId`).
- 📊 **Zero-Cleaning Exports (Excel, CSV, JSON)** — Clean row-per-comment structure that opens directly in Google Sheets, Microsoft Excel, or Pandas with zero formatting headaches or broken columns.
- ⚡ **Lightning-Fast Results** — Extracts hundreds of comments in 1–2 seconds, saving you hours of manual copying and waiting.
- 🛡️ **100% Reliable & Non-Stop** — Continuous, automated data collection that runs smoothly 24/7 without getting interrupted, rate-limited, or blocked.
- 💰 **Fair & Predictable Pricing** — From **$0.50 per 1,000 comments** with zero startup penalties and an unconditional **$0.00 guarantee on empty threads**.

***

> ### 💡 Why Businesses Choose This Over Reddit Official API
>
> - **Skip Weeks of Waiting & Strict Approval**: Reddit requires comprehensive commercial applications, legal reviews, and NDA signing to access comment streams. UnitBytes lets you pull full threads immediately.
> - **No Expensive Monthly Contracts**: The official API charges **$0.24 per 1,000 calls** and requires enterprise commitments starting at $1,000+/mo. UnitBytes charges **from $0.50 per 1,000 comments** on a pure pay-as-you-go basis.
> - **Full Depth & Nested Hierarchy**: While standard API endpoints limit comment depth and require complex pagination loops, UnitBytes harvests the complete conversational hierarchy (`depth=0, 1, 2, 3...`) in a single lightning-fast run.
> - **Zero Formatting Headaches**: Reddit's API returns deeply nested JSON trees that crash standard spreadsheet tools. UnitBytes flattens discussions into clean, relational rows that open directly in Excel, Google Sheets, or Pandas.

### 🏆 How It Compares to Other Options

| Feature / Capability | **UnitBytes Comments Scraper** | Official Reddit API | Other Scraping Tools |
| :--- | :--- | :--- | :--- |
| **Setup & Approvals** | **✅ Instant 1-click start (Zero setup)** | 🛑 Strict enterprise approvals & weeks of waiting | ❌ None needed |
| **Cost per 1,000 Comments** | **💰 $0.50 – $1.00** | 💵 $0.24 + Enterprise monthly minimums | 💸 $2.00 – $5.00 |
| **Discussion Depth** | **✅ Complete nested reply trees** | ⚠️ Complex multi-step pagination | ⚠️ Surface top 10–20 comments only |
| **Parent-Child Hierarchy** | **✅ Explicit `parentId` & `depth` keys** | Complex nested structures | Inconsistent formats |
| **Time to Results** | **⚡ 1–2 seconds (Instant)** | ~3–5 seconds | 🐢 30–60 seconds (Slow & laggy) |
| **Data Usability** | **✅ 1-Click Clean CSV, Excel & JSON** | Complex nested formats | Broken columns requiring hours of cleanup |
| **Compute Surcharges** | **✅ $0.00 (No hidden server fees)** | N/A | 💸 High hourly server compute bills |
| **Empty Result Runs** | **✅ $0.00 (Guaranteed Zero Charge)** | ❌ Charged per request | ⚠️ Charged start fees ($0.02) |

***

### 💎 Predictable Pricing & Volume Discounts

We use Apify **Pay-Per-Event (PPE)** pricing with active **Store Discounts**. Users on higher subscription tiers automatically unlock substantial volume discounts:

| Plan Tier | Apify Discount Tier | Unit Price per Item | Price / 1,000 Comments | Included Monthly Capacity |
| :--- | :--- | :--- | :--- | :--- |
| 🟢 **Free Plan** | `FREE` | **$0.0010** | **$1.00** | **Up to 5,000 comments/mo FREE** ($5 credit) |
| 🥉 **Starter Plan** | `BRONZE` | **$0.0008** | **$0.80 (20% OFF)** | **Up to 23,750 comments/mo** ($19 credit) |
| 🥈 **Scale Plan** | `SILVER` | **$0.0006** | **$0.60 (40% OFF)** | **Up to 331,600 comments/mo** ($199 credit) |
| 🥇 **Business Plan** | `GOLD` / `PLATINUM` | **$0.0005** | **$0.50 (50% OFF)** | **Up to 1,998,000 comments/mo** ($999 credit) |

#### 💰 What Does This Cost in Real Life?

| Extraction Scenario | Comments Harvested | Estimated Cost (Starter / Scale) | Time to Complete |
| :--- | :--- | :--- | :--- |
| **Product Launch Reaction Check** | 250 Comments | **$0.15 – $0.20** | ~1 second |
| **In-Depth Competitor Review Audit** | 1,000 Comments & Replies | **$0.50 – $0.80** | ~1–2 seconds |
| **Full Viral Mega-Thread Archive** | 5,000 Nested Comments | **$2.50 – $4.00** | ~3–5 seconds |
| **AI Dialogue Training Dataset** | 20,000 Multi-Turn Pairs | **$10.00 – $16.00** | ~15 seconds |
| **Apify Free Plan Users** | Up to **5,000 comments/month** | **$0.00 FREE** *(Included with $5 credit)* | Instant |

> **Fair Billing Guarantee**: Zero charges on empty discussion threads or deleted posts. Startup fee is capped at the platform minimum ($0.00005).

***

### 🚀 3 Ready-to-Run Workflows

#### Workflow 1: Single Discussion Deep-Dive

Extract every reaction, debate, and expert opinion from a viral Reddit thread.

1. Copy the discussion URL (e.g. `https://www.reddit.com/r/technology/comments/1x0b0f5/...`).
2. Paste into **`startUrls`**.
3. Set **`maxCommentsPerPost`** to `100` or `500`.
4. Click **Start** — download clean, sentiment-ready CSV/Excel in seconds.

#### Workflow 2: Multi-Thread Batch Intelligence

Analyze audience sentiment across multiple competitor announcements or community discussions simultaneously.

1. Add multiple URLs into **`startUrls`** (e.g. 5 different product review threads).
2. The scraper processes each thread in sequence and merges all comments into a single unified dataset with clear `postId` references.

#### Workflow 3: Conversational AI & LLM Training

Build multi-turn dialogue pairs and Q\&A training datasets.

1. Scrape full reply trees from advice, technical support, or debate communities (`r/AskReddit`, `r/explainlikeimfive`, `r/MachineLearning`).
2. Group records by `postId` and pair each comment with its `parentId` to reconstruct full conversation flows.

***

### 📥 Simple Input Parameters

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `startUrls` | Array | *(Sample URL)* | Direct Reddit post URLs you want to extract comments from. |
| `maxCommentsPerPost` | Integer | `100` | Maximum number of comments and replies to extract per post (1 – 5,000). |
| `proxyConfiguration` | Object | `Default` | Recommended proxy settings for high-speed, reliable extraction. |
| `customProxyUrl` | String | `""` | Optional custom proxy URL if you prefer to use your own proxy provider. |

***

### 📤 Sample Output Datasets

Every extracted comment is delivered as a clean, flat record ready for immediate analysis:

#### 1. Top-Level Comment (`depth=0`)

```json
{
  "itemType": "comment",
  "id": "t1_m3k0x1y",
  "postId": "t3_1x0b0f5",
  "parentId": "t3_1x0b0f5",
  "author": "tech_enthusiast",
  "body": "Streaming platforms need stricter auditing mechanisms. 10k bots running 24/7 is an insane amount of synthetic streams.",
  "score": 342,
  "depth": 0,
  "createdAt": "2026-10-11T12:30:15Z",
  "permalink": "https://www.reddit.com/r/technology/comments/1x0b0f5/comment/m3k0x1y/",
  "scrapedAt": "2026-10-11T16:01:26Z"
}
```

#### 2. Nested Reply (`depth=1`)

```json
{
  "itemType": "comment",
  "id": "t1_m3k1a2z",
  "postId": "t3_1x0b0f5",
  "parentId": "t1_m3k0x1y",
  "author": "audio_engineer_99",
  "body": "Agreed. What makes it worse is that royalty pools are zero-sum, so this fraud directly steals payouts from legitimate indie musicians.",
  "score": 128,
  "depth": 1,
  "createdAt": "2026-10-11T12:45:00Z",
  "permalink": "https://www.reddit.com/r/technology/comments/1x0b0f5/comment/m3k1a2z/",
  "scrapedAt": "2026-10-11T16:01:26Z"
}
```

#### 📋 Field Reference Table

| Field Name | Type | Description |
| :--- | :--- | :--- |
| `itemType` | String | Always `"comment"` for comment records (or `"post"` if root post info is included). |
| `id` | String | Unique Reddit comment ID (e.g. `t1_m3k0x1y`). |
| `postId` | String | The parent discussion post ID (e.g. `t3_1x0b0f5`). |
| `parentId` | String | Direct parent reference: links to `postId` for root comments, or parent comment `id` for replies. |
| `author` | String | Username of the comment author (`[deleted]` if removed). |
| `body` | String | Full comment text in clean markdown. |
| `score` | Integer | Net community upvote score (upvotes minus downvotes). |
| `depth` | Integer | Conversation level: `0` = root comment, `1` = direct reply, `2` = reply to reply, etc. |
| `createdAt` | String | ISO 8601 UTC timestamp of comment creation. |
| `permalink` | String | Direct link to view the specific comment on Reddit. |
| `scrapedAt` | String | Timestamp when the comment was extracted. |

***

### 📊 Instant Analysis in Excel, Google Sheets & Python

Because the data is delivered in a clean flat layout, you can export it with 1 click:

- **In Google Sheets / Excel**: Download the dataset as CSV or Excel. Use `depth = 0` to filter for main comments, or sort by `score` to see the most popular opinions.
- **In Python / Pandas**:
  ```python
  import pandas as pd
  from apify_client import ApifyClient

  # 1. Fetch dataset from your Apify run
  client = ApifyClient("YOUR_APIFY_TOKEN")
  items = client.dataset("DATASET_ID").list_items().items
  df = pd.DataFrame(items)

  # 2. Find high-impact discussions
  top_comments = df[(df["depth"] == 0) & (df["score"] >= 50)]
  print(f"Found {len(top_comments)} top-level discussions.")

  # 3. View all replies to any comment
  def find_replies(comment_id):
      return df[df["parentId"] == comment_id]
  ```

***

### ❓ Frequently Asked Questions (FAQ)

#### Do I need a Reddit account or API key?

**No.** You can run this actor immediately with zero API keys, developer tokens, or Reddit accounts.

#### How do I open the results in Excel or Google Sheets?

Once your run finishes, click **Export** on the Apify dataset tab and choose **CSV** or **Excel**. The data is pre-flattened so every column loads cleanly with zero formatting errors.

#### Can I reconstruct who replied to whom?

**Yes.** Every record has a `parentId` field. If `parentId` equals `postId`, it is a top-level comment. If `parentId` starts with `t1_`, it points directly to the comment it is replying to.

#### How many comments can I extract from a post?

You can extract anywhere from 1 up to 5,000 comments and nested replies per post by adjusting `maxCommentsPerPost`.

#### What happens if a post is deleted or has no comments?

The actor finishes cleanly with zero errors, delivers an empty dataset, and **charges $0.00**. You only pay for real comments successfully scraped.

***

### ⚖️ Compliance & Privacy

This scraper extracts only publicly available discussions that Reddit serves to web visitors. It does not access private communities, user direct messages, or restricted subreddits. Please ensure your data collection complies with applicable regulations (such as GDPR / CCPA) and respects Reddit terms.

# Actor input Schema

## `startUrls` (type: `array`):

Direct Reddit post URLs to extract nested comment trees from (e.g. https://www.reddit.com/r/technology/comments/1x0b0f5/...).

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

Maximum number of top-level comments and nested replies to extract per post.

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

Residential proxy configuration. Reddit blocks datacenter IPs, so residential proxies are automatically enforced by default for high reliability.

## `customProxyUrl` (type: `string`):

Optional custom residential proxy URL (e.g. MrScraper). If provided, it will be prioritized before falling back to Apify Residential.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/technology/comments/1x0b0f5/fraudster_jailed_for_using_10k_bots_and_ai_songs/"
    }
  ],
  "maxCommentsPerPost": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `redditDataset` (type: `string`):

Structured dataset of extracted Reddit posts, user submissions, search results, and comment trees with permanent media links.

# 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 = {
    "startUrls": [
        {
            "url": "https://www.reddit.com/r/technology/comments/1x0b0f5/fraudster_jailed_for_using_10k_bots_and_ai_songs/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("unitbytes/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 = { "startUrls": [{ "url": "https://www.reddit.com/r/technology/comments/1x0b0f5/fraudster_jailed_for_using_10k_bots_and_ai_songs/" }] }

# Run the Actor and wait for it to finish
run = client.actor("unitbytes/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 '{
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/technology/comments/1x0b0f5/fraudster_jailed_for_using_10k_bots_and_ai_songs/"
    }
  ]
}' |
apify call unitbytes/reddit-comments-scraper --silent --output-dataset

```

## MCP server setup

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