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

Reddit scraper and Reddit data scraper API: scrape Reddit posts, comments, users and subreddits from any URL, search, subreddit or username. Scores, upvote ratio, full text, flair, media and comment threads with depth and reply counts. No login, no start fee, pay per result.

- **URL**: https://apify.com/deepmine/reddit-scraper.md
- **Developed by:** [DeepMine](https://apify.com/deepmine) (community)
- **Categories:** Social media, Lead generation, AI
- **Features:** Limited permissions
- **Stats:** 4 total users, 3 monthly users, 83.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

### What does Reddit Scraper do?

Reddit Scraper finds Reddit discussions about a product or problem and exports the posts and their replies. Paste a Reddit URL or enter search words, and get full text, scores, authors and thread links without logging in: posts, comments, users and subreddits, as a Reddit data scraper for CSV, Excel and JSON, or as a Reddit API from your own code. No login, no browser, no cookies.

These are real rows from the prefilled run (search "crm recommendation", past year, 20 posts with 4 comments each):

| Post | Community | Score | Comments | Posted |
|---|---|---:|---:|---|
| [Which CRM do you recommend](https://www.reddit.com/r/CRM/comments/1x5i47y/which_crm_do_you_recommend/) | r/CRM | 18 | 126 | 2026-10-14 |
| [HELP! What CRM do you recommend?](https://www.reddit.com/r/CRM/comments/1tupsg7/help_what_crm_do_you_recommend/) | r/CRM | 11 | 100 | 2026-06-02 |
| [Looking for a new CRM platform. Any recommendations?](https://www.reddit.com/r/CRMSoftware/comments/1upfhuq/looking_for_a_new_crm_platform_any_recommendations/) | r/CRMSoftware | 19 | 77 | 2026-07-07 |
| [Which CRM would you recommend for our small business?](https://www.reddit.com/r/CRM/comments/1t6jj1s/which_crm_would_you_recommend_for_our_small/) | r/CRM | 17 | 95 | 2026-05-07 |
| [Looking for a Free CRM tool for a Small Business Recommendations?](https://www.reddit.com/r/CRMSoftware/comments/1s2xfnd/looking_for_a_free_crm_tool_for_a_small_business/) | r/CRMSoftware | 32 | 97 | 2026-03-25 |

<sub>Collected 2026-10-25 at 18:52 UTC (run xaN5ZYtU2Leu1yk52, build 0.1.41). The first five of the run's 20 posts are shown, each with the 4 comments the prefill asks for (80 comments, 100 rows in all). The run took 6.9 seconds from start to finish on the default 256 MB; the first row was saved 2.1 seconds after the Actor's own collection timer began (it excludes the platform's container start). One run, not a guarantee for other inputs.</sub>

$0.99 per 1,000 results on Starter ($1.09 Free, $0.89 Scale, $0.79 Business), whether the result is a post, a comment, a user or a community. The prefilled run (100 results) costs $0.099 on Starter. No start fee, and you pay only for results you get.

### Start in three steps

1. **Run the prefilled CRM search**, or replace its URL with your own Reddit search, post or subreddit link. Or type search words in **Search terms**.
2. **Choose** whether to include comments and how many posts and comments to collect.
3. **Start, then open the results** on the Output tab and download CSV, Excel or JSON. Or schedule the run.

Copy/paste input for the API (Actor id `deepmine/reddit-scraper`), the prefilled run:

```json
{
  "startUrls": [{ "url": "https://www.reddit.com/search/?q=crm+recommendation&sort=relevance&t=year" }],
  "includeComments": true,
  "maxCommentsPerPost": 4,
  "maxItemsPerSource": 20
}
```

From Python with the official Apify client (set your API token in `APIFY_TOKEN`):

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("deepmine/reddit-scraper").call(run_input={
    "startUrls": [{"url": "https://www.reddit.com/search/?q=crm+recommendation&sort=relevance&t=year"}],
    "includeComments": True,
    "maxCommentsPerPost": 4,
    "maxItemsPerSource": 20,
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["dataType"], row.get("title") or (row.get("body") or "")[:60], row.get("upVotes"))
```

### What can you scrape from Reddit?

- **Subreddits**: hot, new, top, rising or controversial posts, any period.
- **Search**: posts for any words (all of Reddit or one subreddit), comments that use your words anywhere on Reddit, plus communities (with their rules) and users.
- **Media search**: Reddit's own Media tab for any words: image, gallery and video posts, each a full post row. Set **Search for** to **Media**, or paste a Reddit search link with `type=media`.
- **Community leaderboards**: Reddit's Explore lists in Reddit's order, with `leaderboardRank`: the 250 most visited communities, or a topic or subtopic (Crypto, Games, Sports...). Paste `reddit.com/explore/` links, or trudax-style `/subreddits/leaderboard/<category>/` links: Reddit retired those pages, so they're read from Explore (the run log says which list).
- **Posts by URL**: the post, plus its comments when **Include comments** is on, up to **Max comments per post** (replies included, with `depth`, `parentId` and `rootCommentId` on every comment, and `numberOfReplies` when the comment's replies were read).
- **Users**: profile (karma, account age, verification, moderator), their posts and their comments (`/user/<name>/comments/` links work too).
- **Any Reddit link**: paste subreddit, post, user, search or front-page URLs into one list.

Filters: posted after or before a date (or "7 days"), minimum score, NSFW on or off, and for searches **Match** (every word, or the exact phrase, in the post's title and text or the comment). Filtered-out posts aren't charged.

### Use cases

- **Lead generation**: find people asking for a tool like yours ("crm recommendation", "alternative to X") and read what they need in the comments.
- **Market and product research**: collect what a community says about a product, a competitor or a problem, with scores to see what resonates.
- **Brand and topic monitoring**: run a search or a subreddit on a schedule with **Posted after** set to "1 day" to get only what's new (recipe below).
- **Datasets for AI and analysis**: whole comment threads with `depth`, `parentId` and `rootCommentId`, ready to rebuild conversations.
- **Community and creator research**: subreddit size, age and rules; user karma, account age and post history.

#### Recipe: a daily monitor

Search the topic, newest first, and keep only what was posted in the last day. In the Console form, clear the prefilled Reddit URL and fill **Search terms**; through the API, leave `startUrls` out:

```json
{
  "searches": ["best crm for startups"],
  "searchSort": "new",
  "postedAfter": "1 day",
  "includeComments": true,
  "maxCommentsPerPost": 20,
  "maxItemsPerSource": 100
}
```

Schedule it daily on Apify. `postedAfter` filters by when the post was written, so each run returns what is new in that window. It is not a memory across runs: a result a later run finds again is charged again, once per run.

### How much does it cost to scrape Reddit?

You pay per result in your dataset: a post, a comment, a user or a community, all at the same price.

| Apify plan | Price per 1,000 results |
|---|---:|
| Free | $1.09 |
| Starter | $0.99 |
| Scale | $0.89 |
| Business | $0.79 |

Each post, comment, user or community is charged once per run, even when several of your inputs find it. There's no start fee, and the run stops at your spending limit.

### Input

The prefill searches Reddit for "crm recommendation" (past year) and reads 20 posts with 4 comments each. To change it:

- **Reddit URLs**: any subreddit, post, user or search link.
- **Search terms**: one per line; choose posts, comments, communities, users or media in **Search for**.
- **Include comments** and **Max comments per post**: up to 100,000 comments per post. Reddit's first answer comes in its own order (Best, Top, New, Controversial, Old or Q\&A); on big threads the rest follow as they're read: 1,000 comments of a 3,141-comment thread took an 18 s run on 2026-10-22 (very large asks take longer).
- **Max posts per source**: per URL, search term, subreddit or user. Reddit lists about 1,000 posts per subreddit sort and about 250 per search sort; **Maximize coverage** reads a search in more sorts and periods and merges them without duplicates.
- **Max results (total)**: a cap for the whole run, every source, post, comment, user and community counted together. Leave it empty for no total cap.
- Below the first screen: **Subreddits and users** (names instead of URLs, sort and period, what to get per user), **Search options** (sort, period, one subreddit only, Match, Maximize coverage), **Filters** (dates, minimum score, NSFW) and **Advanced** (comment depth and sort, proxy).

```json
{
  "startUrls": [{ "url": "https://www.reddit.com/r/smallbusiness/top/?t=week" }],
  "searches": ["best crm for startups"],
  "includeComments": true,
  "maxCommentsPerPost": 50,
  "maxItemsPerSource": 100,
  "postedAfter": "30 days"
}
```

### Coming from trudax/reddit-scraper-lite?

Paste your input as it is. Its keys are read as this Actor's, and the run log lists each one it translated. If you also give one of our own keys, ours is used. As of 2026-10-26, from its input schema and README:

| trudax/reddit-scraper-lite | Read here as |
|---|---|
| `maxItems` (total saved) | `maxResults` |
| `maxPostCount` (posts per page) | `maxItemsPerSource` |
| `maxComments`, `skipComments` | `maxCommentsPerPost`, `includeComments` (`maxComments: 0` or `skipComments: true`: no comments) |
| `sort`, `time` (search order and period) | `searchSort`, `searchTime`. Our own `sort` and `time` still order a subreddit's posts; `relevance` and `comments` are search orders in any input |
| `searchPosts`, `searchComments`, `searchCommunities`, `searchUsers`, `searchMedia` | one search per switch that is on |
| `searchCommunityName` | `withinSubreddit` |
| `postDateLimit` | `postedAfter`, with searches newest first, as trudax does |
| `commentDateLimit` | only comments posted after that date |
| `maxCommunitiesCount`, `maxUserCount` | communities and users per source |
| `skipUserPosts`, `skipCommunity` | users without their posts; `skipCommunity: false` adds each subreddit's community row |
| `ignoreStartUrls`, `proxy` | as there |
| `includeMediaLinks`, `scrollTimeout`, `navigationTimeout`, `debugMode` | not needed: scores, comment counts and media are always on the rows, and there's no browser |

Rows carry trudax's field names too, with the same values, next to ours: `numberOfComments` (our `commentsCount`), `upVoteRatio`, `userId`, `authorFlair`, `html`, `link`, `videoUrls`, `thumbnailUrl`, `contentType` and `category` (the subreddit) on posts and comments, `numberOfMembers`, `name` and `displayName` on communities, `userIcon` on users. `createdAt` has the same format (`2026-06-02T14:42:48.000Z`), and `imageUrls` is `[]` when a post has none. One difference: `id` is Reddit's full id with its type prefix on every row; trudax's community and user rows put the short id there, which is `parsedId` here.

### Output

Every row goes to one dataset, where `dataType` says what it is: `post`, `comment`, `user` or `community`. The Output tab opens **All results** (every row type together, one dataset) and, for each type, a page with Excel, CSV, JSON and HTML-table links to a free table that holds only that type's rows: **Posts only**, **Comments only**, **Users only**, **Communities only**. The dataset's own type views (Storage tab) pick that type's columns but still list the other types' rows, blank in them, so use the "only" pages (or filter on `dataType`) to take one type. Each row is charged once. Download as JSON, CSV, Excel or HTML, or read it through the Apify API.

A comment row (prefilled run, shortened):

```json
{
  "dataType": "comment",
  "id": "t1_opbsaek",
  "upVotes": 4,
  "createdAt": "2026-06-02T14:42:48.000Z",
  "depth": 0,
  "parentId": "t3_1tupsg7",
  "postId": "t3_1tupsg7",
  "postTitle": "HELP! What CRM do you recommend?",
  "communityName": "r/CRM"
}
```

**Post fields** (111): `id`, `url`, `title`, `body`, `communityName`, `username`, `upVotes`, `upvoteRatio`, `commentsCount`, `createdAt`, `flair`, `postType`, `contentUrl`, `domain`, `imageUrls`, `videoUrl`, `thumbnail`, `over18`, `ageHours`, `scorePerHour`, `commentsPerHour`, `engagementTotal`, `wordCount`, `bodyHtml`, `subredditSubscribers`, `authorId`, `authorFlairText`, `editedAt`, `isSelf`, `isVideo`, `isGallery`, `isDeletedOrRemoved`, `spoiler`, `locked`, `stickied`, `isAd`, `numCrossposts`, `numDuplicates` (filled when **Include comments** is on: it's only on the post's own page), `crosspostParentUrl`, `galleryImages`, `galleryCaptions`, `mediaAssets`, `embed`, `media`, `preview`, `permalink`, `oldRedditUrl`, `shortUrl` and more.

**Comment fields** (65): `id`, `url`, `body`, `username`, `upVotes`, `createdAt`, `depth`, `parentId`, `parentKind`, `rootCommentId`, `postId`, `postTitle`, `postUrl`, `postUpVotes`, `postCommentsCount`, `postCreatedAt`, `postAuthor`, `communityName`, `numberOfReplies`, `isSubmitter`, `edited`, `stickied`, `bodyHtml` and more. `numberOfReplies` is filled when the comment's replies were read: it was empty on 16 of the 80 comments in the run above, which does not mean they have no replies.

**User fields** (38): `username`, `totalKarma`, `postKarma`, `commentKarma`, `createdAt`, `accountAgeDays`, `iconUrl`, `snoovatarImg`, `previousNames`, `profileVisibility`, `isVerified`, `isMod`, `isEmployee`, `description` and more. `totalKarma` is post plus comment karma, the total Reddit's profile page shows. `awardeeKarma` and `awarderKarma` stay empty: since Oct 26, 2026 Reddit shows them on no logged-out page. **Community fields** (58): `communityName`, `title`, `subscribers`, `weeklyActiveUsers` and `weeklyContributions` (the weekly visitors and contributions Reddit shows on the community's page), `onlineUsersCount` (filled when Reddit sends it; its logged-out data has no online count today, so it is usually empty), `whitelistStatus` (Reddit's ad status: `all_ads`, `some_ads`, `house_only` or `promo_adult_nsfw`), `description`, `descriptionHtml`, `headerTitle`, `rules` (name, description, kind and report reason of each rule), `createdAt`, `over18`, `language`, `iconUrl`, `headerImage`, `restrictCommenting`, `spoilersEnabled`, `linkFlairEnabled`, `suggestedCommentSort`, `leaderboardRank` and `leaderboardTopic` (from a leaderboard) and more.

Every row also has `input` (which of your inputs found it) and `scrapedAt` (when its page was read). Run totals, per-input counts and anything not found are in the run's OUTPUT record.

### Measured examples

Dated runs on Apify (256 MB, datacenter proxy), each one run, not a guarantee:

| Run | Results | Time |
|---|---:|---:|
| The prefill: search "crm recommendation", 20 posts with 4 comments each (Oct 25, 2026) | 100 | 6.9 s (first row at 2.1 s on the Actor's own timer) |
| The same prefill (Oct 22, 2026) | 100 | 12 and 17 s in two runs (first row at 3.1 and 10.3 s) |
| r/Python, newest, 1,000 posts asked (Reddit lists 951; Oct 20, 2026) | 951 | 46 s (first row at 1.6 s) |

Most of a big subreddit run is Reddit's own answer time: it serves one 100-post page at a time, about 3 seconds each in that run (30 of its 46 seconds), and each page needs the one before it.

Run outcomes, as Apify counts them in the public 30-day figure on 2026-10-25 (aborted and timed-out runs included, not a completeness or speed comparison): this Actor 25 of 25 runs succeeded, our own checks among them. The most-used Reddit scraper on the Store, trudax/reddit-scraper-lite, 300,019 of 345,534 (86.8%): 3,701 failed, 32,353 timed out, 9,461 aborted.

### Is it legal to scrape Reddit?

This Actor reads only public Reddit content that anyone can see without logging in. It doesn't log in and doesn't touch private or quarantined communities. If your results include personal data, you're responsible for handling it lawfully (for example under GDPR).

### FAQ

**What if Reddit fails in the middle of a thread?** Each thread page is tried up to 4 times, each time from a new IP. If one still fails, the comments read so far stay in your dataset, and the run's status and OUTPUT (`commentsIncomplete`) list the posts whose threads stopped early.

**Can it search comments?** Yes: set **Search for** to **Comments**, or paste a Reddit search link with `type=comments`. It reads Reddit's own comment search (relevance, new or top) and fills each comment in with its full record: author, score, time, parent, post and community. **Search only in this subreddit** uses Reddit's own subreddit search (and each row is checked again). Reddit's comment search has no period of its own, so **Search period** and **Posted after/before** are applied to what it returns: other comments are skipped and free, you pay only for the rows you get. A narrow period over a broad word reads more pages to find matches (it gives up after 15 pages in a row with none), so use sort **New** with a short period. Same price as any other row, no residential proxy needed.

**Why fewer posts than I asked for?** Reddit itself stops a subreddit sort at about 1,000 posts and a search sort at about 250. Use other sorts and periods, or **Maximize coverage** for searches.

**Is it fast?** Results arrive page by page as Reddit answers, and the next page is already being read while one is saved. See the measured examples above; memory peaked at 99 MB in the Oct 20 and Oct 22 runs.

**Does my Apify plan matter?** Only for very large runs. Reddit allows 100 requests per IP every 10 minutes, and the run uses your plan's datacenter proxy IPs: 5 on the Free plan (about 500 requests, or 50,000 posts, per 10 minutes), 30 or more on paid plans. When every IP has used its 100, the run pauses until Reddit's window resets and says so in its status, then carries on. If the pause would run past your run's timeout, it stops just before it and keeps every row it collected.

### More Reddit Actors

1. **Find where to look.** [Reddit Subreddit Finder](https://apify.com/deepmine/reddit-subreddit-finder) ranks the communities for a niche; [Subreddit Trend Finder](https://apify.com/deepmine/subreddit-trend-finder) shows what is rising in them right now.
2. **Find the posts, and the people asking.** [Reddit Posts Scraper](https://apify.com/deepmine/reddit-posts-scraper), [Subreddit Scraper](https://apify.com/deepmine/subreddit-scraper), [Reddit Search Scraper](https://apify.com/deepmine/reddit-search-scraper) read subreddits, searches and links; [Reddit Lead Generation Scraper](https://apify.com/deepmine/reddit-lead-gen-scraper) keeps the posts and comments that ask for a recommendation or a switch, and [Reddit Mentions Scraper](https://apify.com/deepmine/reddit-mentions-scraper), [Reddit Brand Monitor](https://apify.com/deepmine/reddit-brand-monitor), [Reddit Sentiment Tracker](https://apify.com/deepmine/reddit-sentiment-tracker) follow a brand over time.
3. **Read the whole conversation.** Paste a post link into [Reddit Comments Scraper](https://apify.com/deepmine/reddit-comments-scraper) for every comment and reply. A Reddit search-result link works too: this Actor reads the matching threads whole with **Include comments** on.

- [Reddit API](https://apify.com/deepmine/reddit-api): the same data with ready-made code examples.
- [Reddit Comments Scraper](https://apify.com/deepmine/reddit-comments-scraper), [Reddit Search Scraper](https://apify.com/deepmine/reddit-search-scraper), [Reddit User Scraper](https://apify.com/deepmine/reddit-user-scraper), [Subreddit Scraper](https://apify.com/deepmine/subreddit-scraper) and [Reddit Posts Scraper](https://apify.com/deepmine/reddit-posts-scraper): one focused job each.
- [Reddit Mentions Scraper](https://apify.com/deepmine/reddit-mentions-scraper), [Reddit Brand Monitor](https://apify.com/deepmine/reddit-brand-monitor) and [Reddit Sentiment Tracker](https://apify.com/deepmine/reddit-sentiment-tracker): follow a brand or a keyword on a schedule, then open any mention here for its thread.
- Researching a brand beyond Reddit? [TikTok Search API](https://apify.com/deepmine/tiktok-search-api) and [Instagram Reels Search](https://apify.com/deepmine/instagram-reels-search) find the same topic in short videos.

### Feedback

Found a bug or need a field? Open an issue on the Actor's Issues tab; we read every one. If the data helps you, a short review on this page helps other people find it.

# Actor input Schema

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

Any Reddit link, one per row: a subreddit (r/Python, r/Python/top/?t=week), a post, a user (u/spez), a search (reddit.com/search/?q=..., \&type=media for images and videos), a community leaderboard (reddit.com/explore/, /subreddits/leaderboard/crypto/) or the front page. Leave empty if you use Search terms or the sections below.

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

Words to search all of Reddit for, one per line, e.g. best crm for startups. 'Search for' picks posts, comments, communities or users.

## `searchType` (type: `string`):

What the search terms look for. Comments finds comments that use your words anywhere on Reddit (Search sort: relevance, new or top; Search period and Search only in this subreddit apply), each with its post and community. Media reads Reddit's Media tab: image, gallery and video posts, each a full post row.

## `includeComments` (type: `boolean`):

Add each post's comments, replies included, right after the post. Each comment is one result.

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

Most comments to read per post, replies included, in Reddit's thread order (e.g. 4 for a quick look, 500 for whole threads).

## `maxItemsPerSource` (type: `integer`):

Most posts (or communities or users) per URL, search term, subreddit or user. Reddit lists about 1,000 posts per subreddit sort and about 250 per search sort; 'Maximize coverage' gets more from a search.

## `maxResults` (type: `integer`):

Most rows for the whole run: every source, post, comment, user and community counted together. Empty = no total cap (Max posts per source and your spending limit still apply).

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

Subreddit names (Python or r/Python), one per line. Their posts are read in the order set by 'Subreddit sort'.

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

Order of subreddit posts, as on Reddit. Empty means Hot. Relevance and Most comments are search orders (trudax's sort): they set Search sort instead.

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

Period for the Top and Controversial sorts. Empty means Past 24 hours.

## `users` (type: `array`):

Reddit usernames (spez or u/spez), one per line.

## `userContent` (type: `array`):

The profile (karma, account age, verification), the user's posts, the user's comments, or any mix.

## `searchSort` (type: `string`):

Order of search results.

## `searchTime` (type: `string`):

How far back a search looks. Comments older than this are skipped (Reddit's comment search has no period of its own, so it is applied here; skipped comments are free).

## `withinSubreddit` (type: `string`):

Optional subreddit name (e.g. CRM) to limit search terms to. With Comments, other communities' comments are skipped (free).

## `matchMode` (type: `string`):

How closely a post or comment must match your search terms.

• Reddit's match: whatever Reddit's search finds (it also matches word stems and other fields, so some results only touch your words).
• Every word: the post's title and text (or the comment) must hold every word of the search term, in any order.
• Exact phrase: the words in a row, as typed (case, punctuation and line breaks don't matter).

Results that don't match aren't delivered and aren't charged. A post's own comments (Include comments) always come with it.

## `maximizeCoverage` (type: `boolean`):

Reddit stops a search at about 250 posts per sort. On: each search is also read in other sorts and periods (new, top by year, month, week...) and merged without duplicates.

## `postedAfter` (type: `string`):

Only posts and comments from after this date: 2026-09-01, 2026-09-01T12:00:00Z, or a period like '7 days' or '12 hours'.

## `postedBefore` (type: `string`):

Only posts and comments from before this date (same formats).

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

Skip posts with a lower score (upvotes minus downvotes), e.g. 10. Empty = no minimum.

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

Keep posts and communities marked 18+.

## `commentDepth` (type: `integer`):

How deep in reply chains to go: 1 = top-level comments only, 10 = Reddit's maximum.

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

Order of comments, as on Reddit.

## `includeCommunityRules` (type: `boolean`):

For community search results, also read each community's rules (one extra Reddit call per community; free).

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

Leave as is: Reddit answers Apify's datacenter proxy, the cheapest option. If you pick Residential, the run still reads through datacenter and uses your residential IPs only to retry a call Reddit refuses there.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.reddit.com/search/?q=crm+recommendation&sort=relevance&t=year"
    }
  ],
  "searchType": "posts",
  "includeComments": true,
  "maxCommentsPerPost": 4,
  "maxItemsPerSource": 20,
  "userContent": [
    "profile",
    "posts",
    "comments"
  ],
  "searchSort": "relevance",
  "searchTime": "all",
  "matchMode": "any",
  "maximizeCoverage": false,
  "includeNSFW": true,
  "commentDepth": 10,
  "commentSort": "confidence",
  "includeCommunityRules": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

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

No description

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

No description

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

No description

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

No description

## `summary` (type: `string`):

No description

# 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/search/?q=crm+recommendation&sort=relevance&t=year"
        }
    ],
    "includeComments": true,
    "maxCommentsPerPost": 4,
    "maxItemsPerSource": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("deepmine/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/search/?q=crm+recommendation&sort=relevance&t=year" }],
    "includeComments": True,
    "maxCommentsPerPost": 4,
    "maxItemsPerSource": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("deepmine/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/search/?q=crm+recommendation&sort=relevance&t=year"
    }
  ],
  "includeComments": true,
  "maxCommentsPerPost": 4,
  "maxItemsPerSource": 20
}' |
apify call deepmine/reddit-scraper --silent --output-dataset

```

## MCP server setup

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