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

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.

# 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"
    ]
  }
}
```

# 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Scraper Goat",
        "description": "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.",
        "version": "0.1",
        "x-build-id": "gJkCqSDRa69aA4qFt"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/goat255~reddit-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-goat255-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/goat255~reddit-scraper/runs": {
            "post": {
                "operationId": "runs-sync-goat255-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/goat255~reddit-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-goat255-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",
                "properties": {
                    "subreddits": {
                        "title": "Subreddits (feed mode)",
                        "type": "array",
                        "description": "Subreddit names to pull posts from. With or without the r/ prefix. Example: python, r/example.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "postUrls": {
                        "title": "Post URLs or IDs (comment mode)",
                        "type": "array",
                        "description": "Specific post links or IDs to fetch with their comments. Example: https://www.reddit.com/r/example/comments/abc123/title/ or abc123.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "usernames": {
                        "title": "Usernames (user mode)",
                        "type": "array",
                        "description": "Reddit usernames to pull recent posts and comments from. With or without the u/ prefix. Example: example_user, u/example_user.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "searchQueries": {
                        "title": "Search queries (search mode)",
                        "type": "array",
                        "description": "Keyword searches to run across Reddit. Example: machine learning, open source.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "sort": {
                        "title": "Sort",
                        "enum": [
                            "hot",
                            "new",
                            "top",
                            "rising"
                        ],
                        "type": "string",
                        "description": "Sort order for subreddit feeds and search. hot, new, top, or rising.",
                        "default": "hot"
                    },
                    "time": {
                        "title": "Time range",
                        "enum": [
                            "hour",
                            "day",
                            "week",
                            "month",
                            "year",
                            "all"
                        ],
                        "type": "string",
                        "description": "Time window for top sort and search. hour, day, week, month, year, or all.",
                        "default": "day"
                    },
                    "maxItemsPerSource": {
                        "title": "Max items per source",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "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.",
                        "default": 100
                    },
                    "includeComments": {
                        "title": "Include comments for feed and search posts",
                        "type": "boolean",
                        "description": "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.",
                        "default": false
                    },
                    "concurrency": {
                        "title": "Concurrency",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "How many sources to process in parallel. Higher is faster but puts more load on proxies.",
                        "default": 5
                    },
                    "proxyConfig": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify proxy. RESIDENTIAL is the default and recommended option for the most reliable results.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
