# Reddit User Activity Scraper - Posts and Comments (`thenetaji/reddit-user-activity-scraper`) Actor

Reads a Reddit account's public activity feed, which carries posts and comments interleaved, and saves one row per record stating which kind it is. The feed can be narrowed to posts only or comments only. Long histories page automatically and a run resumes where an earlier one stopped.

- **URL**: https://apify.com/thenetaji/reddit-user-activity-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 $2.13 / 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 Activity Scraper

The Actor reads a Reddit account's public activity feed and saves a structured record for every post
and every comment in it. Reddit publishes that activity as one interleaved stream rather than as two
lists, and this Actor returns it the same way: each saved row states in `kind` whether it is a post
or a comment. The feed can be narrowed to one of the two, with the consequence described below. 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. |
| `include` | no | `all` | `all`, `posts`, or `comments`. See the section below before choosing anything but `all`. |
| `maxItems` | no | `100` | Total records to save across the whole run. `0` removes the bound. |
| `after` | no | — | A continuation point from an earlier run, or the fullname of a record already collected. |

```json
{
  "username": "u/spez",
  "include": "all",
  "maxItems": 100
}
```

### Response fields

The saved columns are the union of the two record shapes, and each row fills in the ones its kind
uses.

A **post** row carries `kind`, `id`, `fullname`, `permalink`, `url`, `title`, `subreddit`,
`subreddit_prefixed`, `subreddit_id`, `author`, `author_id`, `author_icon`, `created_at`, `score`,
`upvote_ratio`, `comment_count`, `award_count`, `domain`, `content_url`, `post_type`, `flair`,
`flair_url`, `thumbnail`, `media`, `text`, `nsfw`, `spoiler`, `locked`, and `archived`.

A **comment** row carries `kind`, `id`, `fullname`, `subreddit`, `body`, `score`, `created_at`,
`permalink`, and the tree columns `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
}
```

Two of those columns behave differently here from how they behave elsewhere, and the difference is a
property of the feed rather than of the data. `depth` is `0` on every comment row and
`parent_fullname` is `null`, because this feed spans many posts and there is no single tree for a
comment to sit at a depth in. The **Reddit Comment Tree Scraper** returns those values populated,
because it reads one tree.

### Choosing `include`, and what it costs

Reddit serves one feed per account with posts and comments together and offers no way to ask it for
only one of them. `posts` and `comments` are therefore applied to the feed after it has been read,
and the consequence is visible rather than hidden: an active account's feed runs on the order of one
post to ten comments, so a `posts` run reads a large stretch of feed for each row it saves and can
finish below `maxItems` while the account still has more to give.

The run log distinguishes the two endings — the account running out, and the reading stopping. A run
whose requests stop returning matching records while the feed continues is ended deliberately rather
than allowed to read indefinitely, and the log says so and prints the continuation point so the run
can be picked up later.

For a comment history specifically, the **Reddit User Comment History Scraper** reads a different
feed that Reddit dedicates to comments. It returns comments only, without filtering, and does not
have this behaviour at all. Prefer it over `include: "comments"` here.

### Pagination, limits, and resuming

`maxItems` bounds records saved, not requests made. Setting it to `0` removes the bound and the run
continues until the feed reports that it has ended.

A run that stops with more available writes its continuation point into the run log, and passing
that value as `after` continues from that record. The continuation point is the last record saved,
whichever kind it was, and that detail is load-bearing: this feed's position is the last item, and
on an active account the last item is usually a comment. Supplying a post's id when the feed expects
an item's fullname does not fail — it re-serves the same stretch of feed indefinitely. Using the
value the run log prints avoids that entirely, and the `after` field accepts either prefix for
callers building one by hand.

### Fields that are frequently absent

`media`, `text`, and `nsfw` are empty on most post rows for ordinary reasons: `text` is the body of a
self post and link, image, and video posts have none; `media` is populated only where the feed
carries the attachment. `body` is `null` on a comment Reddit reports as deleted, which keeps its
place in the feed and is saved with `is_deleted` set rather than dropped.

`nsfw` has three states. `true` and `false` are Reddit's report; `null` means the feed said nothing
either way, and is an absence of information rather than a statement that the record is safe for
work. No NSFW filter is offered, because filtering on a field that is frequently unknown produces a
set that looks filtered without being filtered.

### 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; records already saved remain in the dataset and the
continuation point is in the log. Fields absent from the feed are returned as `null` rather than
omitted, so the column set is the same in every record.

### Cost

Charging is per record saved to the dataset, plus the platform's one-off Actor start event. A
filtered run is charged for the rows it saves and not for the feed it read past to find them, so
`include: "posts"` costs the same per saved post as `include: "all"` does.

### Related Actors

- **Reddit User Comment History Scraper** — comments only, from the feed Reddit dedicates to them.
- **Reddit Account Profile Scraper** — karma, cake day, and description for the same account.
- **Reddit Comment Tree Scraper** — a full thread, with the depth and parent this feed cannot state.

### 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.

## `include` (type: `string`):

Which half of the account's activity to keep. Reddit serves posts and comments as one interleaved feed with no filter of its own, so Posts only and Comments only are applied after the feed has been read: those runs read more of the feed per saved record and can finish below Max results even on an active account.

## `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",
  "include": "all",
  "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-activity-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-activity-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-activity-scraper --silent --output-dataset

```

## MCP server setup

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