# Reddit User Comments Scraper (`scrapingdino/reddit-user-comments-scraper`) Actor

Export a Reddit user’s public comment history with sort/time controls — structured rows for reputation, research, and moderation workflows. $0.50 per 1,000 comments.

- **URL**: https://apify.com/scrapingdino/reddit-user-comments-scraper.md
- **Developed by:** [Scraping Dino](https://apify.com/scrapingdino) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 comments

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/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 User Comments Scraper - Export Comment History by Username

### Overview

The **Reddit User Comments Scraper** collects comments written by one or more Reddit users. Choose recent comments (new/hot sort) or top comments over a time window, set a per-user limit, and export structured JSON for analysis.

Ideal for reputation research, influencer vetting, moderation intelligence, and NLP datasets focused on a person’s public commentary. Accepts usernames with or without `u/` prefixes and returns **clean, structured JSON** per comment.

### Features

- Batch multiple usernames
- Modes: `comments` (listing) or `top`
- Sort for comments mode: `new` or `hot`
- Time range for top mode: `hour` → `all`
- Per-user `maxResults` (1–500, default 50)
- Structured fields: author, subreddit, score, body, permalink, timestamps
- Concurrent username workers
- Isolated errors per user so batches keep going

### Use Cases

- **Brand monitoring** — Track what key accounts say about your category
- **Recruitment** — Review public communication style
- **Competitor analysis** — Monitor competitor employees or advocates
- **Academic research** — Build author-centric comment corpora
- **AI training datasets** — Sample authentic conversational text
- **Sales intelligence** — Understand prospect interests from comment history
- **Content research** — Find expert takes from high-karma commenters
- **Data analytics** — Measure comment frequency and score over time

### Input

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `usernames` | array of strings | **Yes** | — | Reddit usernames (one per line). |
| `mode` | string | No | `"comments"` | `comments` or `top`. |
| `sort` | string | No | `"new"` | When mode is `comments`: `new` or `hot`. |
| `time` | string | No | `"all"` | When mode is `top`: `hour`, `day`, `week`, `month`, `year`, `all`. |
| `maxResults` | integer | No | `50` | Max comments per user (1–500). |

**How parameters affect the run:** `mode` switches listing endpoints. `sort` applies to the comments listing; `time` applies to top comments. Higher `maxResults` deepens pagination.

#### Example input

```json
{
  "usernames": ["spez", "kn0thing"],
  "mode": "top",
  "time": "year",
  "maxResults": 100
}
```

### Output

| Field | Type | Description |
|---|---|---|
| `username` | string | Target username |
| `mode` | string | Mode used |
| `id` | string | null | Comment ID |
| `name` | string | null | Fullname |
| `kind` | string | null | `t1` |
| `title` | string | null | Parent post title when present |
| `author` | string | null | Author |
| `subreddit` | string | null | Subreddit |
| `score` | number | null | Score |
| `createdUtc` | number | string | null | Created |
| `permalink` | string | null | Permalink |
| `url` | string | null | URL if present |
| `body` | string | null | Comment body excerpt |

### Example Output

```json
{
  "username": "spez",
  "mode": "top",
  "time": "year",
  "id": "lo12xyz",
  "name": "t1_lo12xyz",
  "kind": "t1",
  "title": "Why is the site so slow today?",
  "author": "spez",
  "subreddit": "announcements",
  "score": 15200,
  "createdUtc": 1712000000,
  "permalink": "https://www.reddit.com/r/announcements/comments/.../lo12xyz/",
  "url": null,
  "body": "We're aware of the latency spike and rolling a fix now."
}
```

### Related Scrapers

- **Reddit User Posts Scraper** — Posts instead of comments
- **Reddit User Scraper** — Combined profile, stats, posts, and comments
- **Reddit Profile Scraper** — Profile/karma only
- **Reddit Comment Tree Scraper** — Full trees for specific posts

# Actor input Schema

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

Reddit usernames to scrape comments from. Enter one per line.

## `mode` (type: `string`):

Which comment listing to fetch: comments or top.

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

Sort order when mode is comments: new or hot.

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

Time range when mode is top.

## `maxResults` (type: `integer`):

Maximum number of comments to fetch per user.

## Actor input object example

```json
{
  "usernames": [
    "spez"
  ],
  "mode": "comments",
  "sort": "new",
  "time": "all",
  "maxResults": 50
}
```

# Actor output Schema

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

Default dataset items produced by this Actor.

# 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 = {
    "usernames": [
        "spez"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapingdino/reddit-user-comments-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 = { "usernames": ["spez"] }

# Run the Actor and wait for it to finish
run = client.actor("scrapingdino/reddit-user-comments-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 '{
  "usernames": [
    "spez"
  ]
}' |
apify call scrapingdino/reddit-user-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapingdino/reddit-user-comments-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/7YmhSkjrvdDTGx0hQ/builds/KpzgGFYwYu5okTa3Q/openapi.json
