# Reddit Scraper — Posts & Comments for AI and Market Research (`aitorsm/reddit-scraper`) Actor

Collect public Reddit posts, comments and reply threads for AI datasets, market research and brand monitoring. Search subreddits, keywords, post links and user profiles. Get reply relationships and optional AI sentiment analysis. No Reddit account, API key or session token required.

- **URL**: https://apify.com/aitorsm/reddit-scraper.md
- **Developed by:** [Aitor Sanchez-Mansilla](https://apify.com/aitorsm) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 reddit 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

## Reddit Scraper — Posts & Comments for AI and Market Research

[![Reddit Scraper status](https://apify.com/actor-badge?actor=aitorsm/reddit-scraper)](https://apify.com/aitorsm/reddit-scraper)

**Collect public Reddit posts, comments and reply threads for AI datasets, market research and brand monitoring.**

No Reddit account, Reddit API key or session token required. No browser extension needed. Run from Apify Console, your code or an AI assistant connected through Apify's Model Context Protocol (MCP) server.

### Use cases

- **Market and content research:** find product problems, recommendations and niche questions in people's own words. Collect post text, authors and links, with scores and flair where available.
- **Brand monitoring:** schedule searches for brands, competitors or keywords and skip previously delivered matches. Comment search can find mentions absent from the parent post.
- **Thread export and community analysis:** examine who replied to whom, with dates and scores where available. Add public community descriptions and rules for context.
- **AI datasets and NLP:** export discussion text and source IDs for retrieval, training or evaluation. Optional AI analysis adds intent, sentiment and topic labels with supporting quotes. Data preparation and usage rights remain your responsibility.
- **Lead research:** find requests for tools or recommendations. You decide who is a lead; the Actor does not score or rank leads.

### Quick start

1. Enter search words, subreddit names, post links or usernames. For a small first run, replace `Acme` below with your brand and leave subreddits blank to search Reddit-wide.
2. Set **Apify's maximum charge per run before pressing Start**. A limit per subreddit or search does not cap the total bill.
3. Press **Start**, then open **Output** to inspect and export your results.

```json
{
    "searchQueries": ["Acme"],
    "sort": "new",
    "maxResultsPerSource": 5,
    "includeComments": false
}
```

The form prefills a Reddit-wide `python` search and a five-post limit. These are starting values, **not API defaults**: API callers must supply a target; omitting or clearing `maxResultsPerSource` leaves each source uncapped. To collect replies, enable `includeComments` and set a separate `maxCommentsPerPost`, such as `10`. Source availability and your run's spending and time limits still apply.

### Reddit data you can export

| Record (`recordType`) | What you receive |
| --- | --- |
| `post` | Title, text, author, subreddit, links and dates; scores, comment counts, flair and comment completeness where available |
| `comment` | Text, author, post ID, subreddit, link and dates; discussion comments also include reply relationships and scores where available |
| `user_profile` | Public About text, status, karma, cake day, account age, avatar and trophies where shown |
| `community` | Public description, creation date, type, rules, subscribers and moderators where shown; notes on missing or incomplete information |

Use **Overview**, **Post details** or **Comment threads** in Output to review discussions. Other tables cover profiles, communities, AI results, media links and search context. Tables select columns without filtering rows; optional fields can be empty. Export **JSON, CSV, Excel, XML or HTML**, or read the dataset through the Apify API. JSON preserves nested objects and lists.

#### Post example

**Selected-field projection** from a saved run collected on November 11, 2026, with comments disabled. This selects fields from the record; the title and post text are preserved in full. Scores and counts reflect collection time.

```json
{
    "recordType": "post",
    "postId": "1xtcexq",
    "subreddit": "Python",
    "title": "Pydantic in 100 lines",
    "bodyText": "The title is obviously tongue in cheek, but in 100 lines we can get a quite a lot done to type-check dataclasses.\n\nhttps://thibaud.space/2026/10/pydantic-in-100-lines-part-1.html",
    "author": "com_kieffer",
    "url": "https://www.reddit.com/r/Python/comments/1xtcexq/pydantic_in_100_lines/",
    "publishedAt": "2026-11-11T08:20:43.000Z",
    "score": 0,
    "numCommentsReported": 3,
    "linkFlairText": "Discussion"
}
```

#### Discussion comment example

**Selected-field projection** from a saved run collected on November 12, 2026. The comment text is preserved in full. This is a top-level reply to a different discussion (`1qq3pss`); it and the post above are separate examples, not a joined pair.

```json
{
    "recordType": "comment",
    "commentId": "o2f0lw7",
    "postId": "1qq3pss",
    "subreddit": "programming",
    "text": "Kinda irrelevant but worth mentioning: This guy is a myth. He created Turbo Pascal, Borland Delphi, C# and TypeScript.",
    "author": "kagelos",
    "url": "https://www.reddit.com/r/programming/comments/1qq3pss/comment/o2f0lw7/",
    "publishedAt": "2026-01-29T14:35:49.644Z",
    "parentId": "t3_1qq3pss",
    "parentCommentId": null,
    "depth": 0,
    "score": 135
}
```

Replies join to posts through `postId`. A discussion comment's `parentId` identifies its post or parent comment; `parentCommentId` and `depth` show nesting. Filters can leave a reply whose parent comment is absent. Comment-search results do not include these reply relationships.

The **run summary**, linked from Output, explains what was collected, which searches or communities were checked, why collection stopped and any problems. A search can succeed with zero matches. Results already saved remain available if another part of the run has a problem. Missing values mean unknown, not zero; they can be `null` or absent.

### Pricing

**Each saved post, comment, user profile or community counts as one result.** Prices below apply per 1,000 results. Your bill shows one **Reddit result** charge per saved result, including thread data and scores. Check the price shown on the run page before starting.

| Apify plan | Per 1,000 results (USD) |
| --- | ---: |
| Free | **5.00** |
| Bronze | **4.80** |
| Silver | **4.60** |
| Gold, Platinum, Diamond | **4.00** |

- **Optional AI enrichment:** an extra **$1.00 per 1,000 successfully enriched posts or comments**. Failed, empty or skipped analyses have no AI charge; saved posts and comments still have the normal result charge.
- **Actor start:** USD **0.00005 per GB** of run memory, at least 1 GB; **USD 0.0001 at the default 2 GB (2048 MB)**.
- **Count each item separately:** a post and its comments are separate results. Usernames can return a profile plus history posts and comments; community info adds community results. The run summary is not a billable result.
- **Unsaved items are not charged:** filtered, skipped, previously delivered items and items beyond your limits add no result charge. A run with no new results still pays the start charge.

Set a **maximum charge for the whole run**: adding searches, subreddits or comments can increase the total number of results. Collection stops when the remaining budget cannot cover another result, including successful AI enrichment when enabled. Saved discussion comments come with their post, which indicates when requested comments were left out. In monitoring, a post returned in an earlier run is not repeated alongside its new comments.

### Integrations and automation

#### Keep it up to date automatically

Save your input as an Apify task and add a **Schedule**, such as every morning. Reuse a **Monitoring label** (`monitorKey`) to collect new posts or keyword matches. The label remembers deliveries for 30 days; the **Schedule** decides when a run starts. Setting a label alone does not create recurring runs:

```json
{
    "subreddits": ["Python"],
    "sort": "new",
    "maxResultsPerSource": 20,
    "includeComments": false,
    "monitorKey": "python-daily"
}
```

- The first run returns everything it finds within your limits; later runs skip items already returned. Edited posts are not returned again. Monitoring a subreddit or search does not track new replies on previously returned posts.
- To follow **new replies on selected posts**, supply **Reddit post links**, enable comments and set **Maximum discussion comments per post**. Previously returned posts and comments are not repeated, but new comments can be returned.
- Runs using the same label share the list of previously returned items, even if you change the search settings. Items are remembered for **30 days** and may appear again after that. A new label starts fresh. Items left out by filters or limits can appear in a later run.
- Posts that Reddit approves or makes searchable late can be missed. “No new items” means none among the results checked, not none anywhere on Reddit.
- Two runs with the same label at the same time **can return the same new item**. Let one run finish before the next starts when duplicates matter.

#### Send the results where you work

- **Files and spreadsheets:** export from Output or connect Google Sheets through Apify integrations.
- **Alerts:** connect Slack, email, Zapier, Make or webhooks to your scheduled workflow. The Actor has no separate alerting app or dashboard.
- **Code:** use the Apify API or official Python/JavaScript client to start runs and read the dataset.
- **AI agents:** connect through Apify's MCP server to run a search or inspect a discussion.

#### Connect your AI assistant

Use an MCP-compatible assistant for a keyword search, a subreddit lookup or a single discussion. Use regular Actor runs for bulk collection, multiple queries, comment discovery, historical date ranges, monitoring and AI enrichment.

1. Add this scoped Apify MCP connection in your assistant's connector settings: `https://mcp.apify.com/?tools=aitorsm/reddit-scraper`.
2. Authenticate with your Apify account using your client's supported method. You need access to this Actor; no Reddit credentials are required. Setup varies by client.
3. Ask: **“Find up to 5 recent Reddit posts about Python in r/Python and return their titles, text and links.”**

| Assistant task | Settings and defaults |
| --- | --- |
| Search posts | Supply `query`, `subreddit`, or both. `maxPosts` defaults to 10 and `sort` to `new`. Use `hot` only without a query; `relevance` requires a query. For `top`, `time` defaults to `week` and controls ranking, not publication dates. No comments. |
| Read a discussion | Supply one HTTPS Reddit post `url`. `includeComments` defaults to false; set it true to collect replies. `maxComments` is used with comments enabled and defaults to 20. The post counts separately. |

Choose positive result limits to control volume. These assistant tasks accept their own settings; the advanced input table below is for regular Actor runs. Available details and encountered limits accompany the results. Reddit access can fail temporarily; an unsuccessful lookup does not prove that no matches exist. See the [Actor API / Endpoints docs](https://apify.com/aitorsm/reddit-scraper/api) for the API reference and response examples.

Each returned result uses the same tier price shown above, as an alternative to the batch result charge. These lookups do not add a separate platform-usage bill to the caller. **There is no per-request dollar cap** for these lookups; use result limits. A timeout or lost connection does not guarantee that no charge was accepted.

### Advanced inputs and collection limits

Combine sources as needed. Search words discover results; text filters narrow the collected text. Expand the reference for all 23 inputs, or use the examples below for specific research tasks.

<details>
<summary>All 23 Actor inputs</summary>

| Field | Purpose and limits |
| --- | --- |
| `subreddits` | Names with or without `r/`. With search queries, scope each query to these communities; otherwise collect community posts. |
| `searchQueries` | Words or phrases to search within supplied subreddits, otherwise Reddit-wide. |
| `postUrls` | Individual post links on `www.`, `old.` or plain `reddit.com`; posts bypass post filters. Availability, deduplication and budgets still apply. |
| `usernames` | Public profiles and recent post/comment history. |
| `searchIn` | Search `posts` (default), matching `comments` or `both`. Requires search queries; comment discovery does not fetch the discussion. |
| `findSubreddits` | Number of extra matching communities to search per query; `0` turns it off. Each search has its own result limit. |
| `maxResultsPerSource` | Maximum results per subreddit or search; each user's posts and comments count separately. Form prefill: 5; omitted or empty: no cap. |
| `includeComments` | Include post discussions; off by default. Does not add replies to archived posts or user-history posts. |
| `maxCommentsPerPost` | Separate discussion-comment cap, used with `includeComments`; positive integer or empty for no cap. |
| `sort` | `new` (default), `hot`, `top`, `relevance` or `comments`; supported choices depend on the source, as listed below. |
| `time` | Ranking window for `top`: `hour`, `day`, `week` (default), `month`, `year`, `all`. Use dates for publication filtering. |
| `dateFrom` | Inclusive earliest publication date; older subreddit posts may be available from an archive. |
| `dateTo` | Inclusive latest publication date. |
| `keywords` | Whole-word title/text filter: require any listed word or phrase. Does not start a search. |
| `excludeKeywords` | Whole-word title/text filter: exclude any listed word or phrase, regardless of capitalization. |
| `excludeAuthors` | Exclude authors, for example `AutoModerator`. |
| `minScore` | Minimum post score; unknown scores are kept. Does not apply to archived or user-history posts, or comment-search results. |
| `minComments` | Minimum post comment count; unknown counts are kept. Same exclusions as `minScore`. |
| `includeMedia` | Add available image and video links, sizes and details; no file downloads. |
| `includeCommunityInfo` | Add details and rules for explicitly supplied subreddits, excluding automatically discovered communities. |
| `aiEnrichment` | Optional AI sentiment and intent analysis; off by default, with an extra charge for successful analysis. |
| `enrichmentLabels` | Custom topic labels, used only when AI analysis is enabled. |
| `monitorKey` | Monitoring label: skip posts/comments delivered in the last 30 days. Does not schedule runs. |

</details>

#### Searches, sorts and limits

Each query searches every subreddit you enter, or Reddit-wide if you leave subreddits blank. Queries repeated with different capitalization count once. Results found by several searches are saved once and list the search that first found them. `findSubreddits` adds matching public communities without repeating those you entered; it does not guarantee every mention.

| What you search | Sorting choices |
| --- | --- |
| Subreddit listing | `new`, `hot`, `top`; `relevance` and `comments` use `new` |
| Post search | `new`, `top`, `relevance`, `comments`; `hot` uses `relevance` |
| Comment search | `new`, `top`, `relevance`; other sorts use `relevance` |

`time` applies only to `top`; Reddit may ignore it for comment search. It controls ranking, not publication dates. Without result or comment caps, collection continues until available results end or your spending or time limit stops the run. Reddit commonly makes only about the newest 1,000 items available in a listing, not an entire history.

#### Research a topic within communities

Search phrases discover posts; `keywords` checks the collected title and text for whole words. This searches two communities independently and keeps posts mentioning pricing or subscription:

```json
{
    "subreddits": ["SaaS", "startups"],
    "searchQueries": ["pricing software"],
    "keywords": ["pricing", "subscription"],
    "sort": "relevance",
    "maxResultsPerSource": 10
}
```

#### Read one discussion and its replies

Use a post link when you know which discussion matters. This saved example link also appears above; its current availability has not been checked here.

```json
{
    "postUrls": ["https://www.reddit.com/r/Python/comments/1xtcexq/pydantic_in_100_lines/"],
    "includeComments": true,
    "maxCommentsPerPost": 10
}
```

Posts supplied by link bypass post filters; their comments remain filtered. An explicit link does not guarantee delivery. When a discussion cannot be accessed, the available post can still be returned with unavailable details blank and a note explaining the problem. Private content and content requiring a login are unavailable.

#### Thread coverage and comment search

Subreddit posts, search posts and individual post links include available scores, comment counts and flair, even with comments disabled. Enable comments to collect replies up to your limits. Posts indicate whether requested comments were left out. Reddit's displayed comment count can differ from the number returned, and the reason is not always known.

Comment search finds matching comments and identifies their post, but does not include that post's author or text, or reply relationships. Add the post link to collect its discussion. Search covers what Reddit makes searchable, not every historical comment. Reddit may return matches whose visible text does not contain the query. Date, keyword and author filters apply; minimum post score and comment count do not.

```json
{
    "subreddits": ["learnpython"],
    "searchQueries": ["thonny"],
    "searchIn": "comments",
    "sort": "new",
    "maxResultsPerSource": 10
}
```

#### Filters

Each result must match all filters that apply to it. Posts supplied by link bypass post filters; availability, deduplication and budgets still apply.

- **Dates:** both bounds are included. A date alone covers the whole UTC day; include a time zone if entering a time. Newest-first sorting can make date-limited searches faster.
- **Text:** words and phrases match regardless of capitalization. Any required term is enough; any excluded term excludes the result. Missing text cannot meet a required term unless the post title matches, and cannot by itself match an excluded term.
- **Unknown values:** unknown dates, scores and comment counts are kept, not treated as zero. Zero is a real score. Posts excluded by score or comment-count filters do not count toward the result limit.
- **Replies:** filters can leave a reply without its parent comment. Excluding a result is not a collection failure.

#### User profiles and community info

Enter `spez`, `u/spez` or a Reddit profile link to collect a public profile and recent posts and comments. The result limit applies separately to posts and comments. User-history posts do not include the extra scores, flair or replies available through individual post links; add those links when needed. A nonexistent username is marked `not_found` rather than failing the run.

Community info includes available descriptions, rules, dates, type and activity figures. Subscriber counts appear only when available; weekly visitors do not substitute for them. Rules and moderator lists may be incomplete, even when marked `observed`; results indicate missing or incomplete information.

<details>
<summary>Historical user profile example — selected-field projection</summary>

**Historical selected-field projection** from build 0.6.12, collected November 9, 2026. This earlier profile capture shows public About text; it does not demonstrate today's profile detail coverage.

```json
{
    "recordType": "user_profile",
    "username": "spez",
    "url": "https://www.reddit.com/user/spez/",
    "status": "ok",
    "bio": "Reddit CEO",
    "fetchedAt": "2026-11-09T03:08:06.879Z"
}
```

</details>

<details>
<summary>Community example — selected-field projection</summary>

**Historical selected-field projection** from build 0.6.5, collected November 8, 2026. Rules and availability notes are omitted here; `ruleCount` preserves the saved count.

```json
{
    "recordType": "community",
    "subreddit": "SaaS",
    "url": "https://www.reddit.com/r/SaaS/",
    "status": "ok",
    "displayName": "Software as a Service",
    "description": "Discussions and useful links for SaaS owners, online business owners, and more.",
    "createdAt": "2008-07-31T21:06:38.233Z",
    "communityType": "public",
    "ruleCount": 11,
    "fetchedAt": "2026-11-08T13:32:11.963Z"
}
```

</details>

### Reddit image and video links

Enable `includeMedia` to add available original-image links, previews, gallery images in order, video links, cover images and captions. Sizes and file formats appear where available. **You receive links and details, not downloaded image or video files.**

### Search historical Reddit posts

Set `dateFrom` earlier than the posts available in Reddit's listings to include archived subreddit posts for that period. Choose a date range and result limit:

```json
{
    "subreddits": ["learnpython"],
    "dateFrom": "2024-01-01",
    "dateTo": "2024-01-31",
    "maxResultsPerSource": 20,
    "includeComments": false
}
```

- Supply subreddits, optionally with `searchQueries` for discovery and `keywords` to filter text. The archive excludes Reddit-wide searches and automatically added communities, and is unavailable with monitoring or comments-only search.
- Archived posts share the source result limit with other posts; they do not add results beyond that cap. No archive results are added if Reddit already reaches your starting date. Leave `dateTo` empty to search up to the run's start. Posts are not returned twice.
- Archived posts are identified in results; scores and comment counts reflect archive time. Date, keyword and author filters apply; minimum score and comment count do not.
- **Archived posts have no comments, extra post details or media.** Add post links separately for discussions still available on Reddit.
- Posts deleted before archiving may be missing. The archive can be incomplete or unavailable, and large searches can exceed the time limit. Other saved results remain available if the archive fails; the summary explains the problem.
- **Privacy:** the third-party archive receives the requested subreddit names, date ranges and any search query.

### AI sentiment and intent analysis

Enable `aiEnrichment` to analyse post or comment intent, sentiment, named products and companies, problems and topics, with supporting quotes. Profiles and communities are not analysed. Supply up to 50 distinct `enrichmentLabels`, each 1–60 characters, or leave labels empty for up to five automatic topics. Labels have no effect unless analysis is enabled.

```json
{
    "subreddits": ["SaaS"],
    "maxResultsPerSource": 5,
    "includeComments": false,
    "aiEnrichment": true,
    "enrichmentLabels": ["pricing", "bug report", "feature request"]
}
```

**External processing:** post title and text, or comment text, plus custom topic labels are shared with an external AI service. Separate author, link, score, media and profile fields are not sent; the text itself may contain names or links. Analyses indicate success, failure or skipping. Failed analysis does not remove a collected result. AI judgments can be wrong; review the supporting quotes before making important decisions. Successful analyses add the [AI charge](#pricing); the whole-run spending limit still applies.

<details>
<summary>AI analysis example — selected-field projection</summary>

**Historical selected-field projection** from build 0.6.18, collected November 11, 2026. This selects identifiers, three analysis fields and one sentiment evidence entry; the comment text and other analysis fields are omitted. It comes from a separate discussion from both examples above.

```json
{
    "recordType": "comment",
    "commentId": "19s4gvdhb9q84",
    "postId": "1xngqhr",
    "enrichment": {
        "status": "ok",
        "intent": "discussion",
        "sentiment": "positive",
        "evidence": [
            {
                "field": "sentiment",
                "value": "positive",
                "quote": "I am so happy and my chest feels like a balloon is inflating inside where my heart is!"
            }
        ]
    }
}
```

</details>

### Related Actors

- [Long Tail Keyword Generator](https://apify.com/aitorsm/keyword-fanout): turn the topics you find on Reddit into long-tail searches and questions.
- [Keyword Search Volume](https://apify.com/aitorsm/keyword-volume): check how many people search Google for those topics each month.
- [YouTube Transcript Extractor](https://apify.com/aitorsm/youtube-transcript-extractor): add YouTube videos and their transcripts to the same research.
- [AI Brand Visibility Tracker](https://apify.com/aitorsm/ai-visibility-tracker): see how AI answers mention your brand next to what Reddit says about it.

### FAQ

#### Do I need a Reddit account or anything installed?

No Reddit account, Reddit API key, session token or browser extension is required. The Actor runs in Apify's cloud; you need an Apify account.

#### Does it collect every post and comment?

No. Reddit limits its listings and searches, and private or login-required content is unavailable. Replies are collected up to your limits and can differ from Reddit's displayed count. See [collection limits](#advanced-inputs-and-collection-limits) and [historical posts](#search-historical-reddit-posts).

#### Can I use the data for AI datasets and market research?

Yes. Export public discussion text and source IDs for analysis, retrieval or training. Optional AI analysis adds labels and evidence quotes. Preparation and appropriate content usage rights remain your responsibility.

#### Can I monitor new brand or keyword mentions?

Yes. Save a search as a task, add a Schedule and reuse a monitoring label. To follow new replies on an existing post, supply its link. See [monitoring](#keep-it-up-to-date-automatically) for retention and duplicate limits.

#### How do I export the results?

Open Output and choose Export for CSV, Excel or JSON, or read the dataset through the Apify API. AI agents can use Apify's MCP connection.

### Disclaimer

This Actor collects publicly available Reddit content only. It is not affiliated with or endorsed by Reddit. You are responsible for how you use the data, including Reddit's terms and the privacy of the people whose posts you collect.

# Actor input Schema

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

Community names with or without r/, for example SaaS or r/Python (2–21 letters, digits or underscores). With searchQueries, search each community; without them, collect its posts. Leave blank for Reddit-wide search only when searchQueries is supplied, or to collect only post links or user history.

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

Discover mentions of brands, products or problems, for example Acme or pricing software. Each query searches every supplied subreddit, or Reddit-wide when subreddits is blank. This is discovery, not a whole-word text filter: use keywords to require words in collected title/text. Queries are trimmed, 1–256 characters, without control characters; case-insensitive duplicates count once.

## `postUrls` (type: `array`):

Read individual discussions, for example https://www.reddit.com/r/Python/comments/1xtcexq/pydantic_in_100_lines/. HTTPS on www., old. or bare reddit.com, at most 2048 characters; no short links, credentials, nonstandard ports, encoded subreddit names/post IDs or individual-comment links. These posts bypass post filters; availability, deduplication and budgets still apply. Their comments remain filtered.

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

Collect each public profile plus recent posts and comments as separate results. Use spez, u/spez or https://www.reddit.com/user/spez/. Names are 3–20 letters, digits, underscores or hyphens; entries at most 2048 characters. Result limits apply separately to history posts and comments. includeComments does not add replies to user-history posts.

## `searchIn` (type: `string`):

Choose what searchQueries discovers: posts (default), matching comments, or both. Comment discovery returns each matching comment with available post context, not the parent post text or a reply tree. Use includeComments on collected posts or postUrls to read discussion replies. No effect without searchQueries.

## `findSubreddits` (type: `integer`):

Number of extra matching communities to search for each query; 0 (default) is off. Requires searchQueries to have an effect. Does not repeat communities you entered. Each added community/query search has an independent result limit and can increase the total charge. Non-negative safe integer.

## `maxResultsPerSource` (type: `integer`):

Maximum posts per subreddit/query search, matches per comment search, and history results per user (posts and comments limited separately). Each source has its own limit; this is not a global result or spending cap. Discussion replies use maxCommentsPerPost separately. Form starts at 5; omitted or cleared API input is unbounded. Positive safe integer, or empty.

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

Also collect available comments and reply relationships on posts from subreddits, post searches and individual post links. Off by default. Does not add replies to archived or user-history posts, or turn comment-search matches into whole discussions. Coverage is reported per post; unavailable replies cannot be recovered.

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

Applies only when includeComments is on. Maximum comments saved per post, separate from maxResultsPerSource and the minComments filter. Omitted or empty means no per-post comment-count cap; available replies and run budgets still limit results. Positive safe integer, or empty.

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

Default new. Subreddit listings support new, hot or top; relevance and comments fall back to new. Post searches support new, top, relevance or comments (most comments); hot falls back to relevance. Comment searches support new, top or relevance; hot and comments fall back to relevance.

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

Applies only with sort=top; default week. This is the period Reddit ranks over, not a publication-date filter. Use dateFrom/dateTo for publication dates. Reddit may ignore this window in comment search.

## `dateFrom` (type: `string`):

Inclusive publication-date filter, for example 2024-01-01 (start of day UTC) or 2024-01-01T12:00:00Z. Use dateTo for the end. Unknown dates are kept; explicit post links bypass post filters. Older posts from explicitly supplied subreddits may come from Arctic Shift, a third-party archive receiving subreddit names, dates and search queries. Archive coverage can be incomplete; no archived replies or media, Reddit-wide/discovered-community history, monitoring or comments-only search.

## `dateTo` (type: `string`):

Inclusive publication-date filter, for example 2024-01-31 (whole day UTC) or 2024-01-31T18:00:00Z. Must not precede dateFrom; timestamps require a time zone. Unknown dates are kept; explicit post links bypass post filters. This does not set the Top ranking window.

## `keywords` (type: `array`):

Filter collected titles and text; does not discover results or start a search. Require any listed whole word or phrase, case-insensitively. Missing text cannot satisfy this include filter unless a post title matches. Explicit post links bypass post filters; their comments remain filtered. Each trimmed entry is 1–256 characters without control characters.

## `excludeKeywords` (type: `array`):

Exclude posts and comments whose collected title/text contains any listed whole word or phrase, case-insensitively. Exclusions win over required words. Explicit post links bypass post filters; their comments remain filtered. Each trimmed entry is 1–256 characters without control characters.

## `excludeAuthors` (type: `array`):

Exclude posts and comments by these usernames, with or without u/, for example AutoModerator. Case-insensitive; deleted or unknown authors are kept. Names are 1–64 letters, digits, underscores or hyphens. Explicit post links bypass post filters; their comments remain filtered.

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

Keep posts with at least this score; unknown scores are kept, and zero is a real value. Does not filter archived posts, user-history posts or comment-search matches. Explicit post links bypass this filter. Safe integer (negative values allowed), or empty.

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

Keep posts reporting at least this many comments; unknown counts are kept. This selects posts, not the number of replies to collect (use maxCommentsPerPost). Does not filter archived posts, user-history posts or comment-search matches. Explicit post links bypass this filter. Non-negative safe integer, or empty.

## `includeMedia` (type: `boolean`):

Add available image, gallery and video links and details to supported posts. Off by default. Availability varies; archived posts do not gain media, and user-history media can be limited. Files are not downloaded.

## `includeCommunityInfo` (type: `boolean`):

Add a separate community result for each explicitly supplied subreddit, with available descriptions, rules, dates, subscribers and public moderators. Off by default; no effect without subreddits. Does not add details for automatically discovered communities. Missing or incomplete details are indicated; moderator lists may be incomplete.

## `aiEnrichment` (type: `boolean`):

Off by default. Analyse post/comment text for intent, sentiment, products, brands, problems and topic labels, with supporting quotes. Adds $1 per 1,000 successful analyses to normal result charges; failed or skipped analyses have no AI surcharge and keep the collected result. Enabling shares post title/text or comment text and any custom topic labels with an external AI provider; text may contain names or links. Separate author, URL, score, media and profile fields are not sent. Profiles and communities are not analysed.

## `enrichmentLabels` (type: `array`):

Used only with aiEnrichment enabled. Supply labels such as pricing, bug report or feature request; empty lets the AI choose up to five topics. Up to 50 distinct labels, each 1–60 characters after whitespace normalization, without non-whitespace control characters; duplicates are removed case-insensitively.

## `monitorKey` (type: `string`):

Reuse a label, for example brand-daily, to skip posts/comments delivered within the last 30 days. A new label starts fresh; edited results are not repeated. This does not schedule runs: add an Apify Schedule separately. Search/subreddit monitoring finds new posts or matches, not new replies on previously delivered posts; supply postUrls with includeComments to follow those replies. Concurrent runs sharing a label can return duplicates. Trimmed label: 1–64 letters, digits, dots, underscores or hyphens; empty turns monitoring off.

## Actor input object example

```json
{
  "searchQueries": [
    "python"
  ],
  "searchIn": "posts",
  "findSubreddits": 0,
  "maxResultsPerSource": 5,
  "includeComments": false,
  "sort": "new",
  "time": "week",
  "includeMedia": false,
  "includeCommunityInfo": false,
  "aiEnrichment": false
}
```

# Actor output Schema

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

Dataset overview with public Reddit post and comment text, IDs and source links. Thread rows add reply relationships and comment creation dates; unavailable values remain empty.

## `runSummary` (type: `string`):

Saved row counts, source outcomes, why the run stopped and any collection problems.

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

// Run the Actor and wait for it to finish
const run = await client.actor("aitorsm/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 = {
    "searchQueries": ["python"],
    "maxResultsPerSource": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("aitorsm/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 '{
  "searchQueries": [
    "python"
  ],
  "maxResultsPerSource": 5
}' |
apify call aitorsm/reddit-scraper --silent --output-dataset

```

## MCP server setup

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