# Reddit Comment Tree Scraper — Full Threads + Scores (`signalengine/reddit-deep-comments`) Actor

Premium: scrape full nested comment trees WITH upvote scores and depth from any Reddit thread or subreddit, using a real browser to get the canonical data RSS can't.

- **URL**: https://apify.com/signalengine/reddit-deep-comments.md
- **Developed by:** [James Taylor](https://apify.com/signalengine) (community)
- **Categories:** Lead generation, Social media, Developer tools
- **Stats:** 6 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 threads

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Comment Tree Scraper — Full Threads + Scores

Get the **complete comment tree** of any Reddit thread — every comment with its **author, body,
upvote score, depth, and parent** — plus the post's score and comment count. This is the premium,
**full-fidelity** Reddit scraper: it returns the engagement data that lightweight RSS-based
scrapers simply can't.

Built for researchers, analysts, sentiment/social-listening tools, and anyone who needs the
*real* structure and scores of a Reddit discussion.

### Why this one

Reddit blocks its `.json`/API endpoints to ordinary scrapers (you get a `403`), which is why
cheaper actors fall back to RSS and return comments **without scores or nesting**. This actor uses
a **real browser** (headless Chromium) through a **residential proxy** to pass Reddit's anti-bot,
then reads the **canonical thread data** — so you get:

- **Per-comment upvote scores** and **post score / upvote ratio / comment count**
- **Full nested structure** — each comment's `depth` and `parentId` to rebuild the tree
- Author, body, timestamp, and permalink for every comment

### What it does

- Scrapes specific **thread URLs**, and/or **discovers threads** from subreddits you name.
- Returns one record per thread: the post plus a flat-but-tree-preserving `comments[]` array
  (each comment carries `depth` + `parentId`, so you can reconstruct the hierarchy).

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `postUrls` | array | `[]` | Specific Reddit thread URLs to scrape in full. |
| `subreddits` | array | `[]` | Discover threads from these subreddits and scrape each. |
| `sort` | string | `hot` | Sort for subreddit discovery: `hot`/`new`/`rising`/`top`. |
| `maxPosts` | integer | `25` | Total threads to scrape (caps spend). |
| `maxComments` | integer | `200` | Cap comments per thread (Reddit serves ~200/page). |
| `maxConcurrency` | integer | `3` | Parallel browser contexts (kept low — real browsers). |
| `proxyConfiguration` | object | Apify residential | **Required** — Reddit blocks datacenter IPs. |

Provide `postUrls`, `subreddits`, or both.

#### Example input

```json
{
  "subreddits": ["SaaS"],
  "sort": "hot",
  "maxPosts": 10,
  "maxComments": 200,
  "postUrls": ["https://www.reddit.com/r/Entrepreneur/comments/abc123/some_thread/"]
}
```

### Output

One dataset item per thread:

```json
{
  "type": "post",
  "subreddit": "SaaS",
  "author": "founder_jane",
  "title": "How we cut churn 30%",
  "score": 142,
  "upvoteRatio": 0.97,
  "numComments": 88,
  "commentCount": 200,
  "postUrl": "https://www.reddit.com/r/SaaS/comments/abc123/how_we_cut_churn_30",
  "createdAt": "2026-06-01T12:00:00.000Z",
  "comments": [
    {
      "type": "comment",
      "id": "opcuxfu",
      "postId": "abc123",
      "parentId": "t3_abc123",
      "author": "growth_greg",
      "body": "What did your onboarding look like before?",
      "score": 24,
      "depth": 0,
      "createdAt": "2026-06-01T12:30:00.000Z",
      "url": "https://www.reddit.com/r/SaaS/comments/abc123/_/opcuxfu"
    }
  ]
}
```

Rebuild the tree from `depth` + `parentId`, or use the flat list as-is.

### Pricing & cost control

Pay-Per-Event — charged per **thread** (all of a thread's comments included). This is a premium
tier: it runs a real browser through a residential proxy (Reddit hard-blocks datacenter IPs), so
it costs more than the RSS-based **Reddit Scraper** — but it's the only one that returns scores +
nested trees. Set `maxPosts` to cap spend.

Two cost levers:

- **Bring your own residential proxy.** In the proxy input choose **Custom proxies** and paste your
  own residential URLs ($1–2/GB) instead of Apify's residential ($8/GB) — typically 3–5× cheaper.
- **`threadsPerSession`** amortises browser startup: one warmed session fetches many threads'
  `.json` before rotating IP, so you mostly pay for the lightweight JSON payloads, not page renders.

### Limitations

- **~200 comments per thread** per Reddit page; very large threads truncate the deepest branches
  (the collapsed "load more" stubs are skipped).
- **Residential proxy required.** Datacenter IPs are blocked.
- Slower and pricier than the RSS scraper by design — use that one when you don't need scores/trees.

### Compliance

Reads **public Reddit data** only, identifies itself, and never logs in, posts, votes, or
messages. Use the data in line with Reddit's terms and any laws that apply to you.

### FAQ

**How is this different from your Reddit Scraper?** That one is RSS-based — fast and cheap, but no
upvote scores and only flat top-level comments. This one uses a real browser to get **full nested
trees + scores**.

**Do I need a Reddit account or API key?** No — just the (default) residential proxy.

**Why a browser?** Reddit fingerprints and challenges non-browser clients; a real browser passes,
then reads the canonical thread data.

***

#### Want this turned into action, not just data?

If you want Reddit conversations turned into leads and AI-drafted replies automatically, that's
**[SignalEngine](https://engine.signalsprint.io)** — this actor is a piece of the engine behind it.

# Actor input Schema

## `postUrls` (type: `array`):

Specific Reddit thread URLs to scrape in full. Combine with or instead of subreddits.

## `subreddits` (type: `array`):

Discover threads from these subreddits (with or without r/) and scrape each in full.

## `sort` (type: `string`):

How to sort when discovering threads from subreddits.

## `maxPosts` (type: `integer`):

Total threads to scrape (caps your spend).

## `maxComments` (type: `integer`):

Cap comments captured per thread. Beyond the ~500/page limit, 'load more' stubs are fetched via /api/morechildren.

## `threadsPerSession` (type: `integer`):

How many threads to fetch through one warmed browser session (one IP) before rotating to a fresh IP. Higher = cheaper (browser startup amortised); lower = more IP rotation.

## `maxConcurrency` (type: `integer`):

Parallel browser sessions. Kept low — each runs a real browser.

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

Residential proxy is REQUIRED — Reddit blocks datacenter IPs. Defaults to Apify residential ($8/GB). For lower cost, pick "Custom proxies" and paste your own residential proxy URLs ($1–2/GB).

## Actor input object example

```json
{
  "postUrls": [],
  "subreddits": [
    "smallbusiness"
  ],
  "sort": "hot",
  "maxPosts": 25,
  "maxComments": 200,
  "threadsPerSession": 15,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `threads` (type: `string`):

Scraped threads with nested comments (author, body, score, depth, parentId).

# 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 = {
    "subreddits": [
        "smallbusiness"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("signalengine/reddit-deep-comments").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 = { "subreddits": ["smallbusiness"] }

# Run the Actor and wait for it to finish
run = client.actor("signalengine/reddit-deep-comments").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 '{
  "subreddits": [
    "smallbusiness"
  ]
}' |
apify call signalengine/reddit-deep-comments --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,signalengine/reddit-deep-comments"
        }
    }
}

```

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/CaEXSmITKYPCgjutn/builds/fma7dPsF7gqAXh4x5/openapi.json
