# Reddit Subreddit Scraper — Posts, Scores & Comment Counts (`maged120/reddit-subreddit`) Actor

Scrape posts from any Reddit subreddit. Get titles, scores, comment counts, authors, timestamps, and links. Supports hot, new, top, and rising sort orders.

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

## Pricing

from $9.00 / 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/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 does Reddit Subreddit Scraper do?

**Reddit Subreddit Scraper** extracts posts from any subreddit — hot, new, top, or rising — without needing a Reddit API key. Get post titles, scores, comment counts, authors, timestamps, flairs, and URLs for any subreddit, and export the results as structured JSON or CSV.

This Actor runs on the [Apify platform](https://apify.com), perfect for content discovery, trend analysis, niche community research, and competitive monitoring.

### Why use Reddit Subreddit Scraper?

- **No Reddit API key** — no OAuth setup, no rate limits
- **All sort modes** — hot, new, top (day/week/month/year/all-time), rising
- **Batch subreddits** — scrape multiple subreddits in one run
- **Content research** — find high-performing posts in any niche
- **Competitor monitoring** — track competitor mentions in relevant communities

### How to use Reddit Subreddit Scraper

1. Open the Actor and click **Try for free**
2. Enter subreddit names in the `subreddits` field
3. Choose a sort mode and time filter
4. Set the maximum number of posts
5. Click **Start** — results appear in the Output tab
6. Download as JSON, CSV, or Excel

### Input

```json
{
  "subreddits": ["Python", "MachineLearning", "datascience"],
  "sort": "hot",
  "time": "week",
  "maxPosts": 100
}
```

| Field | Type | Description | Default |
|---|---|---|---|
| `subreddits` | array | Subreddit names (without `r/`) | required |
| `sort` | string | `hot`, `new`, `top`, `rising` | `hot` |
| `time` | string | Time filter for `top`: `day`, `week`, `month`, `year`, `all` | `week` |
| `maxPosts` | integer | Max posts per subreddit | `100` |

### Output

Results are stored in the Apify dataset. Download in JSON, CSV, HTML, or Excel.

```json
{
  "subreddit": "Python",
  "sort": "hot",
  "title": "I built a tool that converts Python code to TypeScript automatically",
  "url": "https://www.reddit.com/r/Python/comments/example/",
  "author": "u/devbuilder",
  "score": 2341,
  "numComments": 187,
  "upvoteRatio": 0.95,
  "created": "2024-03-15T08:00:00Z",
  "flair": "Project",
  "isSelf": false,
  "thumbnail": "https://..."
}
```

### Output fields

| Field | Type | Description |
|---|---|---|
| `subreddit` | string | Subreddit name |
| `sort` | string | Sort mode used |
| `title` | string | Post title |
| `url` | string | Post URL |
| `author` | string | Post author |
| `score` | number | Net upvote score |
| `numComments` | number | Comment count |
| `upvoteRatio` | number | Upvote ratio (0–1) |
| `created` | string | Post creation timestamp |
| `flair` | string | Post flair |
| `isSelf` | boolean | True if text post, false if link post |

### How many results will I get?

You're charged per result, so the cost follows the number of rows below. Your plan's rates are on the **Pricing** tab.

| Input | Results |
|---|---|
| Limit = 500 | Up to 500 rows |
| Limit = 5,000 | Up to 5,000 rows |

Each post is one row.

### Tips

- Use `sort: "top"` with `time: "all"` to find the most acclaimed posts ever in a subreddit — great for content inspiration
- Schedule daily scrapes of `sort: "hot"` to build a trending-content feed
- Scrape multiple subreddits at once by adding them all to the `subreddits` array
- Use `sort: "new"` for near-real-time monitoring of fresh posts

### FAQ

**Does this require a Reddit account or API key?**
No — the Actor accesses Reddit's public listing pages.

**Can I scrape private or NSFW subreddits?**
Only public subreddits are supported.

**How many posts can I get per subreddit?**
Reddit typically exposes up to 1,000 posts per sort/time combination. Set `maxPosts` accordingly.

**Is this Actor maintained?**
Yes. Report bugs or feature requests in the Issues tab.

**Need help or have questions?**
Open an issue in the Issues tab or reach out on Discord: **maged03211**

***

⭐ **Found this Actor useful?** A quick review on the Store helps other users find it and keeps it maintained.

# Actor input Schema

## `subreddit` (type: `string`):

Subreddit to use (e.g., 'web').

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

Time to search (e.g., 'year', 'month', 'week', 'day', or 'hour'). Only required if type is 'subreddit' or 'user'.

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

Time to search (e.g., 'year', 'month', 'week', 'day', or 'hour'). Only required if type is 'subreddit' or 'user'.

## `proxy_configuration` (type: `object`):

Leave the default Apify Residential proxy and do not select a specific country (leave it on automatic) for best results and to avoid rate limiting.

## `limit` (type: `integer`):

Maximum number of posts to retrieve (default: 25).

## Actor input object example

```json
{
  "subreddit": "web",
  "time": "all",
  "sort": "new",
  "proxy_configuration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "limit": 10
}
```

# 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 = {
    "limit": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("maged120/reddit-subreddit").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 = { "limit": 10 }

# Run the Actor and wait for it to finish
run = client.actor("maged120/reddit-subreddit").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 '{
  "limit": 10
}' |
apify call maged120/reddit-subreddit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,maged120/reddit-subreddit"
        }
    }
}
```

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/pG158ozdvzDjskf6J/builds/jqkaqSyfQfgM4VpRj/openapi.json
