# Reddit Subreddit Posts Scraper (`toolzerhub/reddit-subreddit-posts-scraper`) Actor

Extract Reddit posts from any subreddit by Best, Hot, New, Top, or Rising sort order. Just add a subreddit name and get post ID, title, author, subreddit, score, and comment count, with full post detail on request. No Reddit account or API key required.

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

## Pricing

from $1.40 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/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

## Reddit Subreddit Posts Scraper

Collect posts from any subreddit. Pick a sort, set a limit, and the Actor pages through the feed for you.

No login, no cookie, no browser session.

### Input

| Field | Use it for |
|---|---|
| **`subreddit_name`** | Subreddit name without `r/`, or a full subreddit URL. Required. |
| **`sort`** | `BEST` (default), `HOT`, `NEW`, `TOP` or `RISING`. |
| **`maxItems`** | Caps the run. Default `100`. Set `0` for no limit. |
| **`addonPostDetails`** | Fetch the full post record for every post found. One extra request **per post**. |

```json
{
  "subreddit_name": "https://www.reddit.com/r/dataisbeautiful/",
  "sort": "TOP",
  "maxItems": 250
}
```

### Output

One row per post.

| Field | Contents |
|---|---|
| **`post_id`**, **`id`** | Reddit post fullname, e.g. `t3_1uw2gep` |
| **`title`** | Post title |
| **`author`** | Username, with the `u/` prefix stripped |
| **`subreddit`** | The subreddit you asked for |
| **`created_at`** | Creation timestamp |
| **`score`** | Net score |
| **`num_comments`** | Comment count |
| **`upvotes`** | Upvote count, where Reddit reports it separately from `score` |
| **`post_detail`** | Full post record. Only with **`addonPostDetails`** |

```json
{
  "post_id": "t3_1uw2gep",
  "title": "[OC] Every subway system in the world, to scale",
  "author": "transit_nerd",
  "subreddit": "dataisbeautiful",
  "created_at": "2026-07-14T09:12:44.000Z",
  "score": 41203,
  "num_comments": 887
}
```

### Promoted posts never reach your dataset

Reddit's feed mixes sponsored posts in with organic ones. Those are dropped before anything is saved -- along with any entry that is not a post at all, which is how Reddit's feed carries banners and recommendation widgets.

You therefore get fewer rows than the feed visually contains, and every row you get is a real post. A page that looked like 25 items may yield 22.

### Questions

**Why do I get fewer posts than `maxItems`?**
Two reasons stack. Promoted and non-post entries are filtered out as above, and separately Reddit's feed stops issuing cursors after a few hundred posts. The run ends when there is no next cursor, the page is empty, or the same cursor comes back twice -- so `maxItems: 0` on a large subreddit returns what Reddit will page through, not the subreddit's entire history.

**What does `addonPostDetails` add that the feed row does not have?**
The feed gives you the post's identity and engagement -- title, author, timestamp, score, comment count. The add-on attaches the full post record, including body text, flair and media. It costs one request per post, so on a 250-post run that is 250 extra requests. Leave it off if you only need titles and scores.

**Which sort should I use?**
`NEW` for monitoring, since it is the only one that is stable run to run. `TOP` and `BEST` re-rank constantly, so two runs minutes apart will overlap heavily but not exactly. Note this Actor defaults to `BEST`, while the [User Posts Scraper](https://apify.com/toolzerhub/reddit-user-posts-scraper) defaults to `NEW` and offers a narrower set.

**Can I scrape several subreddits in one run?**
No, one per run. Run it once per subreddit -- the `subreddit` field on every row keeps the results distinguishable when you merge the datasets.

### Related Actors

| Actor | Purpose |
|---|---|
| [Reddit Subreddit Info Scraper](https://apify.com/toolzerhub/reddit-subreddit-info-scraper) | The subreddit's own profile and stats |
| [Reddit Post Comments Scraper](https://apify.com/toolzerhub/reddit-post-comments-scraper) | Comments on any post you found here |
| [Reddit Post Scraper](https://apify.com/toolzerhub/reddit-post-scraper) | Full detail on specific posts, batched cheaply |

# Actor input Schema

## `subreddit_name` (type: `string`):

Subreddit name (without r/), or a subreddit URL (https://www.reddit.com/r/<name>/).

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

Sort order for the feed or listing.

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

Maximum number of items to save. Set 0 for no limit.

## `addonPostDetails` (type: `boolean`):

Fetch full post detail for every post found in the feed. This makes one extra request per post.

## Actor input object example

```json
{
  "subreddit_name": "pics",
  "sort": "BEST",
  "maxItems": 20,
  "addonPostDetails": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

Every record collected during this run

# 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 = {
    "subreddit_name": "pics",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/reddit-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 = {
    "subreddit_name": "pics",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("toolzerhub/reddit-subreddit-posts-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 '{
  "subreddit_name": "pics",
  "maxItems": 20
}' |
apify call toolzerhub/reddit-subreddit-posts-scraper --silent --output-dataset

```

## MCP server setup

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