# Reddit Activity Stats & Posting Trends (`xyrelith-data/reddit-activity-stats`) Actor

Turn Reddit's public archive history into chart-ready statistics: post and comment timelines for subreddits, users or all of Reddit, score sums, contributor leaderboards, author footprints and community profiles. No Reddit login, API key, cookie or proxy.

- **URL**: https://apify.com/xyrelith-data/reddit-activity-stats.md
- **Developed by:** [Xyrelith Data](https://apify.com/xyrelith-data) (community)
- **Categories:** Social media, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 Activity Stats & Posting Trends

Reddit's own search and listings stop at a few hundred items, and its anonymous JSON endpoints no longer answer. This actor reads the public **Arctic Shift** archive instead and turns years of Reddit history into numbers you can chart: how often a community posts, whether it is growing or fading, the score and comment volume behind each period, who keeps the place running, where an author spends their time, and what a community looks like today.

Every count is a real archived count. No estimation, no placeholders, no Reddit login, API key, cookie or proxy.

### Four ways to look at Reddit

| Mode | Question it answers | Example |
|---|---|---|
| **Activity timeline** | How many posts and comments did this subreddit, user or all of Reddit produce each day, week, month or year? | r/python monthly post counts for the last five years |
| **Top contributors** | Who posted or commented the most in a community over a date range? | The 50 busiest authors in r/webdev in 2025 |
| **Author footprint** | Which communities does a username actually spend time in, and when were they first and last active? | A marketer's top subreddits with post and comment splits |
| **Community profile** | How big is a subreddit, how old is it, how much history does the archive hold, and what are its rules? | r/dataisbeautiful subscriber count, archived totals and rules |

### Quick start

Pick **Activity timeline**, enter `python` under **Subreddits**, leave the dates empty and run. The default output is one row per month for the last year:

```json
{
  "mode": "activityTimeline",
  "recordType": "activityPoint",
  "entityType": "subreddit",
  "entity": "r/python",
  "metric": "posts",
  "periodStart": "2025-11-01",
  "periodEnd": "2025-11-30",
  "granularity": "month",
  "count": 1120,
  "source": "arctic-shift"
}
```

Add **Include score sums** to get `postScore` and `commentScore` rows beside the counts. Add **Include subscriber trend** for a `subscribers` row per period.

### Inputs

| Input | Default | What it does |
|---|---|---|
| `mode` | `activityTimeline` | One of the four modes above. |
| `subreddits` | – | Bare names, `r/` names or full Reddit URLs. Used by timeline, top contributors and community profile. |
| `usernames` | – | Bare names, `u/` names or profile URLs. Used by timeline and author footprint. |
| `granularity` | `month` | Day, week, month or year. Weeks start on Monday in UTC. |
| `contentType` | `both` | Posts, comments or both. Also chooses the leaderboard metric. |
| `keyword` | – | Restricts posts by title/body or comments by body. Needs a subreddit or username because the archive has no global keyword search. |
| `dateFrom` | – | Start date in `YYYY-MM-DD`, inclusive. Empty means the last 12 months for timelines and leaderboards and all archived history for author footprints. |
| `dateTo` | – | End date in `YYYY-MM-DD`, inclusive. Empty means today. |
| `includeScores` | `false` | Adds score-sum points to a timeline. |
| `includeSubscriberTrend` | `false` | Adds a subscriber-count point per period for subreddits. |
| `includeRules` | `true` | Adds every archived rule to a community profile. |
| `includeLiveMetadata` | `true` | Reads Reddit's public Atom feed for the newest visible post date and as a profile fallback. It never supplies a count. |
| `excludeAuthors` | – | Leaves out names such as `AutoModerator` or `[deleted]` from leaderboards. |
| `maxItems` | `1000` | Caps the dataset. Maximum 100,000. |

### What comes out

All rows are flat and omit empty fields. A `recordType` field tells the views apart.

**Activity points** carry `entity`, `metric`, `periodStart`, `periodEnd`, `granularity` and `count`. Metrics:

- `posts` and `comments` - how many items were created in the period.
- `postScore` and `commentScore` - the sum of archived scores for items created in the period.
- `subscribers` - the archive's average subscriber count for the period, rounded.

**Ranking rows** carry `entity`, `rank`, `key`, `contentType`, `count`, `postsCount` and `commentsCount`. Ties are ordered by username so repeated runs are stable.

**Author footprint rows** carry `entity`, `rank`, `key` (the subreddit), per-subreddit post and comment counts, the author's `firstActivityAt` and `lastActivityAt`, and account-wide totals from the archive's user index.

**Community profiles** carry `entity`, `title`, descriptions, `subscribers`, `createdAt`, category, NSFW flag, community type, language, archived post/comment totals, earliest post/comment dates, `rules` (name, description, kind, priority, violation reason), the newest visible post date from RSS, and a canonical Reddit URL.

### How the numbers are built

- Subreddit and all-Reddit timelines use Arctic Shift's pre-computed time series, which is the cheapest and most reliable path and includes zero-count periods.
- Author timelines and keyword-filtered timelines use the archive's date aggregation. If a very active entity makes an aggregation time out, the actor narrows the window automatically and finally counts matching archived rows page by page (up to 100,000 rows per run, stated in the run status).
- Leaderboards aggregate authors one calendar month at a time and merge the counts, so a long range never depends on one huge query. A timed-out month is split into smaller windows, with a raw-row count as the last resort.
- Author footprints aggregate per calendar year and merge. If the archive's user index has no metadata, first/last activity is read from the earliest and latest archived items; the public RSS feed is the last fallback for the most recent activity.
- Community rules come from the archive's rules endpoint in one batched request.

### Limits you should know

- **Archive coverage:** Arctic Shift indexes public Reddit content from 2005 onward. Very recent items can take hours to appear, and score/comment fields settle over roughly 36 hours. Counts describe the archive, not a live Reddit page.
- **Deleted and removed content:** items that were removed before archiving are not present. `[deleted]` authors are counted exactly as the archive stores them, which is why the `Exclude authors` input exists.
- **Keywords:** the archive's full-text search is slower on very large communities and very broad terms. The actor retries, narrows and finally counts rows directly; if the 100,000-row safety cap is reached, the run status says so.
- **Weekly points:** weekly buckets start on Monday (UTC). Score-sum and subscriber points follow the same bucket boundaries as counts.
- **Community profiles:** subscriber counts and creation dates come from the archive's infrequently refreshed subreddit index. The live RSS feed can add a newer post date but does not expose subscriber totals.
- **Private, banned or never-indexed communities:** there is no public archive or RSS feed, so those names produce a warning instead of invented rows.

### Data source

Primary source: [Arctic Shift](https://arctic-shift.photon-reddit.com), a free public Reddit archive API. Secondary source: Reddit's public Atom RSS feeds (`/r/<name>/new/.rss` and `/user/<name>/.rss`) for live metadata and last-activity fallback. Reddit's protected `.json` endpoints are not used.

### FAQ

**Do I need a Reddit account or API key?** No.

**Can I get every subreddit for a keyword?** No. The archive requires a subreddit or author for keyword queries. Use the keyword field together with a community or username.

**Why is an author's oldest activity missing?** Only content that was archived is counted. Accounts whose early posts were deleted before archiving start later in the dataset.

**Can I schedule this for growth tracking?** Yes. Schedule a timeline run and append each dataset to a spreadsheet or warehouse; every row carries its period boundaries so repeated runs line up.

# Actor input Schema

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

Choose a statistics mode: an activity timeline, a contributor leaderboard, an author footprint, or community profiles.

## `subreddits` (type: `array`):

Communities to analyse. Accepts bare names (python), r/ names (r/python) or full Reddit URLs. Used by timeline, top contributors and community profile modes.

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

Reddit authors to analyse. Accepts bare names (spez), u/ names (u/spez) or profile URLs. Used by timeline and author footprint modes.

## `granularity` (type: `string`):

Size of each timeline point. Weekly points start on Monday (UTC); monthly and yearly points start at the first day of the period.

## `contentType` (type: `string`):

Count posts, comments or both. In top contributors and author footprint this is also the ranking metric.

## `keyword` (type: `string`):

Only count posts whose title/body matches the keyword, or comments whose body matches it. Requires a subreddit or username; global keyword search is not supported by the archive.

## `dateFrom` (type: `string`):

Start of the range in YYYY-MM-DD. Empty means 12 months ago for timelines and leaderboards, or 2005-01-01 for author footprints.

## `dateTo` (type: `string`):

End of the range in YYYY-MM-DD (inclusive). Empty means today.

## `includeScores` (type: `boolean`):

Add one row per period with the sum of archived post scores (postScore) and comment scores (commentScore). Counting rows separately keeps every row chart-ready.

## `includeSubscriberTrend` (type: `boolean`):

Add a subscribers metric per period for each subreddit. Values are the archive's average subscriber count for the bucket.

## `includeRules` (type: `boolean`):

Attach every archived moderator rule (name, description, kind, priority and violation reason) to each community profile.

## `includeLiveMetadata` (type: `boolean`):

Read the public Reddit Atom feed to add the newest visible post date and to fill a profile when the archive has not indexed the community yet. It never supplies a count.

## `excludeAuthors` (type: `array`):

Usernames to leave out of top contributors, for example AutoModerator and \[deleted]. Case-insensitive.

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

Maximum number of output rows. For timelines this caps the number of points returned; for rankings it caps the number of rows.

## Actor input object example

```json
{
  "mode": "activityTimeline",
  "subreddits": [
    "python",
    "r/webdev",
    "https://www.reddit.com/r/dataisbeautiful/"
  ],
  "usernames": [
    "spez",
    "u/kn0thing"
  ],
  "granularity": "month",
  "contentType": "posts",
  "keyword": "django",
  "dateFrom": "2024-01-01",
  "dateTo": "2026-01-01",
  "includeScores": false,
  "includeSubscriberTrend": false,
  "includeRules": true,
  "includeLiveMetadata": true,
  "excludeAuthors": [
    "AutoModerator",
    "[deleted]"
  ],
  "maxItems": 3
}
```

# Actor output Schema

## `records` (type: `string`):

Dataset containing the records for the selected mode. Every row has a recordType field: activityPoint, rankingRow, footprintRow or communityProfile.

# 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 = {
    "mode": "activityTimeline",
    "subreddits": [
        "python"
    ],
    "granularity": "month",
    "contentType": "posts",
    "includeScores": false,
    "includeSubscriberTrend": false,
    "includeRules": true,
    "includeLiveMetadata": true,
    "maxItems": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("xyrelith-data/reddit-activity-stats").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 = {
    "mode": "activityTimeline",
    "subreddits": ["python"],
    "granularity": "month",
    "contentType": "posts",
    "includeScores": False,
    "includeSubscriberTrend": False,
    "includeRules": True,
    "includeLiveMetadata": True,
    "maxItems": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("xyrelith-data/reddit-activity-stats").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 '{
  "mode": "activityTimeline",
  "subreddits": [
    "python"
  ],
  "granularity": "month",
  "contentType": "posts",
  "includeScores": false,
  "includeSubscriberTrend": false,
  "includeRules": true,
  "includeLiveMetadata": true,
  "maxItems": 3
}' |
apify call xyrelith-data/reddit-activity-stats --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xyrelith-data/reddit-activity-stats"
        }
    }
}
```

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/rGuEXyi5AffNtvhUZ/builds/wvFCAvXFj9wmB9eXI/openapi.json
