# Reddit User Comment History Scraper (`thenetaji/reddit-user-comment-history-scraper`) Actor

Reads a Reddit account's comment history from the feed Reddit dedicates to it, and saves one row per comment with the body, score, community, creation time, and address. Long histories page automatically, a run resumes where an earlier one stopped, and no comment is returned twice.

- **URL**: https://apify.com/thenetaji/reddit-user-comment-history-scraper.md
- **Developed by:** [The Netaji](https://apify.com/thenetaji) (community)
- **Categories:** Social media, Marketing, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.70 / 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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 User Comment History Scraper

The Actor reads a Reddit account's comment history and saves a structured record for every comment
it returns, including the body, the score, the community it was made in, the time it was made, and
its address. It reads the feed Reddit dedicates to an account's comments rather than filtering the
mixed activity feed, which is what makes a short result here meaningful. No Reddit account,
application, or API credential is involved.

### Accepted input

| Field | Required | Default | Notes |
| --- | --- | --- | --- |
| `username` | yes | — | A bare name (`spez`), a prefixed name (`u/spez`), or a copied reddit.com profile link. |
| `maxItems` | no | `100` | Total comments to save across the whole run. `0` removes the bound. |
| `after` | no | — | A continuation point from an earlier run, or the fullname of a comment already collected. |

```json
{
  "username": "spez",
  "maxItems": 200
}
```

### Response fields

Each saved record carries `kind`, `id`, `fullname`, `subreddit`, `author`, `author_icon`, `body`,
`score`, `created_at`, `permalink`, `award_count`, `post_fullname`, `parent_fullname`, `depth`,
`position`, `parent_positions`, `is_deleted`, and `is_collapsed`.

```json
{
  "kind": "profile_comment",
  "id": "p44qdpd",
  "fullname": "t1_p44qdpd",
  "subreddit": "AskReddit",
  "body": "This is the comment text.",
  "score": 42,
  "created_at": "2026-08-14T09:41:07.000Z",
  "permalink": "/r/AskReddit/comments/1abcdef/example_title/p44qdpd/",
  "depth": 0,
  "parent_fullname": null
}
```

`permalink` is the path Reddit states for the comment, beginning with `/r/`, and it ends in the
comment's own id. `fullname` is the id carrying Reddit's `t1_` prefix for a comment, which is the
form the `after` field accepts.

### A profile shape, not a tree shape

These records describe comments as an account's history lists them, and an account's comments span
many posts. There is no single thread for them to sit in, so `depth` is `0` on every row and
`parent_fullname` is `null` on every row — by construction rather than because every comment
happened to be top level. The columns are present because the same shape is shared with the tree
reader, and they are populated there.

Reading the thread around one of these comments is a separate job. Its `permalink` names the post,
and the **Reddit Comment Tree Scraper** returns that post's comments with the depth and parent
Reddit states for each one.

### Pagination, limits, and resuming

`maxItems` bounds comments saved, not requests made. Paging is settled before a response is
returned, so a run asking for 200 comments is answered with up to 200 rather than a first page and a
stack of follow-up work. Setting `maxItems` to `0` removes the bound and the run continues until the
feed reports that it has ended.

This is the best-behaved listing in the family, and the practical consequence is that a short result
means something. A deep read of it returned two hundred comments with two hundred distinct ids and
no repeats, and two different starting points shared none of their results, so it pages rather than
samples. A run that comes back below `maxItems` has genuinely reached the end of what the account
has commented — not a partial read, and not a page that happened to be short. The popular listing
and the mixed activity feed cannot make that claim, which is why comments are read from here.

A run that stops with more available writes its continuation point into the run log, and passing
that value as `after` in a later run continues from that comment. The value is derived from the last
comment saved rather than being a session token, so it does not expire and a long history can be
collected in scheduled instalments.

### Deleted comments and absent fields

A comment Reddit reports as deleted keeps its place in the history and is saved rather than dropped,
with `is_deleted` set, `body` `null`, and no author. That is what Reddit renders, and removing the
row would leave a gap in a history that is otherwise complete.

Fields absent from the feed are returned as `null` rather than omitted, so the column set is the
same in every record. `award_count` is among the fields this particular feed does not state, and is
`null` throughout.

### Failures and partial results

An unusable username is rejected before any request is made, with a message naming what was
received. A request that fails ends the run; comments already saved remain in the dataset and the
run log holds the continuation point, so a failed long run is continued rather than restarted.

### Cost

Charging is per comment saved to the dataset, plus the platform's one-off Actor start event. A run
that saves nothing is charged for nothing beyond that start event, so `maxItems` is the direct
control on what a run costs.

### Related Actors

- **Reddit User Activity Scraper** — the same account's posts and comments together, in one feed.
- **Reddit Account Profile Scraper** — karma, cake day, and description for the same account.
- **Reddit Comment Tree Scraper** — the thread around a comment found here.

### Support

Questions, bug reports, and requests for a field that is not here yet: thenetaji@proton.me.

# Actor input Schema

## `username` (type: `string`):

The account to read. A bare name (spez), a prefixed name (u/spez), or a pasted reddit.com/user/ URL are all accepted; a URL is reduced to the account it names.

## `maxItems` (type: `integer`):

The maximum number of records to save. A value of 0 removes the bound and the run continues until the source reports it has no more to give.

## `after` (type: `string`):

A continuation point from an earlier run: the value the run log prints when it stops, or the id of a record already collected. The feed continues after that record instead of starting at the top. Leave it empty to start at the top.

## Actor input object example

```json
{
  "username": "spez",
  "maxItems": 25,
  "after": "t3_1abcdef"
}
```

# Actor output Schema

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

All records scraped by this run

# 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 = {
    "username": "spez",
    "maxItems": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenetaji/reddit-user-comment-history-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 = {
    "username": "spez",
    "maxItems": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("thenetaji/reddit-user-comment-history-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 '{
  "username": "spez",
  "maxItems": 25
}' |
apify call thenetaji/reddit-user-comment-history-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thenetaji/reddit-user-comment-history-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/LgfCMOm1zpS19dlfz/builds/NjXJfIamRLdw35z6G/openapi.json
