# Reddit Search and Thread Scraper (`mambalabs/reddit-search-thread-scraper`) Actor

Search Reddit by keyword and subreddit, read subreddits, or read threads with comments. One row per post and comment: title, text, author, subreddit, date, link, and the search term it matched. No login, no Reddit API key. CSV or Clay ready.

- **URL**: https://apify.com/mambalabs/reddit-search-thread-scraper.md
- **Developed by:** [Mamba Labs](https://apify.com/mambalabs) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.28 / 1,000 post rows

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 Search and Thread Scraper

Search Reddit by keyword, read the newest posts of a subreddit, or read a thread with its comments. You get one flat row per post and, when you ask for them, one row per comment: title, text, author, subreddit, publish date, the post link, the outbound link of a link post, and the search term the post matched. Rows export to CSV or drop into a Clay table, a CRM import, or a monitoring sheet.

### Features

- **Keyword search, across Reddit or inside subreddits.** Each search term runs across all of Reddit, or inside each subreddit you list, sorted by new, relevance, top, most comments, or hot, inside Reddit's own time window.
- **Only posts that contain your term.** On by default: a result is kept only when your search term is in the post's title or text, so results Reddit returns for other reasons are dropped and not charged. Turn it off to keep every result.
- **Subreddit reads.** List subreddits with no search term and get their newest, hot, top, or rising posts.
- **Threads with comments.** Paste thread URLs and get the post plus its top comments, with reply depth you choose. Or turn on Include comments to get the comments of every post a search finds.
- **Date limit.** Only posts from the last N days, by publish date.
- **Only new results.** On a schedule, a post or comment an earlier run returned for the same query is skipped and not charged, so each run returns what is new.
- **One summary row per query.** A free row per search, subreddit, or thread says how many posts Reddit returned, how many were delivered, and how many were skipped and why.
- **Cost guards.** Max posts per query, max comments per thread, and a max charge per run.

### How Reddit is read

The actor reads Reddit's public feeds (RSS), the same pages any feed reader opens, through the Apify proxy. No Reddit account, no login, and no Reddit API key are used, and no other developer's actor is called. The proxy pool rotates the address on every request; a request the pool cannot get through is retried on residential addresses.

### Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `search_terms` | array | | Keywords to search for. With subreddits, each term runs inside each subreddit |
| `subreddits` | array | | Subreddits to search in, or to read when there is no search term |
| `thread_urls` | array | | Thread URLs to read with their comments, up to 200 |
| `sort` | string | `new` | Search order: `new`, `relevance`, `top`, `comments`, `hot` |
| `subreddit_sort` | string | `new` | Subreddit read order: `new`, `hot`, `top`, `rising` |
| `time_window` | string | `month` | Reddit's time filter: `hour`, `day`, `week`, `month`, `year`, `all` |
| `since_days` | number | | Drop posts older than this many days |
| `max_posts_per_query` | number | `50` | Posts per search or subreddit, up to 1,000. Results without your term do not count |
| `require_term_match` | `true` or `false` | `true` | Keep a search result only when the term is in its title or text |
| `include_comments` | `true` or `false` | `false` | Also return the comments of every post found |
| `max_comments_per_thread` | number | `25` | Comments per thread, top first, up to 500 |
| `comment_depth` | number | `3` | Reply levels under each top level comment, 1 to 10 |
| `only_new` | `true` or `false` | `false` | Skip posts and comments an earlier run returned for the same query (free) |
| `state_key` | string | | Name for the only new results memory |
| `max_charge_usd` | string | | Stop before a charge that would pass this amount |
| `proxy_mode` | string | `auto` | `auto` or `residential`. A reliability setting; it does not change what you pay |

Give at least one of `search_terms`, `subreddits`, or `thread_urls`. Up to 50 searches per run (search terms times subreddits).

### Output

| Field | Type | Example |
|---|---|---|
| `row_type` | string | `post`, `comment`, `query_summary`, or `run_summary` |
| `query_type` | string | `search`, `subreddit`, or `thread` |
| `query` | string | `cold email in r/sales` |
| `subreddit` | string | `sales` |
| `post_id` | string | `1xhlf4x` |
| `comment_id` | string | `nq2k3ab` (comment rows) |
| `title` | string | the post title (on a comment row, the title of its post) |
| `body` | string | the post or comment text, plain text, up to 20,000 characters |
| `author` | string | `salesguy42` |
| `author_url` | string | `https://www.reddit.com/user/salesguy42/` |
| `post_url` | string | link to the post |
| `comment_url` | string | link to the comment (comment rows) |
| `link_url` | string | the page a link post links to |
| `published_at` | string | `2026-10-27T14:03:11+00:00` |
| `updated_at` | string | when Reddit last updated the entry |
| `matched_terms` | array | `["cold email"]` (search rows) |
| `comments_read` | number | comment rows that follow this post |
| `is_new` | `true` or `false` | `true` with Only new results on |
| `posts_found`, `rows_delivered`, `skipped_seen`, `skipped_unmatched` | number | query summary counts |
| `row_status` | string | `ok`, `no_results`, `no_change`, `partial`, `blocked`, or `error` |
| `error_reason` | string | why a summary row is not ok |
| `billable_events_json` | string | `{"post-row":1}`, or `{}` for a free row |
| `scraped_at` | string | when the row was written |

Reddit's public feeds do not carry upvote scores or comment counts, so the rows do not either. `comments_read` counts the comment rows this run read for a post.

### Pricing

Pay per event. You pay for post rows, comment rows, and the run start. Summary rows, a refused input, search results without your term, and rows already delivered with Only new results on are free.

| Event | Free plan | Bronze | Silver | Gold |
|---|---|---|---|---|
| `post-row`, one Reddit post | $0.0015 | $0.001425 | $0.00135 | $0.001275 |
| `comment-row`, one Reddit comment | $0.0015 | $0.001425 | $0.00135 | $0.001275 |
| `apify-actor-start`, once per run (one per GB of memory; the default 256 MB is one) | $0.003144 | $0.003144 | $0.003144 | $0.003144 |

Per 1,000 posts: $1.50 on the free plan, $1.28 on Gold.

Free plan cap: 1.50 USD of evaluation a month, about 1000 post or comment rows. Any paid Apify plan removes the cap, and it resets on the 1st. The run stops before a charge that passes your maximum charge per run in Apify or your `max_charge_usd`.

Mamba Labs pays the platform costs of your run, Apify proxy traffic included.

### Usage examples

**Apify Console or API.**

```json
{
  "search_terms": ["cold email", "lead generation agency"],
  "subreddits": ["sales", "startups"],
  "sort": "new",
  "since_days": 7,
  "max_posts_per_query": 100
}
```

Read the rows with `GET https://api.apify.com/v2/datasets/{datasetId}/items`.

**A thread with its comments.**

```json
{
  "thread_urls": ["https://www.reddit.com/r/sales/comments/1abc23/is_cold_email_dead/"],
  "max_comments_per_thread": 100
}
```

**Clay.** Run the actor from a Clay HTTP column or the Apify integration and map the flat columns. Number and on or off inputs are text fields, which is what Clay sends: numbers as text and `true` or `false`. A list input takes a JSON list, so put the column inside a one item list.

**MCP.** The Mamba Labs MCP server `@mambalabsdev/mcp-reddit-search-thread-scraper` exposes the tool `search_reddit` to Claude and other MCP clients.

### Error handling

| Case | What you get |
|---|---|
| No search term, subreddit, or thread URL, or a value the actor cannot read | One free row, `row_type` `run_summary`, `error_reason` starting `input_invalid:` with what to fix. The run ends successfully and charges nothing but the run start |
| A subreddit that does not exist, is private, or is banned | A free summary row, `row_status` `no_results`, saying so |
| A thread that was removed or is in a private subreddit | A free summary row, `row_status` `no_results` |
| Reddit refuses a request | Retried on a new address, then on residential addresses; if every route refuses, a free summary row with `row_status` `blocked` |
| No new posts with Only new results on | A free summary row, `row_status` `no_change` |
| The run is close to its timeout | The actor stops starting new queries 90 seconds before the timeout and delivers what it has |

### Limitations

- Upvote scores, comment counts, awards, and flair are not in Reddit's public feeds, so the rows do not carry them.
- The actor reads at most 10 pages of 100 results per query. A narrow term with a strict match can return fewer posts than Max posts per query; the summary row says how many results were read and how many were dropped.
- Posts in private subreddits are not in Reddit's public feeds, so they are not returned.
- A deleted author reads `[deleted]`, and a removed post's text is empty.
- Comments come top first. Very long threads return the top comments up to Max comments per thread, not every reply.

### Mamba Labs actor suite

| Actor | Actor ID |
|---|---|
| [Account Hiring Watch](https://apify.com/mambalabs/account-hiring-watch?fpr=mamba) | `gRAZA5WBi1r6L0gy7` |
| [Agent Accessibility Auditor](https://apify.com/mambalabs/agent-accessibility-auditor?fpr=mamba) | `anxbRv0lKrpQ1pnua` |
| [Agent to Brokerage Resolver](https://apify.com/mambalabs/agent-brokerage-resolver?fpr=mamba) | `ePRRGLxOGyaVHO4dI` |
| [AI Tooling Detector](https://apify.com/mambalabs/ai-tooling-detector?fpr=mamba) | `EwkHhmqiuJgRoVEbE` |
| [B2B Reddit Conversation Monitor](https://apify.com/mambalabs/b2b-reddit-conversation-monitor?fpr=mamba) | `SoDryzzsjmY3SsiyG` |
| [Bluesky Brand Presence Mapper](https://apify.com/mambalabs/bluesky-brand-presence-mapper?fpr=mamba) | `eLpxzP4IuXznlFVND` |
| [Career Change Signal Engine](https://apify.com/mambalabs/career-change-signal-engine?fpr=mamba) | `vX2Yga1a6wGaXaP14` |
| [Company Change Event Feed](https://apify.com/mambalabs/company-change-event-feed?fpr=mamba) | `oX44rS0fkEJ3rXLWe` |
| [Company Contact Details Extractor](https://apify.com/mambalabs/company-contact-details-extractor?fpr=mamba) | `4mMncKaJykiq94grz` |
| [Company Discovery List Builder](https://apify.com/mambalabs/company-discovery-list-builder?fpr=mamba) | `jch0HdaZnpbMqlcGS` |
| [Company Firmographic Enricher](https://apify.com/mambalabs/company-firmographic-enricher?fpr=mamba) | `YlUtLWjfPpqykmB8g` |
| [Company Funding Record](https://apify.com/mambalabs/funding-investor-record?fpr=mamba) | `OFS4Mt1gyYNtGfUbE` |
| [Company Headcount Estimator](https://apify.com/mambalabs/company-headcount-estimator?fpr=mamba) | `aHC4GROnNt6kfZe5r` |
| [Company Identity Resolver](https://apify.com/mambalabs/company-identity-resolver?fpr=mamba) | `lr8fTRAmZCBZmuwwh` |
| [Company Social Presence Mapper](https://apify.com/mambalabs/company-social-presence-mapper?fpr=mamba) | `4k6CCemkgBDz18m2h` |
| [Competitor Price, Stock, and Changelog Monitor](https://apify.com/mambalabs/competitor-price-stock-changelog-monitor?fpr=mamba) | `yxdgCbUQ4PYQWwRNU` |
| [Contact Classifier](https://apify.com/mambalabs/contact-classifier?fpr=mamba) | `0lGSeYJmniXhGANnO` |
| [Contractor License Lookup](https://apify.com/mambalabs/contractor-license-lookup?fpr=mamba) | `WBYK3CPI2kdeq4bP1` |
| [Cookie Consent Audit](https://apify.com/mambalabs/cookie-consent-audit?fpr=mamba) | `TrKyOS0KBoGC35nbr` |
| [Domain Deliverability Checker](https://apify.com/mambalabs/domain-deliverability-checker?fpr=mamba) | `0tVgxI7A6o9jMlxmc` |
| [Domain to LinkedIn URL Resolver](https://apify.com/mambalabs/domain-to-linkedin-url-resolver?fpr=mamba) | `3HtnSaqPHOg1Qg5gx` |
| [Ecommerce Platform Profiler](https://apify.com/mambalabs/ecommerce-platform-profiler?fpr=mamba) | `5G2NeYjBbQTjaTn9L` |
| [Ecommerce Store Discovery](https://apify.com/mambalabs/ecommerce-store-discovery?fpr=mamba) | `PeHu4sLyFvQHXUUrX` |
| [Event Presence Index](https://apify.com/mambalabs/event-presence-index?fpr=mamba) | `WLhMy8fMDgsxdYxv5` |
| [Expert Witness Directory](https://apify.com/mambalabs/expert-witness-directory?fpr=mamba) | `LIpwlgfE3LaQBaXd4` |
| [Funding and Press Signal Scanner](https://apify.com/mambalabs/funding-press-signal-scanner?fpr=mamba) | `FS13X6dhQVgX3XOM6` |
| [GitHub Organization Signal Scanner](https://apify.com/mambalabs/github-organization-signal-scanner?fpr=mamba) | `ahF8RRpv5mzPao5CN` |
| [Google Ads Transparency Monitor](https://apify.com/mambalabs/google-ads-transparency-monitor?fpr=mamba) | `1eOwxhBVxzvOXAm4s` |
| [Government Contract Award Monitor](https://apify.com/mambalabs/public-award-monitor?fpr=mamba) | `zhEtllASykOcx9hJ8` |
| [GTM Hiring Signal Scraper](https://apify.com/mambalabs/gtm-hiring-signal-scraper?fpr=mamba) | `D7O1SA2EqwHGsGr1P` |
| [GTM Signals Aggregator](https://apify.com/mambalabs/b2b-buying-signals-hiring-tech-stack-intent-for-clay?fpr=mamba) | `xKdRfnfFNkdMpFuNs` |
| [ICP Fit Scorer](https://apify.com/mambalabs/icp-account-lead-scoring-fit-scorer-0-100-for-clay?fpr=mamba) | `W161DT8W4kW55dMFh` |
| [Influencer Change Monitor](https://apify.com/mambalabs/creator-change-monitor?fpr=mamba) | `d2VVgahNL6UmcLkhg` |
| [Influencer Finder](https://apify.com/mambalabs/creator-finder?fpr=mamba) | `tpkedmloIIWtXx6sg` |
| [Influencer Lead List Builder](https://apify.com/mambalabs/creator-lead-list-all-in-one?fpr=mamba) | `KnmByszcv135yM30G` |
| [Influencer Profile Scraper](https://apify.com/mambalabs/creator-profile-reader?fpr=mamba) | `EqEnklDVMIcB1V499` |
| [Influencer Talent Agency Lookup](https://apify.com/mambalabs/talent-agency-lookup?fpr=mamba) | `zCuX4Mgyg6JvXgGzd` |
| [Instagram Facebook Brand Presence Mapper](https://apify.com/mambalabs/meta-brand-presence-mapper?fpr=mamba) | `HXh65I0JBjPsunbY8` |
| [Integration and Marketplace Presence Mapper](https://apify.com/mambalabs/integration-marketplace-presence-mapper?fpr=mamba) | `V0guNuvM85Q61f2gj` |
| [Job Board Keyword Signal Scanner](https://apify.com/mambalabs/job-board-keyword-signal-scanner?fpr=mamba) | `4DvqpvhMR74NLcDDY` |
| [Job Change Tracker](https://apify.com/mambalabs/job-change-tracker?fpr=mamba) | `L8UbEmMJC1XYPSZOb` |
| [Job Posting Monitor](https://apify.com/mambalabs/gtm-job-discovery?fpr=mamba) | `QCfICD9kOPiOdj5iI` |
| [Legal Entity Resolver](https://apify.com/mambalabs/legal-entity-resolver?fpr=mamba) | `KHFyPCDIx7CyqULYm` |
| [Link in Bio Scraper and Newsletter Detector](https://apify.com/mambalabs/link-in-bio-newsletter-checker?fpr=mamba) | `OorucdheTIgu7RFzK` |
| [LinkedIn Company Page Mapper](https://apify.com/mambalabs/linkedin-company-presence-mapper?fpr=mamba) | `zOPm6A9JEhUGcIdFW` |
| [LinkedIn Post Tracker](https://apify.com/mambalabs/linkedin-post-engager-capture?fpr=mamba) | `oiGLNPuaf5BRaz9K5` |
| [Local Business Lead Builder](https://apify.com/mambalabs/local-business-lead-builder?fpr=mamba) | `qMN97aoHhsAS5bznV` |
| [Local Rank and Map Pack Tracker](https://apify.com/mambalabs/local-rank-map-pack-tracker?fpr=mamba) | `gv0kyHGDIg8XscclB` |
| [Lookalike Company Finder](https://apify.com/mambalabs/lookalike-company-finder?fpr=mamba) | `e2O426WBAbLLQL4Z2` |
| [Manufacturer and Supplier Finder](https://apify.com/mambalabs/manufacturer-supplier-finder?fpr=mamba) | `Qcsdmd0lUfPzVkonh` |
| [Meta Ad Library Monitor](https://apify.com/mambalabs/meta-ad-library-monitor?fpr=mamba) | `J1GWlSXfSGU3u8Wng` |
| [Mobile Phone Waterfall](https://apify.com/mambalabs/mobile-phone-waterfall-orchestrator?fpr=mamba) | `6OOgPktf7RIa5XCOP` |
| [New Company Registrations Feed](https://apify.com/mambalabs/new-company-registrations-feed?fpr=mamba) | `g2WfZhWvCtc57g2Jo` |
| [New Hire Finder](https://apify.com/mambalabs/new-hire-finder?fpr=mamba) | `cKuc38p4nYHNF3IW8` |
| [Newsletter Sponsor Tracker](https://apify.com/mambalabs/newsletter-sponsor-tracker?fpr=mamba) | `qSwpqxD1TiPZpLQHv` |
| [Open Tender and RFP Finder](https://apify.com/mambalabs/open-tender-rfp-finder?fpr=mamba) | `kPTGz6t6TFoUUyfaO` |
| [Outbound Stack Detector](https://apify.com/mambalabs/outbound-infrastructure-fingerprint?fpr=mamba) | `v43UJC8r7qW7cBSTG` |
| [Page Finder and Extractor](https://apify.com/mambalabs/page-finder-extractor?fpr=mamba) | `TpurgcOZbVnknlaiC` |
| [Partner and Member Directory Extractor](https://apify.com/mambalabs/partner-member-directory-extractor?fpr=mamba) | `ZX0XJPPUvnFJxeC1a` |
| [People Finder & Email Verifier](https://apify.com/mambalabs/people-finder?fpr=mamba) | `LEgloG7tWgQl4o6TD` |
| [Person LinkedIn URL Resolver](https://apify.com/mambalabs/person-linkedin-url-resolver?fpr=mamba) | `ssuyPV8LnEsL8qbnb` |
| [Person Social Footprint Mapper](https://apify.com/mambalabs/person-social-footprint-mapper?fpr=mamba) | `jfQXa2zW9FHCJot9K` |
| [Personal Email to Company Resolver](https://apify.com/mambalabs/personal-email-to-company-resolver?fpr=mamba) | `AefT5Ye6YNPFQwJBf` |
| [Pinterest Brand Presence Mapper](https://apify.com/mambalabs/pinterest-brand-presence-mapper?fpr=mamba) | `d1HvjZfKhgvWsoEwn` |
| [Podcast Guest and Host Finder](https://apify.com/mambalabs/podcast-guest-host-finder?fpr=mamba) | `o2MGSvgbSLeeXOsIo` |
| [Prospect Engine](https://apify.com/mambalabs/b2b-prospect-engine?fpr=mamba) | `q9rT6v64nUJdPexOQ` |
| [Public Feature Board and Roadmap Monitor](https://apify.com/mambalabs/public-feature-board-roadmap-monitor?fpr=mamba) | `rcHF5gj5r2Vqnry35` |
| [Publishing Frequency Tracker](https://apify.com/mambalabs/blog-publishing-frequency?fpr=mamba) | `TbLwaUUATdYb6wp4N` |
| [Reddit Brand Presence Mapper](https://apify.com/mambalabs/reddit-brand-presence-mapper?fpr=mamba) | `pKQZmDaT70SEb54bZ` |
| [Reporting Window Finder](https://apify.com/mambalabs/public-company-reporting-window-finder?fpr=mamba) | `uINxR7a1IW8qUTRUX` |
| [Sequencer Event Poller](https://apify.com/mambalabs/sequencer-event-poller?fpr=mamba) | `S6s8Rjd61tGdrMRk4` |
| [Sequencer Lead Push](https://apify.com/mambalabs/clay-to-instantly-smartlead-push?fpr=mamba) | `0Jv27VeWM5tSZQs9x` |
| [Team Page People Extractor](https://apify.com/mambalabs/team-page-people-extractor?fpr=mamba) | `j8a9zX0k4mNbvDbWK` |
| [Tech Stack Signal Detector](https://apify.com/mambalabs/gtm-tech-stack-signal-scraper?fpr=mamba) | `qyd7nNyqFPelQViBx` |
| [TikTok Brand Presence Mapper](https://apify.com/mambalabs/tiktok-brand-presence-mapper?fpr=mamba) | `fco8FvoJcSafbeyd1` |
| [Trustpilot Reputation Enricher](https://apify.com/mambalabs/review-platform-reputation-enricher?fpr=mamba) | `3lIqfCt61j4hqE1xz` |
| [VC and Accelerator Portfolio List Builder](https://apify.com/mambalabs/vc-accelerator-portfolio-list-builder?fpr=mamba) | `chH8hrfuoqqolW06m` |
| [WCAG Accessibility Audit](https://apify.com/mambalabs/wcag-accessibility-audit?fpr=mamba) | `P3jBj3FRghKEhX52z` |
| [Website Phrase and Business Model Classifier](https://apify.com/mambalabs/website-phrase-business-model-classifier?fpr=mamba) | `CBuZ9k7sRwBeiKiCS` |
| [Website Traffic Rank Estimator](https://apify.com/mambalabs/website-traffic-rank-estimator?fpr=mamba) | `GnOFUzlNVIoXgeJjH` |
| [Work Email Waterfall](https://apify.com/mambalabs/email-waterfall-orchestrator?fpr=mamba) | `OT6xqTFThC0Rjf7Zj` |
| [Workplace Program Detector](https://apify.com/mambalabs/workplace-program-detector?fpr=mamba) | `Li6pPDhqbdzFz3h7G` |
| [X Brand Presence Mapper](https://apify.com/mambalabs/x-brand-presence-mapper?fpr=mamba) | `oLOgadhHUkNAyDA3w` |
| [YouTube Channel Stats Extractor](https://apify.com/mambalabs/youtube-channel-transcript-extractor?fpr=mamba) | `6hSpD3kd2s2IQ4VSs` |

MCP servers for the suite are published under the npm scope [@mambalabsdev](https://www.npmjs.com/org/mambalabsdev).

Built by [Mamba Labs](https://apify.com/mambalabs).

# Actor input Schema

## `search_terms` (type: `array`):

Keywords to search Reddit for, one per line. With subreddits, each term is searched inside each subreddit; without, across all of Reddit. Up to 50 searches per run (terms times subreddits).

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

Subreddit names (sales, r/sales, or a subreddit URL), one per line. With search terms, the search runs inside these subreddits. Without search terms, the newest posts of each subreddit are read (see Subreddit sort).

## `thread_urls` (type: `array`):

Reddit thread URLs, for example https://www.reddit.com/r/sales/comments/1abc23/title/. Each thread returns its post and its comments, up to Max comments per thread. Up to 200 per run.

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

How Reddit orders search results: new (default, newest first), relevance, top, comments (most commented), or hot.

## `subreddit_sort` (type: `string`):

Used when subreddits are given without search terms: new (default), hot, top, or rising.

## `time_window` (type: `string`):

Reddit's own time filter for searches and for the top subreddit sort: hour, day, week, month (default), year, or all.

## `since_days` (type: `string`):

Optional. Drop posts older than this many days, by the date the post was published. 0 or empty: no date limit beyond the time window.

## `max_posts_per_query` (type: `string`):

At most this many posts per search or subreddit, up to 1,000. Search results without the search term do not count; the actor reads up to 10 pages of 100 results to fill the count.

## `require_term_match` (type: `string`):

On (default): a search result is kept only when the search term is in the post's title or text, its words next to each other and in order (case and punctuation ignored, so cold email matches Cold-email and cold emails). Results Reddit returns for other reasons are dropped and not charged. Off: every result Reddit returns is kept.

## `include_comments` (type: `string`):

On: each post found by a search or a subreddit read also returns its comments as rows, up to Max comments per thread, one extra page read per post. Off (default): posts only. Thread URLs always return their comments.

## `max_comments_per_thread` (type: `string`):

At most this many comments per thread, top comments first, up to 500.

## `comment_depth` (type: `string`):

How many reply levels to read under each top level comment, 1 to 10. Default 3.

## `only_new` (type: `string`):

On: a post or comment an earlier run already returned for the same query is skipped and not charged, so a scheduled run returns only new posts. The ids are kept in a key-value store in your own Apify account. Off (default): every result is returned.

## `state_key` (type: `string`):

Optional. A name for the only new results memory, so two schedules keep separate memories.

## `max_charge_usd` (type: `string`):

Optional. The run stops before a charge that would pass this amount. Summary rows are always returned.

## `proxy_mode` (type: `string`):

auto (default): requests go through the Apify proxy pool, and a request the pool cannot get through is retried on residential addresses. residential: every request uses residential addresses. A reliability setting only; it does not change what you pay.

## `source_tag` (type: `string`):

Internal attribution tag. Leave empty.

## Actor input object example

```json
{
  "search_terms": [
    "cold email"
  ],
  "subreddits": [
    "sales"
  ],
  "sort": "new",
  "subreddit_sort": "new",
  "time_window": "month",
  "max_posts_per_query": "10",
  "require_term_match": "true",
  "include_comments": "false",
  "max_comments_per_thread": "25",
  "comment_depth": "3",
  "only_new": "false",
  "proxy_mode": "auto"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `run_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 = {
    "search_terms": [
        "cold email"
    ],
    "subreddits": [
        "sales"
    ],
    "max_posts_per_query": "10"
};

// Run the Actor and wait for it to finish
const run = await client.actor("mambalabs/reddit-search-thread-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 = {
    "search_terms": ["cold email"],
    "subreddits": ["sales"],
    "max_posts_per_query": "10",
}

# Run the Actor and wait for it to finish
run = client.actor("mambalabs/reddit-search-thread-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 '{
  "search_terms": [
    "cold email"
  ],
  "subreddits": [
    "sales"
  ],
  "max_posts_per_query": "10"
}' |
apify call mambalabs/reddit-search-thread-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mambalabs/reddit-search-thread-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/4Gsth5cP2Xt9V2xDN/builds/FnnVUTiIhRKygQuMX/openapi.json
