# Reddit Scraper — Posts, Users & Subreddits | $0.90/1K (`agentxpro/reddit-scraper`) Actor

Scrape Reddit posts, user history, subreddit info and feeds: subreddit posts, single posts and duplicates, user posts/comments/overview, subreddit details with rules, directories, autocomplete. No login needed. Pay per result.

- **URL**: https://apify.com/agentxpro/reddit-scraper.md
- **Developed by:** [Agent X](https://apify.com/agentxpro) (community)
- **Categories:** Social media, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 Scraper — Posts, Users & Subreddits | $0.90/1K

Scrape Reddit posts, user history, subreddit details and feeds with one actor — no Reddit account, no login, no API key. Set a mode, paste names or links, and get clean structured rows you can feed to a spreadsheet, a database, or an AI agent.

**Pay per result, nothing else:** posts and subreddits **$0.90 per 1,000**, comments **$0.65 per 1,000**, plus a $0.10 per 1,000-runs start fee. No minimums, no init fees, no monthly rent. Rows that don't exist are never charged.

### What you can scrape

| Mode | What you get |
|---|---|
| Subreddit posts | Posts from any subreddits — hot, top or controversial, with a time window (hour → all time) |
| Post details | One full post per URL or ID: body, score, upvote ratio, media, gallery images, video link |
| Post duplicates | Every other post that shared the same link (crossposts and reposts) |
| User posts | A user's submitted posts, sorted your way |
| User comments | A user's comment history, each with the post it belongs to |
| User overview | Posts and comments mixed, newest first |
| Subreddit info | Members, description, creation date, images — optionally with the full rules attached |
| Subreddit directory | The popular or newest subreddits, paged as far as you want |
| Feed | The front page or r/popular as post rows |
| Autocomplete | Subreddits matching a partial name — find communities fast |
| Start URLs | Paste any reddit.com links; each is routed to the right mode automatically |

Inputs accept bare names (`technology`, `spez`), prefixed names (`r/technology`, `u/spez`) or full reddit.com links — paste whatever you have.

### Example input

```json
{
  "mode": "subredditPosts",
  "subreddits": ["technology", "science"],
  "sort": "top",
  "time": "week",
  "resultsLimit": 100
}
```

### Example output (one post row)

```json
{
  "type": "post",
  "id": "1xwijlj",
  "title": "'Duffy Lied': Air Traffic Controllers Refute …",
  "author": "someposter",
  "subreddit": "technology",
  "subredditPrefixed": "r/technology",
  "score": 15234,
  "upvoteRatio": 0.94,
  "numComments": 812,
  "createdUtc": 1763000000,
  "createdAt": "2025-11-13T09:33:20Z",
  "url": "https://example.com/story",
  "permalink": "https://www.reddit.com/r/technology/comments/1xwijlj/…",
  "body": "",
  "flair": "News",
  "nsfw": false,
  "imageUrl": "https://preview.redd.it/…",
  "images": ["https://preview.redd.it/…"],
  "videoUrl": null
}
```

Comment rows carry `body`, `score`, the parent post's ID and title, and a permalink. Subreddit rows carry `displayName`, `description`, `subscribers`, `activeUsers`, creation date, icon/banner URLs — and the rules when you switch that option on.

### Options

| Option | Applies to | Notes |
|---|---|---|
| Sort | subreddit posts, user history | hot / top / controversial (+ new for user history) |
| Time filter | top, controversial | hour, day, week, month, year, all |
| Results limit | every listing mode | 1–1,000 rows per target |
| Include rules | subreddit info | attaches the subreddit's rules to each row |
| Include NSFW | post listings | off by default; NSFW posts are dropped and never charged |
| Directory | subreddit directory | popular or new |
| Feed source | feed | front page or r/popular |
| AI agent context | every mode | adds an `agentContext` object to every delivered row (see *For AI agents*). Never changes charges |

### Pricing

| Event | Price |
|---|---|
| Post row delivered | $0.0009 ($0.90 / 1K) |
| Comment row delivered | $0.00065 ($0.65 / 1K) |
| Subreddit row delivered | $0.0009 ($0.90 / 1K) |
| Run start | $0.0001 |

You are charged only for rows that land in your dataset. A subreddit that doesn't exist, a deleted post, a target that returns nothing — all free.

### Honest limits

- Reddit does not serve keyword search or full comment trees under a post to readers without an account, so this actor does not offer them. Everything that is publicly readable without logging in is covered above — including a user's full comment *history*, which is different from a post's comment tree.
- The `new` and `rising` subreddit sorts are likewise not served anonymously; hot, top and controversial are.
- Private, banned or quarantined subreddits return nothing (and cost nothing).
- Listings reflect what Reddit shows anonymous readers; very large pulls are paged at Reddit's own pace.

### For AI agents

Every row is flat JSON with stable field names — posts, comments and subreddits share `type`, `id`, `author`/`displayName`, `score`, `createdAt` and `permalink`, so a single parser handles all three. The actor is also available through Apify's MCP server, so agents can call it as a tool and read results directly. A run summary (mode, delivered counts per type, per-target notes) is written to the key-value store under `OUTPUT` on every run.

Turn on the `agentContext` option and every delivered row also
carries an `agentContext` object, shaped the way AI-agent context
APIs answer: the content cleaned and ready to paste straight into
an LLM prompt, where it came from, and how big it is.

```json
{
  "agentContext": {
    "text": "Post title\n\nPost body…",
    "source": { "type": "reddit", "url": "https://www.reddit.com/r/technology/comments/…", "title": "Post title" },
    "citation": "\"Post title\" by u/author in r/technology (2026-11-22T10:15:30Z) — https://www.reddit.com/r/technology/comments/…",
    "tokens": 120,
    "retrievedAt": "2026-11-22T10:15:30Z"
  }
}
```

- `text` — for a post, its title plus body; for a comment, the
  comment body; for a subreddit, its title plus description.
- `source` — `{type, url, title}`: where this row came from.
- `citation` — a ready-to-paste citation line with author,
  subreddit and date.
- `tokens` — estimated token count of `text` (≈4 characters per
  token), so an agent can budget its context window.
- `retrievedAt` — ISO 8601 UTC time the row was retrieved.

`agentContext` is off by default, adds no rows, and never changes
charges — it rides on the rows you already pay for.

### FAQ

**Do I need a Reddit account or API key?** No. The actor reads what Reddit shows the public.
**What does a typical run cost?** 1,000 subreddit posts cost $0.90 in event charges plus a fraction of a cent of platform compute. There are no init or per-query fees.
**Can I scrape several subreddits or users in one run?** Yes — list as many as you like; the results limit applies per target.
**What happens with a wrong name?** That target returns nothing, is noted in the run summary, and is not charged.
**Are NSFW posts included?** Only if you switch the option on.

# Actor input Schema

## `directory` (type: `string`):

Subreddit directory mode: which directory to list.

## `feedSource` (type: `string`):

Feed mode: the front page (r/hot across Reddit) or r/popular.

## `includeNsfw` (type: `boolean`):

Off (default): posts marked NSFW are dropped before delivery and are never charged. On: they are included.

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

Subreddit info mode: also attach the subreddit's rules and Reddit's site rules to each subreddit row.

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

What to scrape. subredditPosts: posts from one or more subreddits. postDetails: one post per URL/ID. postDuplicates: every other post that shared the same link. userPosts / userComments / userOverview: a user's history. subredditInfo: details for one or more subreddits. subredditDirectory: popular or new subreddits. feed: the front page or r/popular. autocomplete: subreddits matching a partial name. startUrls: paste any reddit.com links and each is routed automatically.

## `postUrls` (type: `array`):

Post details / duplicates modes: post URLs, redd.it links, post IDs or t3\_ IDs. One row per post found.

## `query` (type: `string`):

Autocomplete mode: a partial subreddit name or keyword, e.g. 'tech'.

## `resultsLimit` (type: `integer`):

Maximum rows per target (per subreddit, per user, per feed). 1-1000.

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

Listing sort. Subreddit posts: hot, top, controversial (new and rising are not served to anonymous readers). User history: hot, new, top, controversial.

## `startUrls` (type: `array`):

Start URLs mode: any mix of reddit.com links — post links return the post, subreddit links return their posts, user links return their overview.

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

Subreddit posts / info modes: subreddit names, r/name, or full reddit.com/r/... links.

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

Time window for the top and controversial sorts.

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

User modes: usernames, u/name, or full reddit.com/user/... links.

## `agentContext` (type: `boolean`):

Add an agentContext object to every delivered row: the post title + body, comment body, or subreddit title + description as clean text ready to paste into an LLM prompt, a source block (type, URL, title), a ready-to-paste citation with author, subreddit and date, an estimated token count and the retrieval time. Modelled on the response style AI-agent APIs use. Off by default; never changes charges.

## Actor input object example

```json
{
  "directory": "popular",
  "feedSource": "front",
  "includeNsfw": false,
  "includeRules": false,
  "mode": "subredditPosts",
  "resultsLimit": 100,
  "sort": "hot",
  "time": "all",
  "agentContext": false
}
```

# Actor output Schema

## `rows` (type: `string`):

One row per post, comment or subreddit delivered by the run, depending on the chosen mode. Post rows carry title, author, subreddit, score, upvote ratio, comment count, timestamps, links and media. Comment rows carry the text, score, and the post they belong to. Subreddit rows carry name, description, subscriber counts and images.

## `summary` (type: `string`):

Small JSON record in the default key-value store under the OUTPUT key: which mode ran, how many rows of each type were delivered, and any per-target notes (for example a subreddit that does not exist).

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("agentxpro/reddit-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 = {}

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

```

## MCP server setup

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