# Subreddit Posts Scraper (`agentx/subreddit-posts-scraper`) Actor

Subreddit posts scraper for one community with new, top, hot, rising, or controversial sorting: 43 top-level fields per post covering engagement signals, flags, media, duplicate links, and optional nested comments. Inputs accept 1-1,000 posts and 0-2,000 comments per post. From $3 per 1,000 posts.

- **URL**: https://apify.com/agentx/subreddit-posts-scraper.md
- **Developed by:** [AgentX](https://apify.com/agentx) (community)
- **Categories:** Social media, Lead generation, Agents
- **Stats:** 20 total users, 1 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $7.20 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

**Subreddit Posts Scraper is a subreddit posts scraper that exports one community's feed in new, top, hot, rising, or controversial order, writing each post as a row with 43 documented fields for text, links, engagement signals, flags, media, duplicates, and optional nested comments.**

- **Four inputs: the community, the listing order, a post limit from 1 to 1,000, and an optional per-post comment limit from 0 to 2,000.**
- **43 documented fields per post, including `duplicates` and `content_score`.**
- **Comments are opt-in and billed separately, so a listing sweep stays cheap until you ask for threads.**

[**Run the one-post example**](https://apify.com/agentx/subreddit-post-scraper/input-schema) · [**View API**](https://docs.apify.com/api/v2/act-run-sync-get-dataset-items-post)

One start plus one returned post with comments disabled is **$0.01400** on the FREE tier. Begin at the minimum and set a maximum total charge, because large post or comment limits can be slow or exceed the run window.

### What does Subreddit Posts Scraper do?

It reads one community's listing and normalizes it. Choose a subreddit and a sort order, and each post comes back as a single row containing the title and body, the author and their flair, the community's own context, the engagement values Reddit reports, media references, the state and moderation flags, the duplicate links that show where the post was crossposted, and — when you ask for them — the nested comment thread.

The listing order is the question you are asking: `new` for monitoring, `top` for best-performing material, `hot` and `rising` for attention, `controversial` for contested threads. Reddit stops a subreddit listing near a thousand entries regardless of a community's true post count, so 1,000 is a ceiling rather than a promise. It does not search across communities — that is [Reddit Viral Scraper](https://apify.com/agentx/reddit-viral-scraper) — nor profile the community or its members.

### How do I use Subreddit Posts Scraper?

1. Enter one `community` — a plain name, an `r/name` path, or a full community URL.
2. Choose `sort_by` for the listing order you actually want to analyze.
3. Set `max_posts`, and leave `max_comments` at `0` until you need threads.
4. Start the run and read the dataset, or export JSON, CSV, or Excel.

The smallest useful input:

```json
{
  "community": "programming",
  "sort_by": "new",
  "max_posts": 1,
  "max_comments": 0
}
```

### Input

| Input | Type | Required | Effect |
| --- | --- | --- | --- |
| `community` | string | Yes | The subreddit to read. Accepts a plain name, an `r/name` path, or a `reddit.com/r/name` URL. |
| `sort_by` | string | Yes | `new`, `top`, `hot`, `rising`, or `controversial`. Reddit determines the available order and its coverage. |
| `max_posts` | integer | Yes | 1–1,000 posts. Reddit stops a subreddit listing near a thousand entries, so 1,000 is the ceiling. |
| `max_comments` | integer | Yes | 0–2,000 comments per post. `0` disables comment collection entirely. |

There is no time-window input: the Actor requests Reddit's selected listing mode without an additional time-range control. Both caps are maximum requests — listing coverage, community state, deleted content, and source errors can all return fewer records.

### Output

One row per post, with 43 top-level fields in these groups:

| Group | Fields |
| --- | --- |
| Post | `id`, `title`, `body`, `link`, `created`, `edited`, `flair_text` |
| Author | `author`, `author_flair` |
| Community context | `subreddit`, `subreddit_type`, `subreddit_subscribers` |
| Engagement | `score`, `upvote_ratio`, `comment_count`, `crossposts`, `content_score` |
| Media | `media_type`, `media_url`, `domain`, `thumbnail`, `images`, `video_url`, `video_duration`, `is_self`, `is_video`, `is_gallery` |
| State flags | `archived`, `locked`, `stickied`, `pinned`, `over_18`, `spoiler`, `original`, `distinguished`, `advertising`, `indexable`, `crosspostable`, `no_follow` |
| Spread and discussion | `duplicates`, `comments` |
| Provenance | `processor`, `processed_at` |

An abbreviated row for the `programming` example:

```json
{
  "subreddit": "programming",
  "title": "A practical guide to structured logging",
  "author": "example_user",
  "created": "2026-08-01T18:04:12Z",
  "score": 412,
  "upvote_ratio": 0.96,
  "comment_count": 87,
  "over_18": false,
  "stickied": false,
  "duplicates": [],
  "comments": [],
  "processed_at": "2026-08-02T10:15:33Z"
}
```

Vote values are source-reported and Reddit may fuzz them, so do not treat `score` as exact upvote-minus-downvote arithmetic. Unavailable values stay null or empty rather than being replaced by defaults.

### Use cases

- **Community monitoring** — schedule a `new` run to capture everything a community posts, in a stable schema.
- **Best-performing content research** — pull `top` and rank by `score`, `upvote_ratio`, and `comment_count`.
- **Discussion mining** — enable comments on a small `controversial` set to study disagreement in a niche.
- **Media and link inventories** — collect `domain`, `images`, and `video_url` to see what a community actually shares.
- **Crosspost tracing** — read `duplicates` and `crossposts` to find where a community's material travels.

Choose another tool if you are starting from a topic rather than a community, or if you want the community's settings or the people in it — those are separate Actors below.

### API and integrations

The stable Actor ID is `ipw4MHKL6ZBj9pYeF`, and its Store handle is `agentx/subreddit-post-scraper`. Start a run and read the dataset with any HTTP client:

```bash
curl -X POST "https://api.apify.com/v2/acts/ipw4MHKL6ZBj9pYeF/run-sync-get-dataset-items" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"community":"programming","sort_by":"new","max_posts":1,"max_comments":0}'
```

The same input works from the Apify Console, the JavaScript and Python clients, Scheduler, and webhooks. For larger requests, start the run asynchronously, poll its status, and read the dataset after it succeeds — a client timeout does not mean the cloud run stopped. For agent clients, connect to [Apify MCP](https://docs.apify.com/integrations/mcp), fetch the Actor's details to load the current input schema, then call `agentx/subreddit-posts-scraper` with a bounded charge and runtime.

### Pricing

The Actor uses pay-per-event pricing. The configured start event is **$0.01000**. Result prices, one event per returned post, are FREE **$0.00400**, BRONZE **$0.00360**, SILVER **$0.00320**, and GOLD, PLATINUM, or DIAMOND **$0.00300**. Comment prices are FREE **$0.00100**, BRONZE **$0.00090**, SILVER **$0.00080**, and GOLD, PLATINUM, or DIAMOND **$0.00075**.

| FREE-tier example | Calculation | Configured total |
| --- | ---: | ---: |
| One returned post, comments disabled | $0.01000 + 1 × $0.00400 | **$0.01400** |
| One returned post with 10 comments | $0.01000 + 1 × $0.00400 + 10 × $0.00100 | **$0.02400** |

Charges depend on emitted posts and charged nested comments, subject to live platform behavior and account settings. Prices can change after publication; confirm the [Actor Store page](https://apify.com/agentx/subreddit-post-scraper) before budgeting. Input limits control requested source volume but are not a spending limit — use `maxTotalChargeUsd` for that.

### Alternatives

Reading the community in a browser is free and works for a handful of posts; it does not give you 43 normalized fields, a stable schema across runs, or a scheduled export. Flat-rate Reddit scrapers charge one price per item whether it is a post or a comment, which becomes expensive on threads with hundreds of replies — the separate Result and Comment events here let a listing sweep stay cheap and a thread deep-dive stay deliberate. The counter-case is genuine: if your question begins with a topic rather than a community, [Reddit Viral Scraper](https://apify.com/agentx/reddit-viral-scraper) searches across all of Reddit and this Actor cannot; and if you only need one post's full thread, a single-post tool will cost less than a listing run.

### Limits and troubleshooting

- **Fewer posts than `max_posts`** — the value is a maximum. Listing coverage, access, community state, source errors, and runtime can all reduce the result.
- **Listing capped near 1,000** — Reddit stops a subreddit listing there regardless of the community's true post count.
- **No time-window control** — none is exposed; use `sort_by` and filter by `created` downstream.
- **Comment array smaller than requested** — deleted or unavailable comments, tree expansion, and runtime all limit it; very large values are impractical.
- **Vote fields look approximate** — they are source-reported and may be fuzzed by Reddit.
- **Charge limit reached** — compare start, result, and comment event counts against your limit before raising it.

Report a reproducible problem through [AgentX support](https://t.me/Apify_Actor) with the run ID, the exact four-field input, and the expected versus observed dataset count.

### Frequently asked questions

#### How can I scrape subreddit posts?

You can scrape subreddit posts by entering a community name, one sort mode, and a post limit — no Reddit API key or app registration is required, and each post arrives as one 43-field dataset row.

#### Can I get a subreddit hot new top posts export in one run?

A subreddit hot new top posts export takes one run per listing: pick `hot`, `new`, or `top` as `sort_by` and export the dataset as JSON, CSV, or Excel; run the listings you need separately so each snapshot stays comparable.

#### Is `max_comments` required?

It is part of the input contract, but `0` disables comment collection — use that for posts-only runs.

#### Does `max_posts` guarantee that many records?

No. It is a maximum request. Reddit listing coverage, access, community state, source errors, charge limits, and runtime can reduce the result.

#### Are vote fields exact?

They are source-reported values. Reddit may fuzz vote information, so do not use them as audited evidence.

#### Does `top` include a configurable time window?

No time-window input is exposed. The Actor requests Reddit's selected listing mode without an additional time-range control.

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

No. Provide the four inputs and start the run.

### Related AgentX Actors

- [Reddit Viral Scraper](https://apify.com/agentx/reddit-viral-scraper) — start from a keyword and search across all communities instead of one feed.
- [SubReddit Info Scraper](https://apify.com/agentx/subreddit-info-scraper) — the community's own profile: subscribers, rules, and settings.
- [Subreddit Member Scraper](https://apify.com/agentx/subreddit-member-scraper) — the people visibly active in the community, as full profiles.

### Enrich your data with AgentX

- [All Jobs Scraper](https://apify.com/agentx/all-jobs-scraper) — add hiring signals from 39 job platforms to community research.
- [All Shopping Scraper](https://apify.com/agentx/all-shopping-scraper) — bring product and pricing context to a community's shared links.
- [All Video Scraper](https://apify.com/agentx/all-video-scraper) — resolve the video links a community posts into metadata and files.

### Support

Use public Reddit data proportionately: follow Reddit's terms, Apify's policies, applicable law, and your organization's privacy obligations, and require human review before consequential decisions. Do not use the output for harassment, spam, sensitive profiling, or automated decisions that require verified identity. Subreddit Posts Scraper is an independent tool and is not affiliated with, endorsed by, or sponsored by Reddit, Inc.

- [Actor Store page](https://apify.com/agentx/subreddit-post-scraper) for the current public details.
- [AgentX community & support on Telegram](https://t.me/Apify_Actor).
- [Apify MCP guide](https://docs.apify.com/integrations/mcp) for agent client setup.

[**Run the one-post example**](https://apify.com/agentx/subreddit-post-scraper/input-schema) · [**View API**](https://docs.apify.com/api/v2/act-run-sync-get-dataset-items-post)

# Actor input Schema

## `community` (type: `string`):

Subreddit name, r/name path, or reddit.com/r/name URL. Example: 'apify'

## `sort_by` (type: `string`):

Listing order: new, top, hot, rising, or controversial. Reddit determines the available order and coverage.

## `max_posts` (type: `integer`):

How many posts to return. Reddit stops a subreddit listing near a thousand entries however many the community has, so 1000 is the ceiling.

## `max_comments` (type: `integer`):

How many comments to collect per post. Set to 0 to skip comments. A post's thread returns about 450 comments in one read and names the rest, which are then resolved in bounded rounds — measured at roughly 2450 comments and 40 seconds for the busiest threads on Reddit, so 2000 is the ceiling. Posts are read three at a time, but comments are still the slow part of a run, so size this against the number of posts you asked for.

## Actor input object example

```json
{
  "community": "programming",
  "sort_by": "new",
  "max_posts": 4
}
```

# Actor output Schema

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

Reddit post records in the default dataset, including optional charged nested comments.

# 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 = {
    "community": "programming",
    "sort_by": "new",
    "max_posts": 4,
    "max_comments": 0
};

// Run the Actor and wait for it to finish
const run = await client.actor("agentx/subreddit-posts-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 = {
    "community": "programming",
    "sort_by": "new",
    "max_posts": 4,
    "max_comments": 0,
}

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

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

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

```

## CLI example

```bash
echo '{
  "community": "programming",
  "sort_by": "new",
  "max_posts": 4,
  "max_comments": 0
}' |
apify call agentx/subreddit-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=agentx/subreddit-posts-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/ipw4MHKL6ZBj9pYeF/builds/mckw0vEe0JvjlYyLn/openapi.json
