# Reddit Scraper Goat (`goat255/reddit-scraper`) Actor

Scrape Reddit posts and comments in bulk. Point it at a subreddit, a post URL, a username, or a search query and get clean rows with scores, authors, timestamps, flair, media, and full comment threads. Automatic pagination, no login, no API key.

- **URL**: https://apify.com/goat255/reddit-scraper.md
- **Developed by:** [Goutam Soni](https://apify.com/goat255) (community)
- **Categories:** Social media, Lead generation, News
- **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.
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 Scraper

Extract Reddit data at scale without a login or API key. Pull posts from any subreddit, full comment trees from any post, a user's post and comment history, and keyword search results. The scraper walks pagination automatically up to the limit you set, so you can collect hundreds or thousands of items per source in a single run.

### What it does

- **Subreddit feeds** - posts from any subreddit by sort (hot, new, top, rising) and time window (hour, day, week, month, year, all).
- **Post comments** - the full comment tree for any post, flattened top-down with scores, authors, and parent links.
- **User activity** - a user's recent posts and comments in one stream.
- **Keyword search** - search results across Reddit, or restricted to a single subreddit.
- **Pagination** - every mode walks multiple pages until your `maxItemsPerSource` is reached or the source runs out.

### Input

| Field | Type | Description |
|---|---|---|
| `subreddits` | array | Subreddit names. With or without `r/`. Example: `python`, `r/example`. |
| `postUrls` | array | Post links or IDs to fetch with comments. Example: `https://www.reddit.com/r/example/comments/abc123/title/` or `abc123`. |
| `usernames` | array | Usernames to pull posts and comments from. With or without `u/`. Example: `example_user`. |
| `searchQueries` | array | Keyword searches. Example: `machine learning`. |
| `sort` | string | `hot`, `new`, `top`, or `rising`. Applies to subreddit feeds and search. |
| `time` | string | `hour`, `day`, `week`, `month`, `year`, `all`. Applies to top sort and search. |
| `maxItemsPerSource` | integer | Cap per subreddit, user, post, or query. Default 100. |
| `includeComments` | boolean | Also fetch comments for each post in subreddit and search modes. Default off. |
| `concurrency` | integer | Sources processed in parallel. Default 5. |
| `proxyConfig` | object | Apify proxy. RESIDENTIAL is the default and recommended. |

At least one of `subreddits`, `postUrls`, `usernames`, or `searchQueries` is required.

#### Example input

```json
{
  "subreddits": ["example", "r/another_example"],
  "sort": "top",
  "time": "week",
  "maxItemsPerSource": 250,
  "includeComments": false,
  "concurrency": 3
}
```

### Output

Each item is tagged with a `type` of `post` or `comment`.

#### Post

```json
{
  "type": "post",
  "id": "abc123",
  "subreddit": "example",
  "title": "An example post title",
  "author": "example_user",
  "selftext": "The body text of a self post, or empty for link posts.",
  "url": "https://example.com/article",
  "permalink": "https://www.reddit.com/r/example/comments/abc123/an_example_post_title/",
  "score": 1234,
  "upvoteRatio": 0.97,
  "numComments": 88,
  "createdUtc": "2026-06-15T12:00:00.000Z",
  "flair": "Discussion",
  "isVideo": false,
  "thumbnail": "https://b.thumbs.redditmedia.com/example.jpg",
  "media": null
}
```

#### Comment

```json
{
  "type": "comment",
  "id": "def456",
  "postId": "abc123",
  "subreddit": "example",
  "author": "example_user",
  "body": "An example comment body.",
  "score": 42,
  "createdUtc": "2026-06-15T12:30:00.000Z",
  "parentId": "t3_abc123",
  "permalink": "https://www.reddit.com/r/example/comments/abc123/_/def456/"
}
```

Every field is always present. Unknown values are `null`.

### Use cases

- Track discussion and sentiment in communities relevant to your product or market.
- Build datasets of posts and comments for research or model training.
- Monitor keyword mentions across Reddit on a schedule.
- Analyze a community's most active posts over a time window.

### Notes

- A run uses the Apify proxy you select. RESIDENTIAL gives the most reliable results.
- If a source is temporarily unavailable, the item is returned with a generic status (`upstream_unavailable`, `upstream_rate_limit`, or `not_found`) so a single failure never stops the run.
- Pagination depth is bounded by what the source exposes for a given feed.

### FAQ

#### Do I need a Reddit account or API key?

No. This actor reads public Reddit content without any login or API key.

#### What can it scrape?

Subreddit feeds by sort and time, a post with its full comment tree, a user's posts and comments, and keyword search results.

#### How many items can I get?

You set the limit per source. The actor walks pagination page by page until your maximum is reached.

#### Can it scrape private or quarantined subreddits?

No. Only publicly viewable content is supported.

#### Can I export to CSV or Google Sheets?

Yes. Every run exports to JSON, CSV, Excel, or your own integrations.

### Privacy

To improve our actors we collect anonymized usage telemetry (run stats and input patterns). No personal account data is collected.

# Actor input Schema

## `subreddits` (type: `array`):

Subreddit names to pull posts from. With or without the r/ prefix. Example: python, r/example.

## `postUrls` (type: `array`):

Specific post links or IDs to fetch with their comments. Example: https://www.reddit.com/r/example/comments/abc123/title/ or abc123.

## `usernames` (type: `array`):

Reddit usernames to pull recent posts and comments from. With or without the u/ prefix. Example: example\_user, u/example\_user.

## `searchQueries` (type: `array`):

Keyword searches to run across Reddit. Example: machine learning, open source.

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

Sort order for subreddit feeds and search. hot, new, top, or rising.

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

Time window for top sort and search. hour, day, week, month, year, or all.

## `maxItemsPerSource` (type: `integer`):

Cap on items returned per subreddit, user, post, or query. Pagination is walked across multiple pages until this is reached or the source is exhausted.

## `includeComments` (type: `boolean`):

When on, the comment tree is also fetched for each post returned by subreddit and search modes. Off by default to keep runs fast and cheap.

## `concurrency` (type: `integer`):

How many sources to process in parallel. Higher is faster but puts more load on proxies.

## `proxyConfig` (type: `object`):

Apify proxy. RESIDENTIAL is the default and recommended option for the most reliable results.

## Actor input object example

```json
{
  "subreddits": [
    "python"
  ],
  "postUrls": [],
  "usernames": [],
  "searchQueries": [],
  "sort": "hot",
  "time": "day",
  "maxItemsPerSource": 100,
  "includeComments": false,
  "concurrency": 5,
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `posts` (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 = {
    "subreddits": [
        "python"
    ],
    "postUrls": [],
    "usernames": [],
    "searchQueries": [],
    "proxyConfig": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("goat255/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 = {
    "subreddits": ["python"],
    "postUrls": [],
    "usernames": [],
    "searchQueries": [],
    "proxyConfig": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("goat255/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 '{
  "subreddits": [
    "python"
  ],
  "postUrls": [],
  "usernames": [],
  "searchQueries": [],
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call goat255/reddit-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=goat255/reddit-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/cPtDMFbQG0FybdHkk/builds/UCjNxBLxs3rhoBRjd/openapi.json
