# Reddit Scraper (`mina_safwat/reddit-scraper`) Actor

Scrape posts from any public subreddit — title, author, score, upvote ratio, comment count, flair and timestamps — with the post text and top comments on request

- **URL**: https://apify.com/mina\_safwat/reddit-scraper.md
- **Developed by:** [Mina](https://apify.com/mina_safwat) (community)
- **Categories:** Social media, Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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 Scraper

Give it a list of subreddits, get back every post with its score, author, comment count and timestamp — plus the post text and top comments when you want them. No account, no API key, no rate-limit paperwork.

### What does Reddit Scraper do?

It collects posts from any public subreddit on [Reddit](https://www.reddit.com), in whichever order the subreddit itself serves them: hot, new, top, rising or best. Each post comes back as a clean row with the numbers you'd actually sort on — score, upvote ratio, comment count, awards — and, on request, the post's own body text and its highest-placed comments.

Because it runs on Apify you can call it from the API, schedule it hourly, feed it a subreddit list from Google Sheets, and export to JSON, CSV, Excel or straight into your own pipeline.

### Why use it?

- **Track a community over time.** Schedule a daily run on `new` and watch what a subreddit is actually talking about.
- **Find pain points for product research.** Complaint threads are where feature requests live.
- **Feed AI models.** Post text plus comments is dense, opinionated training and summarisation material.
- **Watch your brand or competitors.** Point it at the subreddits where your market hangs out.
- **Spot content early.** `rising` surfaces posts before they land on the front page.
- **Study what performs.** Compare titles, post types and timing against score.

### How to use it

1. Click **Try for free**.
2. Put your subreddits in **Subreddits** — one per line.
3. Pick a sort and how many posts you want per subreddit.
4. Click **Start**, then download the results as JSON, CSV or Excel.

Subreddits can be written any way you like — `https://www.reddit.com/r/python/`, `r/python`, or just `python`. If a link already carries a sort, like `/r/python/top/?t=month`, that sort wins for that subreddit, so you can mix sorts in a single run.

### Input

| Field | What it does |
|---|---|
| `subreddit_urls` | Your subreddits, one per line. Links, `r/name`, or bare names. |
| `sort` | `hot`, `new`, `top`, `rising` or `best`. Applied to any subreddit that doesn't name its own. |
| `time_filter` | Period for `top`: hour, day, week, month, year, all. |
| `max_posts_per_subreddit` | Stops after this many posts each. Posts arrive 24 at a time. |
| `include_comments` | Adds the post body and its top comments. Opens every post individually, so runs take longer. |
| `max_comments_per_post` | How many comments to keep per post, highest-placed first. |
| `proxy_configuration` | Residential, and it genuinely matters — see below. |

```json
{
    "subreddit_urls": [
        "https://www.reddit.com/r/python/",
        "r/webdev",
        "https://www.reddit.com/r/dataisbeautiful/top/?t=month"
    ],
    "sort": "hot",
    "max_posts_per_subreddit": 100,
    "include_comments": false,
    "proxy_configuration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### Output

One row per post:

```json
{
    "post_id": "1vwtd2g",
    "url": "https://www.reddit.com/r/Python/comments/1vwtd2g/gui_based_python_tkinter_serial_port_program/",
    "title": "GUI based Python Tkinter Serial Port Program for Arduino",
    "author": "xanthium_in",
    "subreddit": "r/Python",
    "score": 10,
    "upvote_ratio": 0.8571,
    "comment_count": 4,
    "award_count": 0,
    "created_at": "2026-08-24T05:05:14.982000+0000",
    "post_type": "multi_media",
    "domain": "self.Python",
    "link_url": "https://www.reddit.com/r/Python/comments/1vwtd2g/...",
    "is_removed": false,
    "sort": "hot",
    "subreddit_url": "https://www.reddit.com/r/python/",
    "scraped_at": "2026-08-24T13:39:58.569979+00:00"
}
```

With comments turned on, each row also carries `text` (the post's own body) and `comments`:

```json
"text": "This is gonna be more of a rant than anything else…",
"comments": [
    { "author": "HommeMusical", "score": 23, "depth": 0, "created_at": "…", "url": "…", "text": "You aren't doing a good job of selling it…" },
    { "author": "bulaybil", "score": 1, "depth": 1, "created_at": "…", "url": "…", "text": "Damn man, now I gotta get me an RTL-SDR dongle." }
]
```

`depth` is 0 for a top-level comment, 1 for a reply to it, and so on — so you can rebuild the thread shape.

#### Dataset views

- **Posts** — title, subreddit, author, score, comments, date. The one you'll use most.
- **Text & comments** — the post body and its discussion, for reading and for feeding models.
- **Outbound links** — what each post links to and which domain, for link and source analysis.

### Cost estimation

You're charged per result, and one result is one post.

| Run | Results | Notes |
|---|---|---|
| 5 subreddits × 100 posts | 500 | A daily community watch. |
| 20 subreddits × 500 posts | 10,000 | A research dataset. |
| 1 subreddit × 100, hourly | 2,400/day | Continuous monitoring. |

Turning on comments doesn't change the number of results — it opens each post to enrich the row it was already going to push. It does make the run take several times longer, so leave it off when you only need the post list.

### Tips

- **Keep residential proxies on.** Reddit challenges requests from datacenter addresses almost every time. This Actor answers those challenges and retries automatically, but it needs addresses worth retrying from.
- Short periods on a quiet subreddit return very little. `top` with `t=hour` on a small subreddit can legitimately return nothing — widen the period.
- Use `new` for monitoring and `top` for research. `hot` is a moving target and repeat runs will overlap.
- Posts arrive in batches of 24, so a limit of 100 fetches five batches and stops at 100.

### FAQ

**Do I need a Reddit account or API key?** No.

**Are private, quarantined or banned subreddits supported?** No — only what a logged-out visitor can see.

**Can I scrape a user's posts, or search results?** Not yet. Subreddit feeds only for now.

**How deep do comments go?** It keeps the highest-placed comments on the post's first page, replies included, up to your limit. It doesn't expand "load more comments" chains.

**Is scraping Reddit legal?** Collecting publicly visible data is generally legal, but what you do with it is your responsibility — respect Reddit's terms, and remember posts and comments are written by real people. Take legal advice before republishing or redistributing.

Found a problem or want a field added? Open an issue on the Actor's **Issues** tab.

# Actor input Schema

## `subreddit_urls` (type: `array`):

One subreddit per line. A full link, "r/name", or just the name all work. If the link already carries a sort — like /r/python/top/?t=week — that sort wins over the settings below, so you can mix sorts in one run.

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

Applied to every subreddit that does not name its own sort in the link.

## `time_filter` (type: `string`):

Only used when the sort is Top. Short periods on a quiet subreddit return very few posts — widen the period if a run comes back thin.

## `max_posts_per_subreddit` (type: `integer`):

Stops after this many posts for each subreddit. Posts arrive 24 at a time, so the count is rounded up to the next batch.

## `include_comments` (type: `boolean`):

Adds the post's own body text and its top comments. This opens every post individually, so runs take noticeably longer. Leave off if you only need the post list.

## `max_comments_per_post` (type: `integer`):

How many comments to keep per post, highest-placed first. Only used when comments are turned on.

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

Residential addresses are required in practice — Reddit challenges almost every request from a datacenter address.

## Actor input object example

```json
{
  "subreddit_urls": [
    "https://www.reddit.com/r/python/",
    "r/webdev",
    "MachineLearning"
  ],
  "sort": "hot",
  "time_filter": "WEEK",
  "max_posts_per_subreddit": 100,
  "include_comments": false,
  "max_comments_per_post": 20,
  "proxy_configuration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

No description

# 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_urls": [
        "https://www.reddit.com/r/python/",
        "r/webdev",
        "MachineLearning"
    ],
    "sort": "hot",
    "time_filter": "WEEK",
    "max_posts_per_subreddit": 100,
    "max_comments_per_post": 20,
    "proxy_configuration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("mina_safwat/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 = {
    "subreddit_urls": [
        "https://www.reddit.com/r/python/",
        "r/webdev",
        "MachineLearning",
    ],
    "sort": "hot",
    "time_filter": "WEEK",
    "max_posts_per_subreddit": 100,
    "max_comments_per_post": 20,
    "proxy_configuration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("mina_safwat/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 '{
  "subreddit_urls": [
    "https://www.reddit.com/r/python/",
    "r/webdev",
    "MachineLearning"
  ],
  "sort": "hot",
  "time_filter": "WEEK",
  "max_posts_per_subreddit": 100,
  "max_comments_per_post": 20,
  "proxy_configuration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call mina_safwat/reddit-scraper --silent --output-dataset

```

## MCP server setup

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