# 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:** 2 total users, 1 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 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/platform/actors/running/actors-in-store#pay-per-event

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

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

// 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 = {}

# 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("💾 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 '{}' |
apify call signalengine/reddit-deep-comments --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Comment Tree Scraper — Full Threads + Scores",
        "description": "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.",
        "version": "0.1",
        "x-build-id": "5l5FVaS5tikNHbr87"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/signalengine~reddit-deep-comments/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-signalengine-reddit-deep-comments",
                "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/signalengine~reddit-deep-comments/runs": {
            "post": {
                "operationId": "runs-sync-signalengine-reddit-deep-comments",
                "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/signalengine~reddit-deep-comments/run-sync": {
            "post": {
                "operationId": "run-sync-signalengine-reddit-deep-comments",
                "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",
                "properties": {
                    "postUrls": {
                        "title": "Thread URLs",
                        "type": "array",
                        "description": "Specific Reddit thread URLs to scrape in full. Combine with or instead of subreddits.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "subreddits": {
                        "title": "Subreddits",
                        "type": "array",
                        "description": "Discover threads from these subreddits (with or without r/) and scrape each in full.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "sort": {
                        "title": "Sort (for subreddit discovery)",
                        "enum": [
                            "hot",
                            "new",
                            "rising",
                            "top"
                        ],
                        "type": "string",
                        "description": "How to sort when discovering threads from subreddits.",
                        "default": "hot"
                    },
                    "maxPosts": {
                        "title": "Max threads",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Total threads to scrape (caps your spend).",
                        "default": 25
                    },
                    "maxComments": {
                        "title": "Max comments per thread",
                        "minimum": 1,
                        "maximum": 2000,
                        "type": "integer",
                        "description": "Cap comments captured per thread. Beyond the ~500/page limit, 'load more' stubs are fetched via /api/morechildren.",
                        "default": 200
                    },
                    "threadsPerSession": {
                        "title": "Threads per session",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "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.",
                        "default": 15
                    },
                    "maxConcurrency": {
                        "title": "Max concurrency",
                        "minimum": 1,
                        "maximum": 8,
                        "type": "integer",
                        "description": "Parallel browser sessions. Kept low — each runs a real browser.",
                        "default": 3
                    },
                    "proxyConfiguration": {
                        "title": "Proxy",
                        "type": "object",
                        "description": "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).",
                        "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
