# Reddit Scraper (`batscrape/reddit-scraper`) Actor

Search Reddit posts or comments by keyword across all subreddits. Export title, text, subreddit, author, score, upvotes and comment counts to JSON, CSV or Excel. Sort by relevance, newest, top or most comments. No login or API key needed. Flat price: $0.89 per 1,000 results.

- **URL**: https://apify.com/batscrape/reddit-scraper.md
- **Developed by:** [BatScrape](https://apify.com/batscrape) (community)
- **Stats:** 6 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.89 / 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.

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 Search Scraper: Posts & Comments by Keyword with Subreddit, Author & Score Data 👽

Search Reddit posts or comments by keyword and export unique results as clean JSON: title, text, subreddit, author, score and comment counts, sorted by relevance, newest, top or most comments, with transparent flat per-result pricing. Comment results also carry the title, URL, score and comment count of the post they belong to. No Reddit login, no API key or OAuth app to register, no cookies. Perfect for brand and PR monitoring, market and product research, finding the questions people ask for SEO and content, social listening, idea validation and building Reddit datasets for AI and analytics.

💰 Price: $0.0005 flat per run + $0.00089/result ($0.89 per 1,000 posts or comments, no separate query fee) 🌏 Coverage: Reddit keyword search across all subreddits, posts or comments 📊 Data: Title, text, subreddit, author, score, upvotes, comment count, parent post for comments 🎯 Filters: Sort (relevance / newest / top / most comments), time filter for posts, per-keyword limit, overall item cap 🛡️ Flat Per-Result Pricing

### Quick Navigation

- [🧭 What Does This Actor Do?](#🧭-what-does-this-actor-do)
- [👽 Features and Functionality](#👽-features-and-functionality)
- [💰 Pricing: Transparent Event-Based Costs](#💰-pricing-transparent-event-based-costs)
- [🔼 Who Needs This?](#🔼-who-needs-this)
- [🗨️ Input Parameters](#🗨️-input-parameters)
- [💡 Input Strategy Guide](#💡-input-strategy-guide)
- [🔎 Example Requests](#🔎-example-requests)
- [📦 Output](#📦-output)
- [🔧 Troubleshooting](#🔧-troubleshooting)
- [❔ FAQ](#❔-faq)
- [📞 Contact](#📞-contact)

### 🧭 What Does This Actor Do?

This actor runs Reddit's keyword search for you and pushes every unique result to your dataset as structured JSON, with no headless browser, no login and no API credentials on your end. Pick whether to search posts or comments, give it one or more keywords, and it walks the result pages of each keyword, removes results that show up more than once, and respects your `maxItemsPerQuery` and `maxItems` limits and your pay-per-event budget as it goes.

**🔍 Post Search** — find threads matching your keywords across all of Reddit, sorted by relevance, newest, top or most comments, and optionally limited to the past day, week, month or year. Reddit's post search goes up to about 250 results per keyword and sort order.

**🗨️ Comment Search** — find individual comments that mention your keywords, sorted by relevance, newest or top. Every comment comes with its parent post's title, URL, score and comment count, so you know the context without a second lookup.

**📊 Author & Engagement Included** — every result carries its subreddit, author and score (plus upvotes and comment count for posts) at no extra charge.

### 👽 Features and Functionality

| Feature                    | Description                                                                          | Benefit                                                        |
| -------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
| 💰 Flat Per-Result Pricing | One price per unique post or comment delivered, no separate query fee                | Predictable cost, no surprise per-keyword or per-page fees     |
| 🔍 Posts or Comments       | Search threads or individual comments with the same input form                       | One actor for both kinds of Reddit conversation                |
| 🧹 Cross-Keyword Dedup     | A result found by two keywords, or on two pages, is stored and charged once          | Never pay twice for the same post or comment                   |
| 🎯 Sort & Time Filter      | Relevance, newest, top or most comments; past day, week, month or year for posts     | Get exactly the slice of Reddit you are after                  |
| 🧵 Parent Post Context     | Comment results include the parent post's title, URL, score and comment count        | Understand each comment without opening the thread             |
| 🔧 Custom Map Function     | JavaScript function to reshape or enrich output on the fly                           | Shape results to match your exact requirements                 |
| 💵 Budget-Aware            | Every result is checked against the run's charge budget before it's stored           | A run stops cleanly instead of overspending                    |

### 💰 Pricing: Transparent Event-Based Costs

Pay-per-event pricing — no subscription, no hidden fees. A flat run fee, and one charge per unique post or comment actually delivered. There is no free allowance, and duplicates are never charged.

#### Pricing Structure

| Event          | Price (USD) | Charged For                                              |
| -------------- | ----------- | -------------------------------------------------------- |
| 🚀 Actor Start | $0.0005     | Once per run, regardless of input                        |
| 📊 Result      | $0.00089    | Each unique Reddit post or comment actually delivered    |

#### 💵 Real-World Pricing Examples

| Use Case                   | Configuration                                                                          | Total Cost | Breakdown                    |
| -------------------------- | -------------------------------------------------------------------------------------- | ---------- | ---------------------------- |
| Quick sample               | 1 keyword, `maxItems: 10` (10 posts)                                                   | $0.0094    | $0.0005 + (10 × $0.00089)    |
| One keyword, default limit | 1 keyword, `maxItemsPerQuery` left at its default of 100 (100 posts)                   | $0.0895    | $0.0005 + (100 × $0.00089)   |
| Full post search           | 1 busy keyword, `maxItemsPerQuery: 0` (one measured walk: 215 unique posts)            | $0.19185   | $0.0005 + (215 × $0.00089)   |
| Comment listening sweep    | 10 keywords, comment search, `maxItemsPerQuery: 100`, `maxItems: 1000` (1,000 comments) | $0.8905    | $0.0005 + (1,000 × $0.00089) |

Result counts vary from keyword to keyword — a rare keyword simply returns fewer unique results (and costs less) than a popular one, and a keyword stops below its limit when there is nothing more to find; the rows above are illustrative at the volumes shown.

### 🔼 Who Needs This?

- **🏷️ Brand & PR teams** — monitor what Reddit says about a brand, product or competitor, in posts and in comments.
- **📈 Market & product researchers** — collect honest user opinions, complaints and feature requests around a topic.
- **✍️ SEO & content marketers** — find the questions people actually ask, and the threads that rank and get discussed.
- **👂 Trend & social listening analysts** — track how a topic is discussed over the past day, week, month or year.
- **🤖 AI & data teams** — build datasets of real Reddit posts and comments for analysis, classification or LLM pipelines.
- **🚀 Founders** — validate an idea by reading how people describe the problem in their own words.

### 🗨️ Input Parameters

| Field               | Description                                                                                                                                                                                                                 | Default                                        |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| `searchType`        | What to search for: `posts` (threads) or `comments` (individual comments). Comment results include the title, URL, score and comment count of the post they belong to.                                                    | `posts`                                        |
| `keywords`          | Search terms, one per line. Each keyword runs a separate Reddit search. Results are deduplicated across keywords. Required (at least one).                                                                                  | prefilled `["claude code"]`                    |
| `sort`              | Order of the results: `relevance`, `new` (newest), `top` (most upvoted) or `comments` (most comments). `comments` is available for post search only; comment search falls back to `relevance` with a warning in the log. | `relevance`                                    |
| `timeframe`         | Only include posts from this period: `all`, `day` (past 24 hours), `week`, `month` or `year`. Applies to post search only; ignored for comments.                                                                            | `all`                                          |
| `maxItemsPerQuery`  | Maximum results to collect per keyword. Empty means `100`; `0` means no per-keyword limit (up to 5,000). Reddit's post search ends at about 250 results per keyword and sort order. Minimum `0`.                          | prefilled `100`                                |
| `maxItems`          | Overall cap across all keywords combined. `0` or empty means unlimited (each keyword is still separately capped by `maxItemsPerQuery`). Minimum `0`.                                                                       | prefilled `1000`                               |
| `customMapFunction` | `(object) => object` applied to every item. Must not be used for filtering.                                                                                                                                                 | prefilled `(object) => { return {...object} }` |

A run handles up to 1,000 keywords; anything beyond that is skipped with a warning, so split larger lists across runs. Keywords longer than 200 characters are skipped with a warning.

### 💡 Input Strategy Guide

**Just want a quick sample?** Run a single keyword with `maxItems` set to 10. It is a cheap, fast check that the actor and your keyword return what you expect.

**Need as many posts as possible on one topic?** Reddit's post search stops at about 250 results per keyword and sort order, and some of those repeat: one measured walk to the end of a busy keyword's results gave 215 unique posts. To go beyond that, run the same keyword with different `sort` values (`relevance`, `new`, `top`, `comments`) or `timeframe` windows, or add more specific related keywords. Cross-keyword dedup keeps the overlap free of charge.

**Monitoring fresh mentions?** Use `sort: new`, add `timeframe: day` or `week` for post search, and schedule the run. Each run then picks up what was posted since the last one.

**Posts or comments?** Search posts to find the threads about a topic; search comments to find every place a brand or product is mentioned in passing, inside threads that are about something else. One run searches one type, so run the actor twice if you want both.

### 🔎 Example Requests

Find the most discussed posts about a topic from the past month:

```json
{
    "searchType": "posts",
    "keywords": ["claude code"],
    "sort": "comments",
    "timeframe": "month",
    "maxItemsPerQuery": 100
}
```

Collect the newest comments that mention several brands (cross-keyword dedup applies automatically):

```json
{
    "searchType": "comments",
    "keywords": ["notion", "obsidian", "logseq"],
    "sort": "new",
    "maxItemsPerQuery": 100,
    "maxItems": 300
}
```

Go as deep as Reddit allows on one keyword, top posts of all time:

```json
{
    "keywords": ["home espresso"],
    "sort": "top",
    "timeframe": "all",
    "maxItemsPerQuery": 0,
    "maxItems": 0
}
```

### 📦 Output

One dataset item per unique Reddit post or comment; the `type` field tells you which (`post` or `comment`). A keyword with no matches simply contributes no items — it isn't stored as a placeholder row.

Example post item (field values illustrative, shaped like a `searchType: posts` result for `claude code`; long text trimmed with `…`):

```json
{
    "type": "post",
    "id": "1x229rr",
    "fullname": "t3_1x229rr",
    "url": "https://www.reddit.com/r/ClaudeCode/comments/1x229rr/what_is_the_most_ambitious_thing_youve_built_with/",
    "title": "What is the most ambitious thing you've built with Claude Code?",
    "text": "Genuine question. Here's a space where you can show off your projects. I like to be surprised! …",
    "textHtml": "<p>Genuine question. Here's a space where you can show off your projects. …</p>",
    "createTime": 1791594431,
    "createDate": "2026-10-10",
    "isVideo": false,
    "isNsfw": false,
    "isSpoiler": false,
    "subreddit": {
        "name": "ClaudeCode",
        "url": "https://www.reddit.com/r/ClaudeCode/"
    },
    "authorMeta": {
        "id": "t2_2278r9f4ga",
        "name": "jdottwotack",
        "url": "https://www.reddit.com/user/jdottwotack/"
    },
    "statistics": {
        "score": 368,
        "upvotes": 368,
        "commentCount": 556
    },
    "searchPosition": 0,
    "searchKeyword": "claude code",
    "inputKeyword": "claude code"
}
```

Example comment item (field values illustrative, shaped like a `searchType: comments` result for `claude code`; long text trimmed and signed URLs shortened with `…`):

```json
{
    "type": "comment",
    "id": "kk3ym0j",
    "fullname": "t1_kk3ym0j",
    "url": "https://www.reddit.com/r/singularity/comments/1adw690/rcscareerquestions_thinks_ai_isnt_anywhere_close/kk3ym0j/",
    "text": "I actually work in tech so have some insight. …",
    "textHtml": "<p>I actually work in tech so have some insight.</p>…",
    "createTime": 1706539510,
    "createDate": "2024-01-29",
    "isReply": false,
    "images": [],
    "authorMeta": {
        "name": "SoggyMattress2",
        "url": "https://www.reddit.com/user/SoggyMattress2/",
        "isNsfw": false
    },
    "statistics": {
        "score": 182
    },
    "post": {
        "id": "1adw690",
        "title": "R/cscareerquestions thinks AI “isn’t anywhere close to replacing software engineers”",
        "url": "https://www.reddit.com/r/singularity/comments/1adw690/rcscareerquestions_thinks_ai_isnt_anywhere_close/",
        "score": 184,
        "commentCount": 444,
        "isNsfw": false,
        "isSpoiler": false,
        "createDate": "2024-01-29"
    },
    "subreddit": {
        "id": "t5_2qh8m",
        "name": "singularity",
        "url": "https://www.reddit.com/r/singularity/",
        "icon": "https://styles.redditmedia.com/t5_2qh8m/styles/communityIcon_…",
        "isNsfw": false,
        "isQuarantined": false
    },
    "searchPosition": 1,
    "searchKeyword": "claude code",
    "inputKeyword": "claude code"
}
```

Fields worth knowing about:

- **`id` vs `fullname`** — `id` is Reddit's short id (`1x229rr`); `fullname` is the same id with Reddit's type prefix (`t3_` for posts, `t1_` for comments). A comment's `post.id` and `parentCommentId` are short ids too.
- **`text` / `textHtml`** — plain text and HTML of the post body or comment. Title-only posts have an empty `text` and no `textHtml`. Images embedded in a post body appear only inside `textHtml`.
- **`statistics`** — `score` for every result; posts also have `upvotes` and `commentCount`.
- **`post`** (comments only) — the parent post's id, title, URL, score, comment count, flags and date.
- **`isReply` / `parentCommentId`** (comments only) — `isReply` is `true` when the comment answers another comment, whose short id is then in `parentCommentId`. Top-level comments have no `parentCommentId`.
- **`images`** (comments only) — image URLs attached to the comment, usually an empty list. They are signed links that expire, so download promptly if you need them.
- **`searchPosition`** — the result's 0-based rank in Reddit's results for that keyword, counted across pages.
- **`searchKeyword` / `inputKeyword`** — the keyword that found the result. A result is stored once, under whichever keyword found it first.
- **Optional fields** — `authorMeta` details are left out for deleted accounts, and `textHtml`, `parentCommentId`, `authorMeta.avatar` and `subreddit.icon` are left out when they don't apply, rather than set to `null`.
- **`createTime` / `createDate`** — publish time as a Unix timestamp in seconds, and the same moment as a `YYYY-MM-DD` date (UTC).

### 🔧 Troubleshooting

#### ❓ Getting Few or No Results?

- ✅ Check your plan — runs on the Apify free plan are limited to one request: the first page of results for the first keyword. The log says so when the limit applies; a paid plan removes it
- ✅ Read the log — every keyword ends with a line such as `Collected 100 posts for "claude code". Stopped because the per-keyword limit of 100 was reached.`, which tells you exactly which limit applied
- ✅ Check `maxItemsPerQuery` — when left empty a keyword stops at 100 results; raise it, or set it to `0` for no per-keyword limit
- ✅ Expect at most about 250 posts per keyword and sort order — that is Reddit's own search limit, not a partial result; use other sorts, time filters or keywords for more
- ✅ Check `maxItems` — the whole run stops once it is reached, even if a keyword has not reached its own limit yet
- ✅ Check the charge budget — a run that can't afford another result stops cleanly rather than erroring
- ✅ Loosen `timeframe` — a short time filter on a rare keyword can leave few matches (it applies to post search only)
- ✅ Try a broader keyword — the actor stops a keyword early when its last pages keep adding few new results
- ✅ Remember dedup — a keyword whose results were already collected by an earlier keyword in the same run adds nothing new

#### 💡 Want to Minimize Costs?

- ✅ Set `maxItems` to a hard cap matching your budget, and keep `maxItemsPerQuery` low when you only need the top results of each keyword
- ✅ Batch related keywords into one run — cross-keyword dedup means overlaps are never charged twice
- ✅ On scheduled post searches, use `sort: new` with a short `timeframe` so each run collects recent posts instead of re-collecting ones you already have

### ❔ FAQ

**Do I need a Reddit account, login or API key to use this actor?**
No — searches run through a backend service; no login, cookies, API key or OAuth app are required on your end.

**How many results do I get per keyword?**
Up to `maxItemsPerQuery` results (100 when left empty, up to 5,000 when set to `0`), within `maxItems` and the run's maximum charge. Post search ends at about 250 posts per keyword and sort order, Reddit's own limit; some of those repeat, and one measured walk to the end gave 215 unique posts. For more, combine sort orders and time filters or add more specific keywords. Comment search has no stated depth: it continues until Reddit has no more comments, a limit is reached, or the last pages add few new comments.

**Can I filter comments by time, or sort them by most comments?**
No — the time filter and the "most comments" sort apply to post search only. For comment search the time filter is ignored and "most comments" falls back to relevance, with a warning in the log. Use `sort: new` to get the newest comments first.

**Can I use hashtags or search operators such as `subreddit:`?**
Reddit has no hashtags; search with plain keywords. Search operators such as `subreddit:` or `author:` have not been tested with this actor, so we can't promise how they behave. To focus on one community, use `subreddit.name` in the output.

**What's included at no extra charge?**
Subreddit, author and score come with every result, plus upvotes and comment count for posts and the parent post's title, URL, score and comment count for comments. There is no free allowance: every delivered result is charged. Duplicates are removed for free, and a keyword with no matches costs nothing beyond the start fee.

**What is not included?**
Full comment threads of a post are not fetched; comment search returns the individual comments that match your keyword. Upvote ratio, awards, flair, thumbnails and subreddit subscriber counts are not available from Reddit search.

**Does this actor download images or videos?**
No — it returns metadata and links only. Comments may include image URLs in `images` (signed links that expire); posts carry no media fields, and images embedded in a post body appear only inside `textHtml`.

### 📞 Contact

Reach out to the maintainers directly for support.

- ✉️ Email: batscrape@gmail.com
- 💬 Discord: discord.com/invite/ZRANXwhWU
- 🐦 X (Twitter): x.com/batscrape
- 🛒 Apify: apify.com/batscrape

# Actor input Schema

## `searchType` (type: `string`):

What to search for: posts (threads) or individual comments. Comment results include the title, URL, score and comment count of the post they belong to.

## `keywords` (type: `array`):

Search terms, one per line. Each keyword runs a separate Reddit search. Results are deduplicated across keywords, so you never pay twice for the same post or comment.

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

Order of the results. "Most comments" is available for post search only; comment search falls back to relevance.

## `timeframe` (type: `string`):

Only include posts from this period. Applies to post search only; ignored for comments.

## `maxItemsPerQuery` (type: `integer`):

Maximum results to collect per keyword. Empty means 100; 0 means no per-keyword limit (up to 5,000). Reddit's post search ends at about 250 results per keyword and sort order.

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

Overall cap across all keywords combined. 0 or empty means unlimited (each keyword is still separately capped by "Max results per keyword").

## `customMapFunction` (type: `string`):

A function that takes each output object and returns a transformed object. MUST NOT be used for filtering — accounts using it for filtering may be banned. Leave empty to store items unchanged.

## Actor input object example

```json
{
  "searchType": "posts",
  "keywords": [
    "claude code"
  ],
  "sort": "relevance",
  "timeframe": "all",
  "maxItemsPerQuery": 100,
  "maxItems": 1000,
  "customMapFunction": "(object) => { return {...object} }"
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "keywords": [
        "claude code"
    ],
    "maxItemsPerQuery": 100,
    "maxItems": 1000,
    "customMapFunction": (object) => { return {...object} }
};

// Run the Actor and wait for it to finish
const run = await client.actor("batscrape/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 = {
    "keywords": ["claude code"],
    "maxItemsPerQuery": 100,
    "maxItems": 1000,
    "customMapFunction": "(object) => { return {...object} }",
}

# Run the Actor and wait for it to finish
run = client.actor("batscrape/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 '{
  "keywords": [
    "claude code"
  ],
  "maxItemsPerQuery": 100,
  "maxItems": 1000,
  "customMapFunction": "(object) => { return {...object} }"
}' |
apify call batscrape/reddit-scraper --silent --output-dataset

```

## MCP server setup

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