# Reddit Scraper : Extract Posts, Comments, Subreddits & Users (`datablow/reddit-scraper-pro`) Actor

High-speed, SEO-optimized Reddit scraper. Extracts posts, nested comment trees, user profiles, and subreddits with sorting and advanced filters. Cheap, fast, and resilient.

- **URL**: https://apify.com/datablow/reddit-scraper-pro.md
- **Developed by:** [datablow](https://apify.com/datablow) (community)
- **Categories:** Automation, Social media, SEO tools
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 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.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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 Scraper Pro: Extract Posts, Comments, Subreddits & Users

Unlock the power of Reddit data without restrictions! **Reddit Scraper Pro** is a high-speed, cost-effective, and robust web scraping tool built to extract posts, comments, media attachments, subreddits, and user profiles.

Unlike bloated browser-based scrapers that consume massive server memory, **Reddit Scraper Pro** uses a optimized headless HTTP crawler powered by Crawlee & Cheerio. It fetches raw data directly from Reddit's endpoints, making it **10x faster** and **80% cheaper** in compute costs, bypassing the need for expensive official Reddit API tokens.

***

### 🚀 Key Features

- **No API Key Required:** Scrape publicly available Reddit data anonymously without registering for a developer account or hitting strict API quotas.
- **Subreddit Crawler:** Scrape posts from any subreddit (e.g., `r/technology`, `r/askreddit`) with custom sorting (`Hot`, `New`, `Top`, `Rising`, `Controversial`) and timeframes.
- **Keyword Search Extractor:** Scan all of Reddit for specific keywords or search queries to find trends, brand mentions, or community discussions.
- **User Profile Miner:** Scrape submissions (posts) and comments written by specific Reddit users (e.g., `u/spez`).
- **Deep Comment Thread Parsing:** Extract full comment trees nested under posts. Recursively flattens comments for clean CSV, Excel, or JSON export, preserving replies, upvote scores, and depth structure.
- **Smart Media Downloader:** Detects and extracts direct URLs for images, multi-image galleries, native Reddit videos, and external outbound links.
- **Cursor-Based Pagination:** Automatically follows cursors to retrieve hundreds or thousands of posts per search term or subreddit.
- **Proxy Support:** Fully compatible with Apify Residential Proxies to rotate IPs, bypass geographical restrictions, and avoid rate limiting.

***

### 💡 Why Choose Reddit Scraper Pro?

| Feature | Reddit Scraper Pro | Other Browser-Based Scrapers |
| :--- | :--- | :--- |
| **Technology** | Lightweight HTTP Requests | Headless Chrome (Playwright/Puppeteer) |
| **Compute Overhead** | Very Low (~256MB RAM) | Extremely High (1GB - 2GB RAM) |
| **Speed** | 100+ pages/minute | 5-10 pages/minute |
| **Apify Costs** | **$~0.05 per 10k items** | **$~1.50 per 10k items** |
| **WAF Resilience** | Excellent (via TLS fingerprinting) | Poor (easy browser automation detection) |

***

### ⚙️ Input Parameters

Configure the actor easily using the following input fields:

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `mode` | Select | `subreddits` | Scraping target: `subreddits`, `search`, `users`, or `direct-urls`. |
| `subreddits` | Array | `["todayilearned"]` | Subreddit names to crawl (without `r/`). |
| `searchQueries` | Array | `["artificial intelligence"]` | Keywords to search across Reddit. |
| `usernames` | Array | `["spez"]` | Reddit usernames to scrape. |
| `directUrls` | Array | `[]` | Direct Reddit URLs of subreddits, users, or posts to scrape. |
| `sort` | Select | `hot` | Post sorting order: `hot`, `new`, `top`, `rising`, `controversial`, `relevance`. |
| `timeFilter` | Select | `all` | Upload timeframe: `hour`, `day`, `week`, `month`, `year`, `all`. |
| `maxItems` | Integer | `25` | Maximum number of posts or comments to scrape per query/subreddit. |
| `scrapeComments` | Boolean | `true` | Set to `true` to extract comments under scraped posts. |
| `maxComments` | Integer | `50` | Maximum comments to fetch per post. |
| `maxDepth` | Integer | `5` | Nested reply depth limit (1 = top-level replies only). |
| `proxyConfiguration` | Object | `{ "useApifyProxy": true }` | Apify proxy settings (Residential proxies recommended). |

***

### 📊 Output Data Structure

The scraper saves results in clean, structured JSON format. Below is an example of an extracted post with flattened comments:

```json
{
  "id": "1e78xyz",
  "title": "Why is artificial intelligence growing so fast in 2026?",
  "selftext": "I've been tracking AI progress and the computing power scaling is unbelievable...",
  "author": "tech_enthusiast",
  "subreddit": "technology",
  "subreddit_id": "t5_2qh1e",
  "score": 1420,
  "upvote_ratio": 0.94,
  "num_comments": 12,
  "created_utc": "2026-08-01T15:30:22.000Z",
  "domain": "self.technology",
  "over_18": false,
  "spoiler": false,
  "pinned": false,
  "locked": false,
  "is_video": false,
  "thumbnail": null,
  "flair": "Discussion",
  "permalink": "https://www.reddit.com/r/technology/comments/1e78xyz/why_is_artificial_intelligence_growing_so_fast/",
  "mediaType": "text",
  "mediaUrls": [],
  "commentsCount": 12,
  "comments": [
    {
      "id": "lh91abc",
      "author": "ai_researcher",
      "body": "It's mostly due to the algorithmic advancements in reasoning and reinforcement learning.",
      "score": 85,
      "parent_id": "t3_1e78xyz",
      "created_utc": "2026-08-01T15:45:10.000Z",
      "depth": 1,
      "replies_count": 1
    },
    {
      "id": "lh92def",
      "author": "tech_enthusiast",
      "body": "Do you think we will hit the compute wall soon?",
      "score": 12,
      "parent_id": "t1_lh91abc",
      "created_utc": "2026-08-01T16:02:44.000Z",
      "depth": 2,
      "replies_count": 0
    }
  ]
}
```

***

### 🎯 High-Value Use Cases

1. **AI Training & NLP Datasets:** Scrape millions of conversations, Q\&As (from `r/AskReddit`), and discussions to train custom LLMs, chatbots, or perform advanced text classification.
2. **Sentiment Analysis & Market Research:** Monitor subreddits related to your industry to analyze consumer feedback, brand reception, and competitor weak spots in real-time.
3. **Social Listening & Brand Tracking:** Search for product names or brand keywords to find organic mentions and respond to customer queries instantly.
4. **Lead Generation & Community Growth:** Discover popular posts in niche subreddits to identify influencers, subject-matter experts, and warm outreach targets.

***

### 🏷️ Search Tags (SEO Optimized)

`reddit-scraper`, `reddit-api-alternative`, `scrape-reddit-comments`, `reddit-extractor`, `reddit-post-scraper`, `reddit-data-miner`, `subreddit-downloader`, `sentiment-analysis-reddit`, `social-listening-reddit`, `reddit-user-scraper`, `reddit-media-scraper`, `reddit-to-excel`, `reddit-to-csv`

# Actor input Schema

## `mode` (type: `string`):

Select what you want to scrape: subreddits, search queries, user profiles, or direct URLs.

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

List of subreddits to scrape (without r/, e.g., 'askreddit', 'technology'). Only used in 'Subreddits' mode.

## `searchQueries` (type: `array`):

List of keywords to search for across Reddit. Only used in 'Search' mode.

## `usernames` (type: `array`):

List of Reddit usernames to scrape. Only used in 'Users' mode.

## `directUrls` (type: `array`):

Direct URLs to specific posts, comments or subreddits. Only used in 'Direct URLs' mode.

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

How to sort posts (e.g. Hot, New, Top, Relevance). Relevance is only for search.

## `timeFilter` (type: `string`):

Filter posts by upload time frame. Typically used with Top sort.

## `maxItems` (type: `integer`):

Maximum number of posts/profiles/subreddits to scrape per input item.

## `scrapeComments` (type: `boolean`):

Enable to extract comment threads for each post.

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

Maximum number of comments to extract per post (default: 50). Set lower to run faster and save resources.

## `maxDepth` (type: `integer`):

Maximum nesting depth of comment replies. 1 is top-level replies only. 0 or higher.

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

Residential proxies are highly recommended to prevent Reddit rate limiting.

## Actor input object example

```json
{
  "mode": "subreddits",
  "subreddits": [
    "todayilearned"
  ],
  "searchQueries": [
    "artificial intelligence"
  ],
  "usernames": [
    "spez"
  ],
  "directUrls": [],
  "sort": "hot",
  "timeFilter": "all",
  "maxItems": 25,
  "scrapeComments": true,
  "maxComments": 50,
  "maxDepth": 5
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("datablow/reddit-scraper-pro").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 = { "mode": "subreddits" }

# Run the Actor and wait for it to finish
run = client.actor("datablow/reddit-scraper-pro").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 '{
  "mode": "subreddits"
}' |
apify call datablow/reddit-scraper-pro --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/wR40gaNpcdNj3Awqy/builds/OJSFNMvUMgtWQvKDF/openapi.json
