# Subreddit Scraper: Posts, Comments & Stats, $0.99/1K (`laptime/subreddit-scraper`) Actor

$0.99/1K posts, $0.49/1K comments, no start fee. Past Reddit's 1,000-post limit with Combine sorts. No login or API key. Hot, new, top or rising posts with comments and community stats. Inputs: subreddit URLs, sort, time range, date windows, keywords, only-new, AI labels.

- **URL**: https://apify.com/laptime/subreddit-scraper.md
- **Developed by:** [Laptime](https://apify.com/laptime) (community)
- **Categories:** Social media, Lead generation, Agents
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.59 / 1,000 posts

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 is Subreddit Scraper?

**Subreddit Scraper** exports any public subreddit: its hot, new, top or rising posts with comments, member counts and 70+ fields per post, and with **Combine sorts** more than the ~1,000 posts Reddit lists per sort. Paste one or more subreddit links, click **Start**, and download JSON, CSV or Excel. No Reddit API key, login or cookies.

[![How to use Subreddit Scraper without coding: 1. Try for free 2. Paste a subreddit link + Start 3. Hot posts with score, comments and flair 4. Export to Excel](https://raw.githubusercontent.com/laptimehq/laptime-assets/main/howto/subreddit-scraper-steps.jpg?v=20261122)](https://raw.githubusercontent.com/laptimehq/laptime-assets/main/howto/subreddit-scraper-steps.jpg?v=20261122)

- 📊 **Community research:** what a subreddit talks about, upvotes and comments most, with members, weekly visitors and contributions on every row.
- 📚 **Bigger exports:** Combine sorts reads up to 13 of a subreddit's lists side by side and removes duplicates. Measured: 1,792 unique posts from r/lisp.
- 🤖 **AI and analytics datasets:** posts with full comment trees (`depth`, `parentId`, `rootCommentId`), Markdown text, media and flair.
- 🔔 **A subreddit feed without RSS:** a scheduled run with **Only new posts** returns just what was posted since the last run.

> ✅ **Verified working on 19 Nov 2026:** the prefilled input (r/webscraping, 20 hot posts with 5 comments each) ran on Apify three times in a row (release 0.5) and returned 20 posts and 54 comments in 5.5 to 6.4 s every time.
>
> 💰 **$0.99 per 1,000 posts and $0.49 per 1,000 comments**, no start fee. 1,000 posts cost $0.99, less than automation-lab ($1.15), fatihtahta ($1.49), harshmaur ($2.02), apify ($4.00) or trudax ($4.04) at Free-plan list prices on 17 Nov 2026.
>
> ⚡ **Same engine as [Reddit Scraper](https://apify.com/laptime/reddit-scraper)**, the fastest Reddit scraper in our head-to-head tests: 100 newest posts of r/technology in 3.4 s (17 Nov 2026).
>
> 🎯 **Only the posts you want:** min upvotes, min comments, post type (text, image, gallery, video, link, poll) and flair filters. Filtered posts are never charged, and the feed is read further so you still get your Max posts.
>
> 🧹 **Only real posts:** **Skip pinned and moderator posts** drops pinned rules and announcements and AutoModerator's daily threads; **Output format** `rag-markdown` gives one Markdown document per thread for RAG pipelines.
>
> 🔁 **Paste your old input as it is:** inputs written for trudax, harshmaur, automation-lab, fatihtahta or clearpath Reddit scrapers run unchanged, with the meaning they had there. Change only the Actor ID.

### How to use Subreddit Scraper

1. [Create a free Apify account](https://console.apify.com/sign-up). No credit card needed.
2. Open Subreddit Scraper and paste subreddit links into **Subreddits** (or keep the example).
3. Pick a **Sort** (hot, new or top) and set **Max posts per subreddit**. Comments are off by default; set **Max comments per post** to include them.
4. Click **Start**. Most runs finish in seconds.
5. Download the data as JSON, CSV, Excel or HTML, or fetch it with the API.

**Quick start input** (the prefilled default):

```json
{
  "startUrls": [{ "url": "https://www.reddit.com/r/webscraping/" }],
  "maxPostCount": 20,
  "maxComments": 5
}
```

A sort in the link wins over the Sort field: `/r/name/new/`, `/r/name/top/?t=week` and `/r/name/rising/` all work, and `r/a+b` reads several subreddits at once.

### Copy-paste inputs

#### Top posts of the month, with their best comments

```json
{
  "startUrls": [{ "url": "https://www.reddit.com/r/LocalLLaMA/" }],
  "sort": "top",
  "time": "month",
  "maxPostCount": 50,
  "maxComments": 30,
  "commentSort": "top"
}
```

#### More than 1,000 posts from one subreddit

```json
{
  "startUrls": [{ "url": "https://www.reddit.com/r/lisp/" }],
  "combineSorts": true,
  "maxPostCount": 3000,
  "maxItems": 3000
}
```

Reads new, hot, rising, top and controversial over several time ranges side by side and merges them without duplicates. You pay only for unique posts. Raise **Max items in total** with it: that cap is 1,000 by default.

#### A subreddit's new posts every hour

```json
{
  "startUrls": [{ "url": "https://www.reddit.com/r/SaaS/" }],
  "sort": "new",
  "postDateLimit": "3 hours",
  "onlyNew": true,
  "monitorName": "saas-hourly",
  "maxPostCount": 100
}
```

Save it as a task with an hourly schedule. Each run returns only posts the previous runs didn't deliver; an hour with nothing new costs $0.

### How much does Subreddit Scraper cost?

Pay per event. Proxies and Apify platform usage are included.

| Event | Price on the Free plan |
|---|---|
| Post delivered (`post`) | **$0.99 per 1,000** |
| Comment delivered (`comment`) | **$0.49 per 1,000** |
| AI labels per row, optional (`ai-label`) | $0.30 per 1,000 |
| AI flag or custom question per row, optional (`ai-custom-label`) | $0.05 per 1,000 per question |
| AI thread summary, optional (`ai-thread-summary`) | $3 per 1,000 |
| Run start | **free** |

| You want | Cost |
|---|---|
| 1,000 posts, no comments | $0.99 |
| 3,000 posts with Combine sorts | $2.97 |
| 100 posts with 20 comments each | $1.08 |

Never charged: run starts, duplicate posts across sorts, posts outside your date window or dropped by your keyword or NSFW filters, posts an earlier monitoring run already delivered, subreddit details, and runs that return nothing. **Max items in total** and Apify's **Maximum cost per run** cap every run's bill.

**Works on the Apify free plan:** the $5 of monthly platform credit covers about 5,100 posts with this Actor, no card needed.

### AI enrichment (optional, off by default)

Turn on **AI labels** and every post (and comment, if you like) gets sentiment, intent, a 0-100 lead score judged against **What you sell or track**, topic, brands named and language. Add ready-made yes/no flags or up to 10 questions of your own. **Thread summaries** add "what people are saying" and the products mentioned most to each post. Bot, moderator and deleted rows are skipped and never charged. With your own OpenRouter, OpenAI, Anthropic or Gemini key, no AI events are charged at all.

### Output

![Subreddit Scraper output: table of hot subreddit posts with title, upvotes, upvote ratio, comment count and date](https://raw.githubusercontent.com/laptimehq/laptime-assets/main/howto/subreddit-scraper-output.jpg?v=20261122)

A post row from the prefilled run on 19 Nov 2026 (a few of its fields):

```json
{
  "dataType": "post",
  "id": "t3_1xzcofa",
  "title": "Made a CLI that finds site's JSON API and serves it as agent tools",
  "parsedCommunityName": "webscraping",
  "username": "ChessTwo",
  "upVotes": 8,
  "numberOfComments": 0,
  "flair": "AI ✨",
  "mediaType": "text",
  "createdAt": "2026-11-18T11:15:04.650Z",
  "url": "https://www.reddit.com/r/webscraping/comments/1xzcofa/made_a_cli_that_finds_sites_json_api_and_serves/",
  "communitySubscribers": 106088,
  "commentsScraped": 0,
  "dataSource": "reddit"
}
```

Each post and each comment is one row (`dataType` is `post` or `comment`), with the same **74 post fields and 46 comment fields** as Reddit Scraper: `title`, `body`, `upVotes`, `upVoteRatio`, `numberOfComments`, `flair`, `username`, `createdAt`, `url`, images, galleries, videos, polls, the subreddit's members and weekly visitors, and the comment tree fields. The Output tab opens on the **Posts** view, with **Overview**, **Comments**, **Engagement and community**, **Media** and **AI labels** next to it. Every field is documented in the [Reddit Scraper output section](https://apify.com/laptime/reddit-scraper#output).

### Integrations and API

Save your input as a task, schedule it, and send the posts to Google Sheets, Slack, n8n, Make, Zapier or a webhook ([recipes](https://apify.com/laptime/reddit-scraper#send-reddit-data-to-slack-google-sheets-n8n-make-or-zapier)).

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("laptime/subreddit-scraper").call(run_input={
    "startUrls": [{"url": "https://www.reddit.com/r/webscraping/"}],
    "sort": "top",
    "time": "week",
    "maxPostCount": 25,
})
for post in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(post["upVotes"], post["title"])
```

AI agents: add `https://mcp.apify.com?tools=laptime/subreddit-scraper` as a remote MCP server in Claude, ChatGPT, Cursor or any MCP client.

### Related Actors

The same engine, with a form made for one job:

- [Reddit Scraper](https://apify.com/laptime/reddit-scraper): posts and full comment threads from subreddits, URLs, search and users, from $0.49/1K.
- [Reddit Posts Scraper](https://apify.com/laptime/reddit-posts-scraper): posts only, the cheapest Reddit export, $0.99/1K.
- [Reddit Comments Scraper](https://apify.com/laptime/reddit-comments-scraper): whole comment threads, or comments matching a keyword, $0.49/1K.
- [Reddit Search Scraper](https://apify.com/laptime/reddit-search-scraper): keyword search across Reddit or inside one subreddit, from $0.49/1K.
- [Reddit Monitor](https://apify.com/laptime/reddit-monitor): brand and keyword alerts: only posts you haven't received yet, from $0.49/1K.
- [Reddit User Scraper](https://apify.com/laptime/reddit-user-scraper): user profiles (karma, account age, trophies) with their posts and comments, $0.99/1K.

Other Laptime scrapers that pair well with this one, all with no start fee:

- [Threads Scraper](https://apify.com/laptime/threads-scraper): profiles, posts, threaded replies and keyword search, from $0.99/1K.
- [Bluesky Scraper](https://apify.com/laptime/bluesky-scraper): posts, replies, search, profiles, feeds and trends, from $0.79/1K.
- [Telegram Channel Scraper](https://apify.com/laptime/telegram-channel-scraper): public channel messages, comments and subscribers, $0.79/1K.

### FAQ

#### Do I need a Reddit account or API key?

No. Subreddit Scraper reads the public pages a logged-out visitor sees, so it keeps working after Reddit closed anonymous `.json` pages and RSS feeds and stopped giving out new API access in 2026.

#### Can I get every post a subreddit ever had?

Reddit lists about 1,000 posts per sort. Combine sorts merges up to 13 of those lists, which reaches well past 1,000 (1,792 unique posts from r/lisp in our test); very old, low-scored posts that no list shows stay out of reach. If Reddit refuses a subreddit, **Archive fallback** fills up from the Arctic Shift archive and marks those rows `dataSource: "archive"`.

#### How is Subreddit Scraper different from Reddit Scraper?

It's the same engine with a form set up for one job: subreddits first, posts only unless you ask for comments. Every Reddit Scraper input field is also accepted here through the API or the JSON tab, with the same output and the same prices.

#### Is it reliable?

Yes. Subreddit Scraper runs the same engine as [Reddit Scraper](https://apify.com/laptime/reddit-scraper). A daily automated check runs the default input and alerts us when it returns nothing or a key field goes empty. When Reddit refuses a listing or "load more comments", the run carries on with the Arctic Shift archive (rows marked `dataSource: "archive"`) instead of failing. A run that returns nothing fails with the reason and costs nothing; it never reports an empty success.

#### Is it legal to scrape Reddit?

Subreddit Scraper only collects data Reddit shows publicly without logging in. Posts and comments contain personal data (usernames and what people wrote), so GDPR and similar laws may apply to how you store and use it. You're responsible for your use case; ask a lawyer if you're unsure.

*Unofficial. Not affiliated with, endorsed by or sponsored by Reddit, Inc. Reddit is a trademark of Reddit, Inc.*

### Feedback and support

Open an issue on the **Issues** tab: issues are answered within a day.

If Subreddit Scraper saved you time, a short review on the **Reviews** tab helps other people find it. We read every one, thank you!

***

Built by **Laptime**: every Actor timed, with dated benchmarks in its README.

# Changelog

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

# Actor input Schema

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

Subreddit links, one per row: https://www.reddit.com/r/webscraping/. A sort in the link (/new/, /top/?t=week, /rising/) wins over Sort. https://www.reddit.com/r/rust+golang/ reads several at once (each gets its own Max posts), /r/popular/ the Popular feed. old., new. and m.reddit.com links work, and so do post, search and user links.

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

One of: hot (default), new, top, rising, controversial. Used by subreddit URLs that have no sort in the URL. With top or controversial, Time range picks the period. Use new with Only posts newer than for monitoring: the run stops at the first older post.

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

One of: all, hour, day, week, month, year. Reddit's own time filter, used by Sort = top or controversial and by searches; hot, new and rising ignore it. With All time and Only posts newer than set, the narrowest range that covers your window is used (e.g. 7 days = past week), so you get more posts inside it.

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

Maximum posts from each subreddit link, not per run: 3 subreddits × 100 = up to 300 posts. Default 100. Reddit lists about 1,000 posts per sort; turn on Combine sorts to go further, and raise Max items in total for big exports.

## `combineSorts` (type: `boolean`):

Subreddit URLs only. true = read up to 13 lists (new, hot, rising, top and controversial over several time ranges) side by side and merge them without duplicates, to get past Reddit's ~1,000-post limit per list. You pay only for unique posts. Measured: 1,792 posts from r/lisp. It is not a full history: old low-score posts stay out of reach.

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

Comments per post, counting nested replies. Default 0 = posts only, the fastest and cheapest export. Try 20 for the top of each thread, or 5000 for whole threads. $0.49 per 1,000 comments.

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

Hard cap on posts + comments for the whole run (default 1,000). Raise it for big exports, e.g. 5000 with Combine sorts. The run stops as soon as it is reached, so it doubles as a budget cap: 1,000 posts cost at most $0.99.

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

Skip posts created before this. A date (2026-11-01), a full ISO timestamp, or a relative time: 24 hours, 7 days, 2 weeks, 3 months, 1 year (short forms 24h, 7d; m = months). Relative times are counted from each run's start, so a schedule never needs editing. Skipped posts are not charged, and with Sort = new the run stops at the first older posts. Empty = no limit.

## `postDateTo` (type: `string`):

Skip posts created after this (same formats as Only posts newer than). Set both for a date window, e.g. 2026-10-01 to 2026-10-31. Empty = no limit.

## `includeKeywords` (type: `array`):

Keep only posts whose title or text contains at least one of these words or phrases (case-insensitive substring match, so "app" also matches "apple"). Applies to posts; the comments of a kept post are not filtered. Dropped posts are not charged. Empty = keep all.

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

Drop posts whose title or text contains any of these words or phrases (case-insensitive substring match), e.g. to filter out other meanings of your brand name. Dropped posts are not charged. Empty = drop nothing.

## `minUpVotes` (type: `integer`):

Keep only posts with at least this score (upvotes minus downvotes, the upVotes field). Lower-scored posts are skipped and not charged; their comments are not loaded. Empty or 0 = no minimum.

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

Keep only posts that have at least this many comments on Reddit (the numberOfComments field), e.g. to find active discussions. Others are skipped and not charged. Empty or 0 = no minimum.

## `postTypes` (type: `array`):

Keep only these kinds of post (the mediaType field): text, image, gallery, video, link, poll. E.g. \["text"] for discussions only. Other posts are skipped and not charged. Empty = all kinds.

## `flairs` (type: `array`):

Keep only posts whose flair (the flair field) is one of these, ignoring case, emoji and punctuation: "Bot detection" matches "Bot detection 🤖". "\*" = any flair at all (drops posts without a flair). Others are skipped and not charged. Empty = all posts.

## `excludeModPosts` (type: `boolean`):

true = leave out pinned (stickied) posts, posts a moderator or admin marked as official, and AutoModerator's posts (rules, daily threads, announcements). They are skipped and not charged. false (default) = keep them.

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

Leave out posts by these accounts (ignoring case, "u/" optional), e.g. bots or your own brand account. Skipped and not charged; their comments under other posts are kept. Empty = keep all authors.

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

true (default) = keep posts marked NSFW (18+). false = skip them; skipped posts are not charged.

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

One of: confidence (= Reddit's "Best"), top, new, controversial, old, qa. Decides which comments come first, and so which ones you get when Max comments per post cuts a thread short. Always sent to Reddit, so it wins over a subreddit's suggested order. Complete threads contain the same comments in any order.

## `maxCommentDepth` (type: `integer`):

Leave out replies nested deeper than this: 0 = top-level comments only, 1 = plus direct replies, and so on. Empty (default) = every depth, down to the deepest reply chain. A limit makes very big threads much faster. Not charged: left-out replies are never loaded.

## `onlyNew` (type: `boolean`):

true = skip posts that earlier runs with the same Monitor name already delivered, so scheduled runs return only new posts (comment-search hits and users' comments are remembered too). Skipped posts are not charged; a run with nothing new ends as Succeeded and costs nothing. The memory (the last 50,000 post IDs) is a key-value store named laptime-reddit-monitor-\<this Actor's ID> in your own Apify account. New comments on already-delivered posts are not fetched again.

## `monitorName` (type: `string`):

Name of the memory used by Only new posts. Use one name per monitoring task (e.g. my-brand, competitor-x); runs with the same name share one memory. Empty = one memory per saved task (or per set of inputs).

## `webhookUrl` (type: `string`):

Optional. When the run delivers rows, it POSTs a summary here: a Slack incoming-webhook or Discord webhook URL gets a message with the first 15 posts (title, link, subreddit, score; comments when the run has no posts) and a link to all rows; any other URL gets JSON (counts, dataset ID, first 50 posts or comments). Nothing is sent when nothing is new. Free.

## `includeSubredditDetails` (type: `boolean`):

true (default) = add the subreddit's members, weekly visitors and contributions, description, icon, banner and type to every post (the community\* fields). Not charged: one small request per distinct subreddit per run.

## `includeAuthorDetails` (type: `boolean`):

true = add each author's post karma, comment karma, account creation date and full-size avatar to posts and comments (authorPostKarma, authorCommentKarma, authorCreatedAt). One small request per distinct author, so runs with many authors take longer. Not charged. Default false.

## `archiveFallback` (type: `boolean`):

true (default) = if Reddit refuses a subreddit, a search limited with Search in subreddit, a user's posts or comments, or the rest of a comment thread, fill up from the Arctic Shift archive instead of failing. Archive rows have dataSource "archive", and their scores are from when they were archived. Searches across all of Reddit have no archive fallback.

## `outputFormat` (type: `string`):

"standard" = one row per post and per comment. "rag-markdown" = one document per post (dataType "rag": markdown/pageContent with the post and its comments, chunkId, flat metadata). "jsonl-finetune" = one OpenAI chat example per post (messages: system, user = post, assistant = comments). Documents: the post price includes 10 comments; more are charged as comments. Export as JSONL.

## `aiAnalysis` (type: `boolean`):

true = every post and comment gets aiSentiment (positive, negative, neutral, mixed) with aiSentimentScore (-1 to 1), aiIntent (buying_intent, recommendation_request, question, complaint, praise, self_promotion, job_post, news, discussion), aiEmotion, aiLeadScore (0-100) with aiLeadReason, aiTopic, aiEntities, aiLanguage and aiSummary. One "ai-label" event per labelled row ($0.30 per 1,000).

## `aiScope` (type: `string`):

One of: all, posts, comments. "posts" labels only posts, the cheapest way to find leads; comments are still scraped.

## `aiContext` (type: `string`):

One or two sentences about your product, brand or competitors. The lead score and its reason are judged against this. Empty = general buying intent.

## `aiFlags` (type: `array`):

Ready-made questions answered for every labelled row, returned in aiLabels (e.g. aiLabels.wantsHelp = true). Each flag is one "ai-custom-label" event per row ($0.05 per 1,000). Turns on AI labels.

## `aiCustomLabels` (type: `object`):

Your own questions as {"name": "instruction"}, up to 10, returned in aiLabels.name. Start an instruction with "yes/no:" for a true/false answer; otherwise you get a short text answer (null for none). Same format as harshmaur's customLabels. Each label is one "ai-custom-label" event per row ($0.05 per 1,000). Turns on AI labels.

## `aiThreadSummary` (type: `boolean`):

For each post with at least 2 comments, reads the post and its top comments (up to 40) and adds aiThreadSummary (what people are saying), aiThreadSentiment, aiThreadTopMentions (products recommended or discussed most) and aiThreadAnswered (did the author get a useful answer) to the post row. Uses the comments you scrape (Max comments per post). One "ai-thread-summary" event per summarised thread ($3 per 1,000).

## `aiApiKey` (type: `string`):

Bring your own key and pay no AI fees: the AI events above are not charged and your provider bills you for tokens (about $0.05-0.10 per 1,000 rows). Detected by prefix: OpenRouter (sk-or-...), Anthropic (sk-ant-...), Google Gemini (AIza...), anything else is treated as OpenAI. Stored encrypted.

## `aiModel` (type: `string`):

Only with your own key: the model name at your provider. Defaults: meta/muse-ember (OpenRouter), gpt-4.1-nano (OpenAI), claude-haiku-5-5 (Anthropic), gemini-2.5-flash-lite (Gemini). Without your own key our tuned models are always used and this field is ignored.

## `aiBaseUrl` (type: `string`):

Optional base URL of any OpenAI-compatible chat completions API (Groq, Together, Azure, a self-hosted model). Use with your API key and Model. No AI fees are charged.

## `maxConcurrency` (type: `integer`):

Parallel sessions (1-50, default 10), each on its own residential IP. Higher is faster for big runs. It does not change the price.

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

Compatibility switch for integrations built for trudax/reddit-scraper-lite that always send Start URLs. true = skip Start URLs and run only the Search terms.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/webscraping/"
    }
  ],
  "sort": "hot",
  "time": "all",
  "maxPostCount": 20,
  "combineSorts": false,
  "maxComments": 5,
  "maxItems": 1000,
  "postDateLimit": "7 days",
  "minUpVotes": 10,
  "minComments": 5,
  "flairs": [
    "Question",
    "Help"
  ],
  "excludeModPosts": false,
  "excludeAuthors": [
    "AutoModerator",
    "u/some_bot"
  ],
  "includeNSFW": true,
  "commentSort": "confidence",
  "onlyNew": false,
  "monitorName": "my-brand",
  "webhookUrl": "https://hooks.slack.com/services/T000/B000/XXXX",
  "includeSubredditDetails": true,
  "includeAuthorDetails": false,
  "archiveFallback": true,
  "outputFormat": "standard",
  "aiAnalysis": false,
  "aiScope": "all",
  "aiContext": "We sell an affordable CRM with email marketing for small businesses. Competitors: HubSpot, Pipedrive, Zoho.",
  "aiCustomLabels": {
    "wants_software": "yes/no: the author is looking for a software product or an alternative to one; no for job ads, news and self-promotion",
    "service_wanted": "the service the author wants, in three words or fewer, or none"
  },
  "aiThreadSummary": false,
  "aiModel": "meta/muse-ember",
  "aiBaseUrl": "https://api.groq.com/openai/v1",
  "maxConcurrency": 10,
  "ignoreStartUrls": false
}
```

# Actor output Schema

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

Every post and comment row, in the order scraped.

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

The Posts view: post columns (comment rows are in the same dataset; filter on dataType = "post").

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

The Comments view: comment columns (filter on dataType = "comment").

## `searchResults` (type: `string`):

The Search results view: what your Search terms found, with searchQuery and matchesQuery (does the text really contain the term).

## `runStats` (type: `string`):

RUN_STATS: posts, comments, seconds, requests, errors and why the run stopped.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

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

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        {
            "url": "https://www.reddit.com/r/webscraping/"
        }
    ],
    "maxPostCount": 20,
    "maxComments": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("laptime/subreddit-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "startUrls": [{ "url": "https://www.reddit.com/r/webscraping/" }],
    "maxPostCount": 20,
    "maxComments": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("laptime/subreddit-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/webscraping/"
    }
  ],
  "maxPostCount": 20,
  "maxComments": 5
}' |
apify call laptime/subreddit-scraper --silent --output-dataset

```

## MCP server setup

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