# 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:** [Scrape Badger](https://apify.com/scrape.badger) (community)
- **Categories:** Social media, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 50.0% runs succeeded, NaN 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 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 |
| 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 |
| 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`).

### 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)

# 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("💾 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 '{
  "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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scrape.badger/reddit-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Scraper — Posts, Comments, Subreddits | MCP + AI",
        "description": "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.",
        "version": "1.0",
        "x-build-id": "NU7s2Bs91bOiJ9Evc"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrape.badger~reddit-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrape.badger-reddit-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scrape.badger~reddit-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrape.badger-reddit-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scrape.badger~reddit-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrape.badger-reddit-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "mode"
                ],
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "Search Posts",
                            "Search Subreddits",
                            "Search Users",
                            "Search Domain Posts",
                            "Trending Posts",
                            "Get Post Detail",
                            "Post Comments",
                            "Post Duplicates",
                            "Get Subreddit Detail",
                            "Subreddit Posts",
                            "Get Subreddit Rules",
                            "List Subreddit Wiki Pages",
                            "Get Subreddit Wiki Page",
                            "Popular Subreddits",
                            "New Subreddits",
                            "Get User Profile",
                            "User Posts",
                            "User Comments",
                            "Get User Moderated Subreddits",
                            "Get User Trophies"
                        ],
                        "type": "string",
                        "description": "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).",
                        "default": "Search Posts"
                    },
                    "subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "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": {
                        "title": "Post ID",
                        "type": "string",
                        "description": "Reddit post ID without the t3_ prefix (e.g. 'abc123'). REQUIRED for: Get Post Detail, Post Comments, Post Duplicates."
                    },
                    "wiki_page": {
                        "title": "Wiki Page",
                        "type": "string",
                        "description": "Wiki page path (e.g. 'index' or 'rules/posting'). REQUIRED for: Get Subreddit Wiki Page."
                    },
                    "username": {
                        "title": "Username",
                        "type": "string",
                        "description": "Reddit username without the u/ prefix. REQUIRED for: Get User Profile, User Posts, User Comments, Get User Moderated Subreddits, Get User Trophies."
                    },
                    "query": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Keywords to search. REQUIRED for: Search Posts, Search Subreddits, Search Users."
                    },
                    "domain": {
                        "title": "Domain",
                        "type": "string",
                        "description": "Domain to find link posts for (e.g. 'github.com'). REQUIRED for: Search Domain Posts."
                    },
                    "sort": {
                        "title": "Sort",
                        "enum": [
                            "relevance",
                            "hot",
                            "top",
                            "new",
                            "rising",
                            "comments"
                        ],
                        "type": "string",
                        "description": "Sort order for posts/listings. Used by: Search Posts, Search Domain Posts, Subreddit Posts, User Posts, User Comments.",
                        "default": "new"
                    },
                    "time_filter": {
                        "title": "Time Filter",
                        "enum": [
                            "all",
                            "hour",
                            "day",
                            "week",
                            "month",
                            "year"
                        ],
                        "type": "string",
                        "description": "Time window for ranked sorts. Used by: Search Posts, Search Domain Posts, Subreddit Posts, User Posts, User Comments.",
                        "default": "all"
                    },
                    "comment_sort": {
                        "title": "Comment Sort",
                        "enum": [
                            "best",
                            "top",
                            "new",
                            "controversial",
                            "old",
                            "qa"
                        ],
                        "type": "string",
                        "description": "Sort order for comments. Used only by: Post Comments.",
                        "default": "best"
                    },
                    "depth": {
                        "title": "Comment Depth",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Maximum nesting depth of the comment reply tree. Leave empty for full depth. Used only by: Post Comments."
                    },
                    "max_results": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "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.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
