# Reddit Subreddit Users Scraper (`w3crawler/reddit-subreddit-users-scraper`) Actor

Collect unique public post and comment authors from one Reddit subreddit, with optional public profile enrichment and activity counts.

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

## Pricing

from $2.99 / 1,000 subreddit users

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

Discover unique public authors active in one Reddit community. The Actor scans a bounded set of subreddit posts, optionally collects public comment authors, and can enrich each discovered username with public profile metadata.

### What this Actor does

- Collects unique post authors from a public subreddit listing.
- Optionally scans public comments and bounded replies for additional authors.
- Counts each user's observed posts and comments in the requested community.
- Optionally enriches users from Reddit's public profile JSON representation.
- Stops at login, CAPTCHA, WAF, geofence, device, or rate-limit controls without bypassing them.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `subreddit` | string | required | Community name without `r/`; 2–21 letters, numbers, or underscores. |
| `sortBy` | string | `new` | `new`, `hot`, `top`, `rising`, or `controversial`. |
| `topTime` | string | `week` | Time window for `top` or `controversial`. |
| `maxPosts` | integer | `50` | Number of posts to scan, from 1 to 500. |
| `includeCommentAuthors` | boolean | `true` | Scan bounded public comment data for more usernames. |
| `fetchProfileDetails` | boolean | `false` | Request public profile metadata for each discovered user. |
| `headless` | boolean | `true` | Run Chromium without a visible window. |
| `proxyConfiguration` | object | Apify Proxy | Standard Apify proxy configuration. A proxy does not bypass access controls. |

Unknown fields and invalid values fail before crawling.

#### Example input

```json
{
  "subreddit": "javascript",
  "sortBy": "new",
  "maxPosts": 25,
  "includeCommentAuthors": true,
  "fetchProfileDetails": false,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

### Dataset output

Every dataset item is a real user record with `recordType: "subreddit_user"`. Required fields include username, profile URL, community, observed post/comment counts, source listing URL, and extraction time. `collectionScope` is always `observed_contributors`: this is a bounded set of authors seen in fetched public posts/comments, not a complete subscriber, member, or community-user list. Optional profile fields include karma, account age, moderator/employee flags, bio, and avatar.

```json
{
  "recordType": "subreddit_user",
  "username": "example_user",
  "profileUrl": "https://www.reddit.com/user/example_user/",
  "subreddit": "javascript",
  "collectionScope": "observed_contributors",
  "postsInSubreddit": 1,
  "commentsInSubreddit": 2,
  "firstSeenPostTitle": "Example discussion",
  "sourceListingUrl": "https://www.reddit.com/r/javascript/new/?sort=new&t=week",
  "sortBy": "new",
  "topTime": "week",
  "extractionMethod": "reddit-subreddit-users-listing-rendered-dom",
  "scrapedAt": "2026-01-02T03:04:05.000Z"
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

The default key-value store contains `OUTPUT`, an explicit success summary or no-data diagnostic. If no usable users are available, the default dataset contains one four-field diagnostic record; diagnostics are never stored as successful user rows.

### Limits and cost control

The listing crawler uses one request at a time and no blocked-request retries. Comment detail work is limited to three concurrent tabs, and profile enrichment runs sequentially. Reduce `maxPosts`, disable comment authors, or disable profile enrichment to lower compute and proxy use. Dataset items may trigger the configured pay-per-event charge.

### Public-data and responsible use

This Actor reads only publicly available Reddit web data. It does not log in, alter browser identity, defeat challenges, use protected sessions, or evade access controls. Availability varies by Reddit, network, region, and proxy tier. Usernames and profiles can be personal data; follow Reddit's terms and applicable privacy and data-protection requirements.

### Local development

```bash
npm test
apify validate-schema
apify run --purge
```

The validator rejects incomplete records, diagnostic dataset rows, and empty extractions.

# Changelog

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

# Actor input Schema

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

Name of the subreddit to extract users from (without r/)

## `sortBy` (type: `string`):

How to sort posts when collecting users

## `topTime` (type: `string`):

Time period when sortBy is 'top' or 'controversial'

## `maxPosts` (type: `integer`):

How many posts to scan for user collection (more posts = more unique users found)

## `includeCommentAuthors` (type: `boolean`):

Also extract comment authors from each post (significantly increases users found but takes longer)

## `fetchProfileDetails` (type: `boolean`):

Fetch full profile data (karma, bio, account age, etc.) for each unique user. Slower but richer data.

## `headless` (type: `boolean`):

Run browser in headless mode

## `proxyConfiguration` (type: `object`):

Optional standard Apify proxy settings. Proxy availability does not bypass Reddit access controls.

## Actor input object example

```json
{
  "subreddit": "javascript",
  "sortBy": "new",
  "topTime": "week",
  "maxPosts": 50,
  "includeCommentAuthors": true,
  "fetchProfileDetails": false,
  "headless": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Default dataset containing one record per unique public user.

## `runSummary` (type: `string`):

Completion summary or diagnostic for subreddit scope, enrichment settings, saved users, and public-access status.

# 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": "javascript",
    "maxPosts": 50,
    "includeCommentAuthors": true,
    "fetchProfileDetails": false,
    "headless": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/reddit-subreddit-users-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": "javascript",
    "maxPosts": 50,
    "includeCommentAuthors": True,
    "fetchProfileDetails": False,
    "headless": True,
}

# Run the Actor and wait for it to finish
run = client.actor("w3crawler/reddit-subreddit-users-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "subreddit": "javascript",
  "maxPosts": 50,
  "includeCommentAuthors": true,
  "fetchProfileDetails": false,
  "headless": true
}' |
apify call w3crawler/reddit-subreddit-users-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,w3crawler/reddit-subreddit-users-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/yYLBvAWTGEyZhbbnm/builds/tSU0kEcQa7OQpEsRw/openapi.json
