# Reddit Scraper — Posts, Comments, Subreddits | MCP + AI (`scrape.badger/reddit-scraper`) Actor

Scrape Reddit posts, users, subreddits and other data with affordable ScrapeBadger Reddit Scraper. High success rates and fast support. 20 modes: posts, comment trees, subreddits, rules, wiki, user data, keyword & domain search, trending. No Reddit API key needed. From $1.00/1K items.

- **URL**: https://apify.com/scrape.badger/reddit-scraper.md
- **Developed by:** [ScrapeBadger](https://apify.com/scrape.badger) (community)
- **Categories:** Social media, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 72 total users, 30 monthly users, 98.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 reddit items

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?

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

## Reddit Scraper All-in-One

Scrape **Reddit posts, comments, subreddits, users, rules, wiki pages and trophies** with one actor — no Reddit API key, no OAuth, no CAPTCHAs. Powered by [ScrapeBadger](https://scrapebadger.com)'s Reddit API: TLS fingerprinting, residential proxies and anti-bot bypass are handled for you.

### What it does

Pick a **mode** and fill in the fields it needs. 20 modes:

#### Search

| Mode | Needs | Returns |
|------|-------|---------|
| Search Posts | `query` (+ optional `subreddit`) | posts |
| Search Subreddits | `query` | subreddits |
| Search Users | `query` | users |
| Search Domain Posts | `domain` | posts linking to that domain |

#### Posts

| Mode | Needs | Returns |
|------|-------|---------|
| Trending Posts | — | front-page trending posts |
| Get Post Detail | `post_id` | one post |
| Post Comments | `post_id` | full nested comment tree |
| Post Duplicates | `post_id` | cross-posts / duplicates |

#### Subreddits

| Mode | Needs | Returns |
|------|-------|---------|
| Get Subreddit Detail | `subreddit` | subreddit metadata (incl. live `subscribers` count, settings & branding) |
| Subreddit Posts | `subreddit` | posts (hot/new/top/rising/controversial) |
| Get Subreddit Rules | `subreddit` | rules |
| List Subreddit Wiki Pages | `subreddit` | wiki page names |
| Get Subreddit Wiki Page | `subreddit`, `wiki_page` | wiki page content |
| Popular Subreddits | — | most popular subreddits |
| New Subreddits | — | newest subreddits |

#### Users

| Mode | Needs | Returns |
|------|-------|---------|
| Get User Profile | `username` | profile + karma |
| User Posts | `username` | submitted posts |
| User Comments | `username` | comment history |
| Get User Moderated Subreddits | `username` | subreddits they moderate, each with `mod_permissions` |
| Get User Trophies | `username` | trophy case |

Every output record carries a `dataType` field (`post` / `comment` / `subreddit` / `user` / `rule` / `trophy` / `wikiPage` / `wikiPageName`) so you can route mixed results downstream. Datetimes are provided as both Unix (`created_utc`) and ISO 8601 (`created_at`).

### Full field coverage

Responses now include the full set of content datapoints from Reddit's `.json` API:

- **Posts** — engagement (`ups`, `downs`, `upvote_ratio`, `num_crossposts`, `total_awards_received`, `all_awardings`), post & author flair (text/type/colors/template), media (`media`, `media_embed`, `secure_media`, `thumbnail`), and content flags/state (`is_video`, `is_gallery`, `is_original_content`, `locked`, `archived`, `spoiler`, `nsfw`, `distinguished`, etc.).
- **Comments** — `ups`/`downs`, `controversiality`, awards, flair, `depth`, and state flags.
- **Subreddits** — live `subscribers` count, submission settings (`allow_images`/`allow_videos`/`allow_polls`/`link_flair_enabled`/…), and branding (`community_icon`, `banner_img`, `primary_color`, `key_color`, …).
- **Users** — full karma breakdown (`link_karma`, `comment_karma`, `awardee_karma`, `awarder_karma`, `total_karma`) and account flags (`is_gold`, `is_employee`, `is_mod`, `verified`, `has_verified_email`, …).

### No setup, no API key

Nothing to configure — there's **no Reddit API key, no OAuth, and no ScrapeBadger account required**. Just pick a mode, fill in the fields, and run. You're billed directly through Apify (see Pricing below).

### Pricing

Pay-per-event:

- **Actor start** — $0.001 per run
- **Reference item** — $0.001 each (posts, subreddits, users, rules, trophies, wiki page names, profile/detail lookups, search & listing results)
- **Complex item** — $0.003 each (comment-tree comments, duplicates, wiki page content, moderated subreddits)

So a typical search/listing run costs **~$1.00 per 1,000 items**, and comment-heavy runs **~$3.00 per 1,000 items** — undercutting the market's $3.40/1K leader on reference data.

### Search syntax

Search modes support Reddit's query operators: `title:`, `author:`, `subreddit:`, `flair:`, `site:`, `self:yes`, `nsfw:yes`, and `AND` / `OR` / `NOT`.

### Links

- [ScrapeBadger Reddit API docs](https://docs.scrapebadger.com/reddit/overview)
- [Get an API key](https://scrapebadger.com)

# Changelog

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

# Actor input Schema

## `mode` (type: `string`):

The type of Reddit data to extract. Each mode uses a different subset of the fields below (see each field's description for which modes need it).

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

Subreddit name without the r/ prefix (e.g. 'programming'). REQUIRED for: Get Subreddit Detail, Subreddit Posts, Get Subreddit Rules, List Subreddit Wiki Pages, Get Subreddit Wiki Page. OPTIONAL for Search Posts (restricts the search to this community).

## `post_id` (type: `string`):

Reddit post ID without the t3\_ prefix (e.g. 'abc123'). REQUIRED for: Get Post Detail, Post Comments, Post Duplicates.

## `wiki_page` (type: `string`):

Wiki page path (e.g. 'index' or 'rules/posting'). REQUIRED for: Get Subreddit Wiki Page.

## `username` (type: `string`):

Reddit username without the u/ prefix. REQUIRED for: Get User Profile, User Posts, User Comments, Get User Moderated Subreddits, Get User Trophies.

## `query` (type: `string`):

Keywords to search. REQUIRED for: Search Posts, Search Subreddits, Search Users.

## `domain` (type: `string`):

Domain to find link posts for (e.g. 'github.com'). REQUIRED for: Search Domain Posts.

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

Sort order for posts/listings. Used by: Search Posts, Search Domain Posts, Subreddit Posts, User Posts, User Comments.

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

Time window for ranked sorts. Used by: Search Posts, Search Domain Posts, Subreddit Posts, User Posts, User Comments.

## `comment_sort` (type: `string`):

Sort order for comments. Used only by: Post Comments.

## `depth` (type: `integer`):

Maximum nesting depth of the comment reply tree. Leave empty for full depth. Used only by: Post Comments.

## `max_results` (type: `integer`):

Maximum number of items to return for list/search modes. Higher values increase run time and cost. Note: Reddit caps most public listings at ~1000 items.

## Actor input object example

```json
{
  "mode": "Search Posts",
  "subreddit": "programming",
  "post_id": "abc123",
  "wiki_page": "index",
  "username": "spez",
  "query": "machine learning",
  "domain": "github.com",
  "sort": "new",
  "time_filter": "all",
  "comment_sort": "best",
  "max_results": 100
}
```

# 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": "programming",
    "post_id": "abc123",
    "wiki_page": "index",
    "username": "spez",
    "query": "machine learning",
    "domain": "github.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrape.badger/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": "programming",
    "post_id": "abc123",
    "wiki_page": "index",
    "username": "spez",
    "query": "machine learning",
    "domain": "github.com",
}

# Run the Actor and wait for it to finish
run = client.actor("scrape.badger/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": "programming",
  "post_id": "abc123",
  "wiki_page": "index",
  "username": "spez",
  "query": "machine learning",
  "domain": "github.com"
}' |
apify call scrape.badger/reddit-scraper --silent --output-dataset

```

## MCP server setup

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