# Reddit Scraper - Posts, Comments & Users (`betterdevsscrape/reddit-scraper`) Actor

Extract posts, comments, communities & user profiles from any subreddit at scale. Fetches all comments including hidden/collapsed ones. Breaks Reddit's 1000-post limit with date windowing. No login needed, no browser. $0.003 per result. Supports search, sorting, NSFW filtering & date filtering.

- **URL**: https://apify.com/betterdevsscrape/reddit-scraper.md
- **Developed by:** [Better Devs Scrape](https://apify.com/betterdevsscrape) (community)
- **Categories:** Social media, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 1,076 total users, 12 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 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

## 📡 Reddit Scraper — Extract Posts, Comments, Users & Subreddit Data

**The most feature-rich Reddit scraper on Apify.** Extract posts, comments, communities, and user profiles from any subreddit, search query, or URL — at just **$0.003 per result**. No Reddit account needed, no browser, pure HTTP.

A powerful **Reddit API alternative** for market research, sentiment analysis, brand monitoring, lead generation, and academic research. Paste URLs or type subreddit names, click Run, get clean structured JSON, CSV, or Excel.

***

### 🏆 Why Choose This Reddit Scraper?

| Feature | This Scraper | Other Reddit Scrapers |
|---------|-------------|----------------------|
| 💰 **Price per result** | **$0.003** | $0.004–$0.005+ |
| ⚡ **Speed** | 50 items in under 60 seconds | Minutes with browser |
| 💬 **All comments** | ✅ Fetches collapsed/hidden comments | ❌ Only top ~500 |
| 📅 **Break 1000-post limit** | ✅ Date windowing bypasses cap | ❌ Stuck at ~1000 |
| 🎯 **Post filters** | ✅ Score, flair, domain, author | ❌ None |
| 👤 **User profiles** | ✅ Karma, account age, mod status | ❌ Posts only |
| 🏘️ **Community data** | ✅ Members, rules, description | ❌ Not available |
| 🛡️ **Resilience** | ✅ Auto-retry + fallback mirrors | ❌ Fails on 429/403 |
| 🧠 **Memory** | 256 MB (no browser) | 1 GB+ with browser |
| 📱 **Simple input** | ✅ Just type subreddit names | ❌ Full URLs only |
| 🔑 **Login required** | ❌ No | Often yes |

***

### 🌐 What Is Reddit Scraping?

Reddit scraping is the process of automatically extracting data from Reddit — the world's largest forum with 1.7+ billion monthly visits. Instead of manually copying posts and comments, a Reddit scraper collects structured data (titles, text, scores, timestamps, user info) from subreddits, search results, and user profiles at scale.

**Common reasons to scrape Reddit:**

- **Market research** — Track what customers say about your product or competitors
- **Sentiment analysis** — Feed Reddit discussions into NLP pipelines for opinion mining
- **Content discovery** — Find trending topics, viral posts, and emerging discussions
- **Lead generation** — Identify users discussing problems your product solves
- **Brand monitoring** — Get alerts when your brand is mentioned across subreddits
- **Academic research** — Build datasets of online discussions for social science studies
- **SEO & content ideas** — Discover what questions real people ask in any niche
- **AI training data** — Collect diverse conversational data for language model fine-tuning

This scraper works as a **Reddit API alternative** — no OAuth tokens, no rate limit headaches, no developer application needed. Just paste URLs or type subreddit names and get data.

***

### 📊 What Data Can You Extract?

| Category | What You Get |
|----------|-------------|
| 📝 **Posts** | Title, body, score, comment count, media URLs, flair, awards, gallery images, video URLs |
| 💬 **Comments** | Full comment trees including nested replies, scores, author flair, depth level |
| 🏘️ **Communities** | Subreddit metadata, member counts, active users, description, rules, type |
| 👤 **Users** | Karma breakdown, account age, premium status, moderator status, verification |
| 🔍 **Search** | Search across all of Reddit or within specific subreddits |

***

### ⚙️ How to Scrape Reddit

```
1️⃣ Paste Reddit URLs (subreddits, posts, user profiles)
2️⃣ Set your limits (max posts, comments, items)
3️⃣ Click "Start" and get clean, structured data
```

The scraper automatically:

- 💬 **Fetches all comments** — Including collapsed/hidden comments beyond Reddit's initial ~500
- 🛡️ **Resilient** — Automatic retries with fallback mirrors when Reddit is unavailable
- 🔄 **Anti-blocking** — Built-in session management to avoid rate limits
- 📅 **Breaks pagination limits** — Date windowing gets posts beyond Reddit's ~1000 cap

***

### 📥 Input Example

```json
{
  "subreddits": ["technology", "programming"],
  "searches": ["artificial intelligence"],
  "minScore": 50,
  "flairFilter": "Discussion",
  "maxItems": 100,
  "maxPostCount": 25,
  "maxComments": 50,
  "includeNSFW": false,
  "proxy": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

#### 📋 Input Parameters

##### What to Scrape

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `startUrls` | array | — | Reddit URLs to scrape (posts, subreddits, users, leaderboard) |
| `subreddits` | string\[] | — | Subreddit names to scrape (without r/ prefix) |
| `searches` | string\[] | — | Search queries to run on Reddit |
| `searchCommunityName` | string | — | Restrict search to a specific subreddit |
| `searchPosts` | boolean | `true` | Include posts in search results |
| `searchComments` | boolean | `false` | Include comments in search results |
| `searchCommunities` | boolean | `false` | Include subreddits in search results |
| `searchUsers` | boolean | `false` | Include users in search results |

##### Limits

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `maxItems` | integer | `50` | Maximum total items saved to dataset |
| `maxPostCount` | integer | `25` | Max posts per subreddit or search |
| `maxComments` | integer | `10` | Max comments per post (0 to skip) |
| `maxCommunitiesCount` | integer | `2` | Max community listing pages |
| `maxUserCount` | integer | `2` | Max user listing pages |
| `postsPerSource` | integer | `0` | Max posts per individual source (0 = no limit) |

##### Sorting & Filtering

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `sort` | string | `"hot"` | Sort order: relevance, hot, top, new, rising, comments |
| `time` | string | `"all"` | Time filter: all, hour, day, week, month, year |
| `commentSort` | string | `"confidence"` | Comment sort: confidence (best), top, new, controversial, old, qa |
| `includeNSFW` | boolean | `false` | Include NSFW content |
| `postDateLimit` | string | — | Only scrape posts after this date (YYYY-MM-DD) |

##### Post Filters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `minScore` | integer | — | Only posts with at least N upvotes |
| `maxScore` | integer | — | Only posts with at most N upvotes |
| `minComments` | integer | — | Only posts with at least N comments |
| `maxCommentsFilter` | integer | — | Only posts with at most N comments |
| `flairFilter` | string | — | Only posts matching this flair |
| `domainFilter` | string | — | Only posts from this domain |
| `authorFilter` | string | — | Only posts by this author |
| `postsPerSource` | integer | `0` | Max posts per individual source |

##### Skip Options

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `skipComments` | boolean | `false` | Skip comment extraction (faster) |
| `skipUserPosts` | boolean | `false` | Skip user's submitted posts |
| `skipCommunity` | boolean | `false` | Skip subreddit metadata |

##### Advanced

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `enableDateWindowing` | boolean | `false` | Break past Reddit's ~1000 post limit using date-range windows |
| `proxy` | object | Residential | Proxy config (residential strongly recommended) |
| `debugMode` | boolean | `false` | Enable verbose logging |

***

### 📤 Sample Output

#### Post

```json
{
  "id": "t3_1rda27h",
  "parsedId": "1rda27h",
  "url": "https://www.reddit.com/r/AskReddit/comments/1rda27h/what_screams_i_am_deeply_insecure/",
  "username": "curious_mind",
  "title": "What screams \"I am deeply insecure\" but people do it thinking it makes them look cool?",
  "communityName": "r/AskReddit",
  "body": null,
  "numberOfComments": 8432,
  "upVotes": 24567,
  "upVoteRatio": 0.94,
  "isVideo": false,
  "over18": false,
  "createdAt": "2026-02-24T08:15:00.000Z",
  "scrapedAt": "2026-02-24T15:58:42.000Z",
  "flair": null,
  "link": null,
  "imageUrls": [],
  "videoUrl": null,
  "isGallery": false,
  "stickied": false,
  "locked": false,
  "archived": false,
  "spoiler": false,
  "awardsCount": 12,
  "dataType": "post"
}
```

#### Comment

```json
{
  "id": "t1_lm8x9y2",
  "parsedId": "lm8x9y2",
  "postId": "1rda27h",
  "url": "https://www.reddit.com/r/AskReddit/comments/1rda27h/-/lm8x9y2/",
  "parentId": "t3_1rda27h",
  "username": "witty_replier",
  "communityName": "r/AskReddit",
  "body": "People who brag about how little sleep they get.",
  "createdAt": "2026-02-24T09:30:00.000Z",
  "scrapedAt": "2026-02-24T15:58:43.000Z",
  "upVotes": 3421,
  "numberOfReplies": 87,
  "depth": 0,
  "dataType": "comment"
}
```

#### Community

```json
{
  "id": "2qh1i",
  "name": "t5_2qh1i",
  "title": "Ask Reddit...",
  "displayName": "AskReddit",
  "numberOfMembers": 48000000,
  "activeUserCount": 12500,
  "subredditType": "public",
  "description": "r/AskReddit is the place to ask and answer thought-provoking questions.",
  "over18": false,
  "createdAt": "2008-01-25T00:00:00.000Z",
  "scrapedAt": "2026-02-24T15:58:32.000Z",
  "url": "https://www.reddit.com/r/AskReddit/",
  "dataType": "community"
}
```

#### User

```json
{
  "id": "1w72lch",
  "userId": "t2_1w72lch",
  "url": "https://www.reddit.com/user/spez/",
  "username": "spez",
  "totalKarma": 654321,
  "postKarma": 123456,
  "commentKarma": 530865,
  "isGold": true,
  "isMod": true,
  "hasVerifiedEmail": true,
  "createdAt": "2005-06-06T00:00:00.000Z",
  "scrapedAt": "2026-02-24T15:49:43.000Z",
  "dataType": "user"
}
```

***

### 💰 How Much Does It Cost to Scrape Reddit?

This Actor uses **Pay-Per-Event** pricing. You only pay for results actually saved.

| Event | Cost |
|-------|------|
| 📄 Per result (post, comment, community, or user) | **$0.003** |

#### 💵 Cost Examples

| Scenario | Items | Estimated Cost |
|----------|-------|---------------|
| 1 subreddit, 25 posts, 10 comments each | ~276 | **~$0.83** |
| 10 subreddits, 50 posts each, no comments | ~510 | **~$1.53** |
| Search query, 100 posts, 50 comments each | ~5,100 | **~$15.30** |
| Single post with all comments (2000+) | ~2,001 | **~$6.00** |

🎉 **No login, no browser, no hidden costs.** Pure HTTP scraping means low compute costs for you.

***

### 🔌 Integrate With Your Stack

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("betterdevsscrape/reddit-scraper").call(run_input={
    "startUrls": [{"url": "https://www.reddit.com/r/technology/"}],
    "maxItems": 100,
    "maxPostCount": 25,
    "maxComments": 20,
    "proxy": {"useApifyProxy": True, "apifyProxyGroups": ["RESIDENTIAL"]},
})

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

#### JavaScript / Node.js

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('betterdevsscrape/reddit-scraper').call({
    startUrls: [{ url: 'https://www.reddit.com/r/technology/' }],
    maxItems: 100,
    maxPostCount: 25,
    maxComments: 20,
    proxy: { useApifyProxy: true, apifyProxyGroups: ['RESIDENTIAL'] },
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach(item => {
    console.log(`[${item.dataType}] ${item.title || item.body?.slice(0, 80)}`);
});
```

#### cURL

```bash
curl "https://api.apify.com/v2/acts/betterdevsscrape~reddit-scraper/runs" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "startUrls": [{"url": "https://www.reddit.com/r/technology/"}],
    "maxItems": 50,
    "proxy": {"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}
  }'
```

#### 📦 Export Options

- **JSON** — Full structured data
- **CSV** — Spreadsheet-ready format
- **Excel** — Direct download

#### 🔄 Integrations

Connect via Zapier, Make (Integromat), or any platform that supports REST APIs.

***

### 🎯 Use Cases

#### 📈 Market Research & Competitor Analysis

Monitor product mentions, competitor discussions, and industry trends across subreddits. Scrape r/technology, r/startups, or niche communities to understand what customers want. Use `minScore` filters to focus on high-engagement discussions only.

#### 💼 Sentiment Analysis & Opinion Mining

Collect thousands of posts and comments about brands, products, or topics and feed them into NLP pipelines. The structured JSON output (with scores, timestamps, and nested comment trees) is ready for pandas, Spark, or any data processing tool.

#### 🔍 Content Discovery & Trend Detection

Find trending content, popular posts, and viral discussions in any niche. Use `sort: "rising"` to catch content before it goes viral, or `sort: "top"` with `time: "week"` to see the best of the week.

#### 📊 Academic & Social Science Research

Gather large datasets of Reddit discussions for social media studies, discourse analysis, or behavioral research. Date windowing lets you build historical archives going back years.

#### 🎯 Lead Generation & Sales Intelligence

Find users actively discussing problems your product solves. Filter by flair, domain, or author to pinpoint high-intent conversations. Scrape user profiles to understand potential leads.

#### 📢 Brand Monitoring & Reputation Management

Track mentions of your brand, products, or competitors across Reddit in real-time. Set up scheduled runs via Apify to get daily or weekly reports delivered to your inbox, Slack, or CRM.

#### 📝 SEO Research & Content Ideas

Discover what questions real people ask in your industry. Reddit threads are a goldmine for blog topics, FAQ pages, and long-tail keyword research.

#### 🤖 AI Training Data & LLM Fine-Tuning

Collect diverse conversational data from Reddit's thousands of communities. Posts and comment trees provide natural dialogue structure ideal for training chatbots, classifiers, and language models.

***

### 💡 Tips for Effective Scraping

#### 🧪 Start Small

Begin with `maxItems: 10` to test your configuration before scaling up.

#### 🏠 Always Use Residential Proxies

Reddit blocks datacenter IPs aggressively. The scraper defaults to Apify residential proxies.

#### 🔍 Use Search for Discovery

`searches` finds content across all of Reddit. `startUrls` is for specific pages you already know.

#### ⚡ Skip Comments for Speed

Each comment counts as a result. Set `maxComments: 0` or `skipComments: true` if you only need post data.

#### 📅 Date Windowing for Archives

Enable `enableDateWindowing` with high `maxPostCount` to scrape older posts beyond Reddit's 1000-post pagination cap.

#### 🔀 Sort Matters

Use `"hot"` for current popular content, `"top"` + `time: "week"` for the best of the week, `"new"` for chronological.

***

### 🧪 Example Configurations

#### Basic: Scrape one subreddit

```json
{
  "startUrls": [{ "url": "https://www.reddit.com/r/technology/" }],
  "maxItems": 50
}
```

#### Search across all of Reddit

```json
{
  "searches": ["artificial intelligence"],
  "maxItems": 100,
  "maxPostCount": 50,
  "sort": "relevance"
}
```

#### Scrape a specific post with all comments

```json
{
  "startUrls": [{ "url": "https://www.reddit.com/r/AskReddit/comments/abc123/some_post/" }],
  "maxComments": 5000,
  "maxItems": 10000
}
```

#### Scrape user profiles

```json
{
  "startUrls": [{ "url": "https://www.reddit.com/user/spez/" }],
  "maxItems": 50
}
```

#### Filter by score and flair

```json
{
  "subreddits": ["programming", "javascript"],
  "minScore": 100,
  "flairFilter": "Discussion",
  "maxItems": 50,
  "skipComments": true
}
```

#### Only YouTube links from a subreddit

```json
{
  "subreddits": ["technology"],
  "domainFilter": "youtube.com",
  "minScore": 50,
  "maxItems": 100
}
```

#### Track a specific author

```json
{
  "startUrls": [{ "url": "https://www.reddit.com/r/announcements/" }],
  "authorFilter": "spez",
  "maxItems": 50
}
```

#### Large-scale subreddit archive with date windowing

```json
{
  "startUrls": [{ "url": "https://www.reddit.com/r/technology/" }],
  "maxPostCount": 5000,
  "maxItems": 50000,
  "enableDateWindowing": true,
  "skipComments": true
}
```

***

### ❓ Frequently Asked Questions

#### Does this require a Reddit account or API key?

No. This scraper works without any Reddit account, OAuth token, or API key. It accesses only publicly visible content — no authentication needed.

#### Is this a Reddit API alternative?

Yes. Unlike the official Reddit API (which requires developer applications, OAuth, and has strict rate limits), this scraper extracts the same data with zero setup. Just provide URLs or subreddit names and run.

#### Why are residential proxies required?

Reddit actively blocks datacenter IP ranges. Residential proxies provide real IP addresses that Reddit doesn't block. The scraper defaults to Apify's residential proxy pool for maximum reliability.

#### Can I scrape private or quarantined subreddits?

No. Only public subreddits and posts are accessible. Quarantined subreddits require a logged-in session which this scraper does not use.

#### What happens when Reddit rate limits or blocks?

The scraper automatically retries failed requests with exponential backoff and falls back to mirror sites when Reddit is temporarily unavailable. Sessions are rotated to avoid IP bans.

#### How do I scrape more than 1000 posts from a subreddit?

Enable `enableDateWindowing` in the input. This splits the request into weekly date-range search queries that bypass Reddit's ~1000 post pagination limit. You can scrape entire subreddit archives this way.

#### How do I get all comments on a post, including hidden ones?

Just set `maxComments` to a high number. The scraper automatically detects collapsed/hidden comment threads (Reddit's "load more comments") and fetches them via the morechildren API. No extra configuration needed.

#### Can I export Reddit data as CSV or Excel?

Yes. Apify datasets support JSON, CSV, Excel, XML, and RSS exports. You can also connect via API, Zapier, Make (Integromat), or Google Sheets.

#### Can I schedule Reddit scraping on a recurring basis?

Yes. Use Apify's built-in scheduler to run the scraper hourly, daily, or weekly. Combine with webhooks or integrations to get results delivered to Slack, email, Google Sheets, or your own API.

#### How fast is it?

50 items in under 60 seconds. Pure HTTP scraping with no browser means low memory usage (~256 MB) and fast execution. Most runs complete in under 2 minutes.

#### What output format does the data come in?

Each item has a `dataType` field (`"post"`, `"comment"`, `"community"`, or `"user"`) so you can easily filter. All items include timestamps, IDs, and URLs for traceability.

***

### ⚖️ Legal

Web scraping publicly available data is generally legal. This Actor extracts only **publicly visible content** from Reddit.

**Users are responsible for:**

- ✅ Complying with applicable data protection laws (GDPR, CCPA, etc.)
- ✅ Respecting Reddit's terms of service
- ✅ Using extracted data ethically and legally

If you're unsure whether your use case is legitimate, consult your lawyers. You can also read [Apify's blog post on the legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

***

### 💬 Support & Feedback

- 💡 **Feature requests?** We'd love to hear what you need
- ❓ **Questions?** Check the FAQ above or reach out
- ⭐ **Happy with the results?** Leave us a review on the Apify Store!

***

### 🔗 More Scrapers by BetterDevsScrape

| Scraper | Description |
|---------|-------------|
| 📍 [Google Maps Scraper](https://apify.com/betterdevsscrape/google-maps-scraper) | Extract businesses, reviews, images, contacts & emails from Google Maps |
| 📇 [Contact Details Extractor](https://apify.com/betterdevsscrape/contact-details-extractor) | Extract emails, phone numbers & 25+ social media profiles from any website |

***

**Built with ❤️ by BetterDevsScrape** | [View on Apify Store](https://apify.com/betterdevsscrape/reddit-scraper)

# Changelog

This Actor's version history is a separate document: https://apify.com/betterdevsscrape/reddit-scraper/changelog.md

# Actor input Schema

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

Reddit URLs to scrape. Supports post URLs, subreddit URLs, user profile URLs, and leaderboard URLs. Remove all URLs if using the search field instead.

Examples:

- https://www.reddit.com/r/technology/
- https://www.reddit.com/r/AskReddit/comments/abc123/some_post/
- https://www.reddit.com/user/spez/

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

List of subreddits to scrape (without r/ prefix). Simpler than Start URLs — just type the name.

Examples: programming, javascript, datascience, AskReddit

## `searches` (type: `array`):

Search terms to find Reddit content. Each query runs a separate search. Works alongside or instead of Start URLs.

Examples: web scraping, machine learning, best programming language 2026

## `searchCommunityName` (type: `string`):

Restrict search results to a specific subreddit (without r/ prefix). Leave empty to search all of Reddit.

Examples: programming, AskReddit, technology

## `searchPosts` (type: `boolean`):

Include posts (links, text posts, images) in search results.

Default: enabled

## `searchComments` (type: `boolean`):

Include individual comments in search results. Useful for finding specific discussions.

Default: disabled

## `searchCommunities` (type: `boolean`):

Include subreddits/communities in search results. Great for discovering relevant communities.

Default: disabled

## `searchUsers` (type: `boolean`):

Include user profiles in search results.

Default: disabled

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

Maximum total items (posts + comments + communities + users) saved to the dataset. Each item costs $0.003. Start small to estimate costs, then scale up.

Examples: 50, 100, 500, 1000

## `maxPostCount` (type: `integer`):

Maximum number of posts to scrape from each subreddit or search result page. Reddit's API returns up to ~1000 posts per subreddit (use date windowing to break this limit).

Examples: 10, 25, 50, 100, 1000

## `postsPerSource` (type: `integer`):

Maximum posts to scrape from EACH subreddit or search query independently. Useful when scraping multiple subreddits and you want equal coverage. Leave at 0 to use 'Max posts per subreddit' for all sources.

Examples: 25, 50, 100

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

Maximum comments to extract per post. The scraper automatically fetches collapsed/hidden comments beyond Reddit's initial ~500. Set to 0 to skip comments entirely.

Examples: 0 (no comments), 10, 50, 100, 500

## `maxCommunitiesCount` (type: `integer`):

Maximum number of community listing pages to process.

Examples: 1, 2, 5

## `maxUserCount` (type: `integer`):

Maximum number of user listing pages to process.

Examples: 1, 2, 5

## `maxLeaderBoardItems` (type: `integer`):

Maximum subreddits to scrape from the popular subreddits leaderboard.

Examples: 5, 10, 25

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

How to sort posts and search results.

• **hot** — Trending posts right now (default)
• **new** — Most recent posts first
• **top** — Highest-scoring posts (combine with Time filter)
• **rising** — Posts gaining traction quickly
• **relevance** — Best match for search queries
• **comments** — Most-commented posts first

## `time` (type: `string`):

Filter posts by time period. Only applies when sort is 'top' or 'controversial'.

• **all** — All time (default)
• **hour** — Past hour
• **day** — Past 24 hours
• **week** — Past 7 days
• **month** — Past 30 days
• **year** — Past 365 days

## `commentSort` (type: `string`):

How to sort comments within posts.

• **confidence** — Reddit's 'Best' sort (default) — balances score and recency
• **top** — Highest-scoring comments first
• **new** — Most recent comments first
• **controversial** — Most debated comments first
• **old** — Oldest comments first
• **qa** — Q\&A mode (OP responses prioritized)

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

Only include posts with at least this many upvotes. Leave empty for no minimum.

Examples: 10, 100, 1000

## `maxScore` (type: `integer`):

Only include posts with at most this many upvotes. Leave empty for no maximum.

Examples: 100, 500, 10000

## `minComments` (type: `integer`):

Only include posts with at least this many comments. Leave empty for no minimum.

Examples: 5, 50, 100

## `maxCommentsFilter` (type: `integer`):

Only include posts with at most this many comments. Leave empty for no maximum. Note: This filters which posts to include — 'Max comments per post' controls how many comments to extract.

Examples: 100, 500, 1000

## `flairFilter` (type: `string`):

Only include posts matching this flair text (case-insensitive partial match). Leave empty for all flairs.

Examples: Discussion, Question, News, Tutorial

## `domainFilter` (type: `string`):

Only include posts linking to URLs containing this domain. Leave empty for all domains.

Examples: youtube.com, github.com, imgur.com, self.programming

## `authorFilter` (type: `string`):

Only include posts by this specific author (username without u/ prefix). Leave empty for all authors.

Examples: spez, GovSchwarzenegger, AutoModerator

## `includeNSFW` (type: `boolean`):

Whether to include posts and subreddits marked as Not Safe For Work.

Default: disabled

## `postDateLimit` (type: `string`):

Only scrape posts created after this date. Format: YYYY-MM-DD.

Examples: 2025-01-01, 2026-01-15, 2026-02-01

## `skipComments` (type: `boolean`):

Don't scrape comments when processing posts. Faster and cheaper if you only need post data.

Default: disabled

## `skipUserPosts` (type: `boolean`):

Don't scrape a user's submitted posts when processing user profiles.

Default: disabled

## `skipCommunity` (type: `boolean`):

Don't scrape subreddit metadata (member count, description, rules, etc). Posts will still be scraped.

Default: disabled

## `enableDateWindowing` (type: `boolean`):

Break past Reddit's ~1000 post pagination limit by splitting requests into weekly date-range search windows. Enable this when scraping large subreddits with maxPostCount > 1000.

Default: disabled

## `ignoreStartUrls` (type: `boolean`):

Ignore startUrls and only use search queries and/or subreddits list. Useful for Zapier/API integrations where you don't want the prefilled URL.

Default: disabled

## `proxy` (type: `object`):

Datacenter proxies work great for Reddit's JSON API. Residential proxies are available if you experience issues but cost significantly more.

Default: Apify Datacenter proxies

## `debugMode` (type: `boolean`):

Enable verbose logging for troubleshooting. Shows detailed request/response information including filter skip reasons.

Default: disabled

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/technology/"
    }
  ],
  "subreddits": [
    "programming",
    "javascript"
  ],
  "searches": [
    "web scraping"
  ],
  "searchPosts": true,
  "searchComments": false,
  "searchCommunities": false,
  "searchUsers": false,
  "maxItems": 50,
  "maxPostCount": 25,
  "postsPerSource": 0,
  "maxComments": 10,
  "maxCommunitiesCount": 2,
  "maxUserCount": 2,
  "maxLeaderBoardItems": 5,
  "sort": "hot",
  "time": "all",
  "commentSort": "confidence",
  "includeNSFW": false,
  "skipComments": false,
  "skipUserPosts": false,
  "skipCommunity": false,
  "enableDateWindowing": false,
  "ignoreStartUrls": false,
  "proxy": {
    "useApifyProxy": true
  },
  "debugMode": false
}
```

# Actor output Schema

## `posts` (type: `string`):

Reddit posts with titles, scores, comment counts, media URLs, flairs, and metadata.

## `comments` (type: `string`):

Comments and replies with author info, scores, thread depth, and parent references.

## `communities` (type: `string`):

Subreddit metadata including member counts, descriptions, rules, and activity stats.

## `users` (type: `string`):

User profiles with karma breakdown, account age, premium status, and verification.

# 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/"
        }
    ],
    "subreddits": [
        "programming",
        "javascript"
    ],
    "searches": [
        "web scraping"
    ],
    "maxItems": 50,
    "maxPostCount": 25,
    "postsPerSource": 0,
    "maxComments": 10,
    "sort": "hot",
    "commentSort": "confidence",
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("betterdevsscrape/reddit-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/" }],
    "subreddits": [
        "programming",
        "javascript",
    ],
    "searches": ["web scraping"],
    "maxItems": 50,
    "maxPostCount": 25,
    "postsPerSource": 0,
    "maxComments": 10,
    "sort": "hot",
    "commentSort": "confidence",
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("betterdevsscrape/reddit-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/"
    }
  ],
  "subreddits": [
    "programming",
    "javascript"
  ],
  "searches": [
    "web scraping"
  ],
  "maxItems": 50,
  "maxPostCount": 25,
  "postsPerSource": 0,
  "maxComments": 10,
  "sort": "hot",
  "commentSort": "confidence",
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call betterdevsscrape/reddit-scraper --silent --output-dataset

```

## MCP server setup

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