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

Scrape Reddit posts and comments from subreddits, users, and search: titles, text, scores, comment threads, flairs, and media links. No login or API key.

- **URL**: https://apify.com/donjuan_mime/reddit-scraper.md
- **Developed by:** [Donjuan](https://apify.com/donjuan_mime) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 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: posts and comments from subreddits, users, and search

Reddit Scraper collects public Reddit posts from any subreddit, user profile, or search query, and, if you want them, the full comment threads under each post. For every post you get the title, text, author, score, upvote ratio, comment count, flair, post type, media link, and thumbnail. For every comment you get the text, author, score, time, and its place in the thread.

You don't need a Reddit account, an API key, or any code. Add subreddits or search terms, press **Start**, and download the results as JSON, CSV, Excel, XML, or HTML.

### What can you do with Reddit data?

- **Research a market.** See what people ask, complain about, and recommend in the subreddits your customers read.
- **Track a brand or product.** Search for your brand and your competitors on a schedule and follow what Reddit says about them.
- **Find content ideas.** Pull the top posts of a subreddit for the week or the year and see which topics and formats get upvoted.
- **Analyze sentiment.** Post and comment text comes clean, one line per paragraph, ready for sentiment or topic analysis.
- **Study discussions.** Every comment carries its parent's ID and its depth, so you can rebuild whole threads.
- **Build datasets.** Export thousands of posts and comments for research or for training and evaluating models.

### What data does Reddit Scraper extract?

| Item | Fields |
|---|---|
| Post | ID, Reddit URL, link (image, video, or linked page), subreddit, title, text, author, creation time, score, upvote ratio, comment count, flair, post type, NSFW, spoiler, video, and pinned flags, thumbnail, domain |
| Comment | ID, Reddit URL, post ID and title, parent comment ID, depth in the thread, author, text, score, creation time |

Posts and comments are separate rows in one dataset. The `type` field says which is which.

### How to scrape Reddit

1. Open the actor and go to the **Input** tab.
2. Add subreddits (`golang` or `r/golang`), search terms, or Reddit links.
3. Pick a sort and time range, set **Posts per source**, and turn on **Include comments** if you need them.
4. Press **Start**. When the run finishes, open the **Output** tab, or press **Export** to download the data.

### Input

| Field | Type | Description |
|---|---|---|
| `subreddits` | array of strings | Subreddit names, with or without `r/`. |
| `searchQueries` | array of strings | Terms to search Reddit posts for. |
| `startUrls` | array | Reddit links. Accepts subreddits (including `/top/?t=week`-style links), user profiles, single posts, and search pages. |
| `sort` | string | `hot`, `new`, `top`, `rising`, or `controversial` for subreddits and users. Search takes `relevance`, `hot`, `top`, `new`, or `comments`, and uses `relevance` for anything else. |
| `time` | string | `hour`, `day`, `week`, `month`, `year`, or `all`. Applies to the `top` and `controversial` sorts and to search. |
| `maxPostsPerSource` | integer | The maximum number of posts from each subreddit, user, search query, or start URL. |
| `includeComments` | boolean | Also scrape the comments and replies of every post. |
| `maxCommentsPerPost` | integer | The maximum number of comments and replies per post. |
| `skipNsfw` | boolean | Leave out posts marked NSFW. |
| `proxyCountryCode` | string | A two-letter country code such as `US` to use Apify residential proxy in that country. `None` uses Apify datacenter proxy. |

#### Input example

```json
{
  "subreddits": ["golang", "r/pics"],
  "searchQueries": ["apify scraper"],
  "startUrls": [{ "url": "https://www.reddit.com/r/AskReddit/top/?t=week" }],
  "sort": "new",
  "time": "week",
  "maxPostsPerSource": 100,
  "includeComments": true,
  "maxCommentsPerPost": 50,
  "skipNsfw": true,
  "proxyCountryCode": "None"
}
```

### Output

#### Post example

A real post from `r/golang`:

```json
{
  "type": "post",
  "id": "1x8hzzt",
  "url": "https://www.reddit.com/r/golang/comments/1x8hzzt/go_golang_publisher_attestation_and_signature/",
  "permalink": "https://www.reddit.com/r/golang/comments/1x8hzzt/go_golang_publisher_attestation_and_signature/",
  "subreddit": "golang",
  "title": "Go (Golang) Publisher Attestation and Signature Verification",
  "text": "What is the recommended approach for verifying publisher attestations and signatures for Go (Golang) packages?",
  "author": "No-Strength-2889",
  "createdTimeISO": "2026-10-17T18:50:16.695Z",
  "score": 1,
  "upvoteRatio": 0.6,
  "numComments": 4,
  "flair": "help",
  "postType": "text",
  "isNsfw": false,
  "isSpoiler": false,
  "isVideo": false,
  "isStickied": false,
  "thumbnail": "",
  "domain": "self.golang",
  "input": "r/golang"
}
```

#### Comment example

A real reply from the same subreddit:

```json
{
  "type": "comment",
  "id": "phhvana",
  "postId": "1x7oe1w",
  "parentId": "ph8xw5m",
  "depth": 1,
  "author": "MizmoDLX",
  "text": "I know it's more trendy to hate on Java respectively Java devs, but bad useless comments like this one have nothing to do with the language.",
  "score": 1,
  "createdTimeISO": "2026-10-18T13:48:19.243Z",
  "permalink": "https://www.reddit.com/r/golang/comments/1x7oe1w/comment/phhvana/",
  "subreddit": "golang",
  "postTitle": "Estonia's election system is mostly programmed in Go. I came across the open source github repo and wanted to share.",
  "input": "r/golang"
}
```

#### Output fields

| Field | Description |
|---|---|
| `type` | `post` or `comment`. |
| `id` | Reddit ID without the `t3_` or `t1_` prefix. |
| `url` | Posts: where the post points. An image, a video, a linked article, or the post itself for text posts. |
| `permalink` | The post or comment on Reddit. |
| `subreddit` | Subreddit name without `r/`. |
| `title` | Posts: the title. |
| `text` | The post body or the comment, one line per paragraph. |
| `author` | Username without `u/`. |
| `createdTimeISO` | Creation time in UTC. |
| `score` | Score as Reddit shows it. |
| `upvoteRatio` | Posts: the share of upvotes, from 0 to 1. |
| `numComments` | Posts: the comment count Reddit shows. |
| `flair` | Posts: flair text. |
| `postType` | Posts: `text`, `link`, `image`, `gallery`, `video`, `gif`, `multi_media`, or `crosspost`. |
| `isNsfw`, `isSpoiler`, `isVideo`, `isStickied` | Post flags. |
| `thumbnail` | Posts: preview image. |
| `domain` | Posts: domain of the link, or `self.<subreddit>` for text posts. |
| `postId`, `postTitle` | Comments: the post the comment belongs to. |
| `parentId` | Comments: the comment this one replies to. Empty for top-level comments. |
| `depth` | Comments: 0 for top-level comments, 1 for replies to them, and so on. |
| `input` | The subreddit, search term, or URL that led to the item. |

The **Output** tab has two tables: **Posts** and **Comments**. Both show every row, so filter on `type` when you work with the export in a spreadsheet.

### What search results include

Reddit shows a captcha instead of a post's page after a few dozen page visits from one IP. To keep search fast and reliable, the actor takes search results from the results pages themselves. Search results include the ID, title, subreddit, author, creation time, score, comment count, thumbnail, and NSFW and spoiler flags. They leave out the post text, flair, upvote ratio, post type, domain, and link. Subreddit and user posts include everything.

The same applies to single post links in `startUrls`: when Reddit shows a captcha instead of the post, you get the post's ID, subreddit, and Reddit URL, and its comments still come in full.

### How many posts can I get?

The actor sets no limit of its own. Reddit's listings usually end at about 1,000 posts per sort and time range, as on the site. To collect more from one subreddit, combine sorts and time ranges, for example `top` for `week`, `month`, and `year`.

Very large threads load their comments in batches. The actor follows every "more replies" and "more comments" link until it reaches `maxCommentsPerPost`.

### How fast is it?

The actor reads Reddit's pages over plain HTTP, without a browser. In our tests, 100 posts from a subreddit took about 5 seconds, and 150 comments from a large thread took about 7 seconds.

### How much does it cost?

You pay per item in the dataset: $0.50 per 1,000 posts and comments. A run with 100 posts and 50 comments under each post makes 5,100 items and costs $2.55. Without comments, the same 100 posts cost $0.05.

### Export and integrations

The results go into an Apify dataset. From there you can:

- download them as JSON, CSV, Excel, XML, HTML, or RSS from the **Output** tab;
- send them to Google Sheets, Slack, Zapier, Make, and other tools through Apify integrations;
- schedule runs, for example every morning, to track a subreddit or a search over time;
- start runs and read the results from your own code through the Apify API.

```bash
curl -X POST "https://api.apify.com/v2/acts/<username>~reddit-scraper/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"subreddits": ["golang"], "sort": "top", "time": "week", "maxPostsPerSource": 25}'
```

### FAQ

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

No. The actor reads the same public pages a logged-out visitor sees.

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

No. The actor sees what a logged-out visitor sees.

#### Why do search results have no post text?

Reddit puts a captcha in front of post pages after a few dozen visits from one IP, so the actor takes search results from the results pages, which show no post text. Scrape the subreddit instead when you need the text.

#### Why are some comments missing?

Reddit hides comments that were removed or deleted, and collapses some low-score ones. The actor collects what a logged-out visitor can open.

#### Is it legal to scrape Reddit?

The actor collects only public data that anyone can see without logging in. Public posts can still contain personal data, so make sure you have a legitimate reason to collect it and follow the GDPR and other laws that apply to you. If you're not sure, ask a lawyer.

### Disclaimer

This actor is provided as is, without warranty. You're responsible for how you use it and for following Reddit's terms of service and the laws that apply to you. Reddit isn't affiliated with this actor.

# Actor input Schema

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

Subreddit names, with or without r/.

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

Search Reddit posts for these terms. Search results carry less data than subreddit posts; see the README.

## `startUrls` (type: `array`):

Reddit links: a subreddit (https://www.reddit.com/r/golang/top/?t=week), a user (https://www.reddit.com/user/spez/), a post, or a search page.

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

Order of subreddit and user posts. Search uses relevance, hot, top, new, or comments; other values fall back to relevance.

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

Time range for the Top and Controversial sorts and for search.

## `maxPostsPerSource` (type: `integer`):

The maximum number of posts from each subreddit, user, search query, or start URL.

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

Also scrape each post's comments and replies, one dataset item per comment.

## `maxCommentsPerPost` (type: `integer`):

The maximum number of comments and replies per post.

## `skipNsfw` (type: `boolean`):

Leave out posts marked NSFW.

## `proxyCountryCode` (type: `string`):

Two-letter country code (US, DE, ...) to use Apify residential proxy in that country. "None" uses Apify datacenter proxy.

## Actor input object example

```json
{
  "subreddits": [
    "golang"
  ],
  "sort": "hot",
  "time": "week",
  "maxPostsPerSource": 50,
  "includeComments": false,
  "maxCommentsPerPost": 100,
  "skipNsfw": false,
  "proxyCountryCode": "None"
}
```

# Actor output Schema

## `results` (type: `string`):

One item per post and, when comments are on, one item per comment. The type field tells them apart.

# 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": [
        "golang"
    ],
    "maxPostsPerSource": 50,
    "maxCommentsPerPost": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("donjuan_mime/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": ["golang"],
    "maxPostsPerSource": 50,
    "maxCommentsPerPost": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("donjuan_mime/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 '{
  "subreddits": [
    "golang"
  ],
  "maxPostsPerSource": 50,
  "maxCommentsPerPost": 100
}' |
apify call donjuan_mime/reddit-scraper --silent --output-dataset

```

## MCP server setup

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