# REDDIT USERNAMES from Subreddit - Scraper (`stifl/reddit-username-from-subreddit`) Actor

✅Scrape/Extract the active Members of a subreddit! Enter a subreddit name and the amount of users you need, and our tool provides a list of active users for your desired subreddit. Ideal for marketers, researchers, and Reddit fans. No technical skills are needed, just insights at a click!✅

- **URL**: https://apify.com/stifl/reddit-username-from-subreddit.md
- **Developed by:** [Stifl](https://apify.com/stifl) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 200 total users, 0 monthly users, 100.0% runs succeeded, 4 bookmarks
- **User rating**: 3.00 out of 5 stars

## Pricing

$10.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.

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 Username from Subreddit Scraper 🚀

Discover active users in various subreddits with our Reddit Username Scraper. This tool/API is perfect for marketers, researchers, enthusiasts, and anyone looking to uncover active users in specific subreddits.

### Features 🌟

- **Python-Powered Scraping:** Leverage Python and Beautiful Soup for efficient HTML parsing and accurate data extraction.
- **Customizable Input:** Specify your target subreddit and user limit through a user-friendly input schema. (Note: Subreddit must be public!)
- **Structured Data Storage:** Results are neatly organized in Apify datasets for easy access and analysis.
- **Non-Developer Friendly:** Designed for simplicity, enabling users without a technical background to gain insights effortlessly.

### How It Works ⚙️

1. **Input:** Provide the subreddit of interest and the number of users to scrape.
2. **Scraping:** The scraper dives into the specified subreddit to gather user data through various methods.

### Getting Started 🚀

1. **Set Up:** Go to the actor's page on Apify and fill in the input fields with your target subreddit (`subreddit`) and desired user limit (`user_limit`).
2. **Launch:** Press the *Run* button to start the scraping process tailored to your needs.
3. **Discover:** Access the dataset post-scraping to explore the insights gathered from the community's interactions.

### Ideal for Various Users 🎯

Whether you're a marketer seeking audience insights, a researcher studying social interactions, or a Reddit enthusiast curious about your favorite subreddit's community, this scraper offers the insights you need. It's also great for mass DM campaigns or general analytics purposes!

Embark on your journey to explore Reddit communities and unveil the hidden insights with our user-friendly, efficient Reddit Username Scraper today!

# Actor input Schema

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

The subreddit name of the community you want to scrape. For example, 'funny' or 'AskReddit'.

## `user_limit` (type: `integer`):

The maximum number of users to scrape from the subreddit. 1 User = 1 Result

## Actor input object example

```json
{
  "subreddit": "AskReddit",
  "user_limit": 1
}
```

# 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": "AskReddit",
    "user_limit": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("stifl/reddit-username-from-subreddit").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": "AskReddit",
    "user_limit": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("stifl/reddit-username-from-subreddit").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": "AskReddit",
  "user_limit": 1
}' |
apify call stifl/reddit-username-from-subreddit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,stifl/reddit-username-from-subreddit"
        }
    }
}
```

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/J3zLThhaQkq0lgFEs/builds/LaVhejlu5RSf3JTQv/openapi.json
