# Reddit Scraper - Posts, Comments & Search (`martin10291/reddit-posts-comments-extractor`) Actor

Reddit Scraper - Posts, Comments & Search

- **URL**: https://apify.com/martin10291/reddit-posts-comments-extractor.md
- **Developed by:** [Martin Petrov](https://apify.com/martin10291) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 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 Scraper - Posts, Comments & Search

Scrape **Reddit posts and comments** from subreddits, search results, user profiles and single post URLs. Get title, full text, author, subreddit, date, external link, images and thumbnail for every post, plus the comments of each post.

No login, no Reddit API key. **$0.80 per 1000 results, no start fee.**

### Why this actor

- **Works when other Reddit scrapers fail.** Reddit now blocks its JSON and web pages for most cloud servers and proxies. This actor reads Reddit's official RSS feeds, which stay available, and rotates connections automatically on rate limits.
- **Monitoring mode.** Turn on `onlyNewPosts` and schedule the actor: every run returns only posts you have not received before. This is ideal for brand mentions, competitor tracking and lead alerts.
- **Everything in one actor.** Subreddits (hot, new, top, rising), Reddit-wide or subreddit search, users, single posts, comments.
- **Filters before you pay.** Keywords, excluded words and posted within N days.
- **Clean, flat output.** Posts and comments share one schema, ready for Excel, Google Sheets, BI tools and LLM pipelines.
- **Low price.** $0.80 per 1000 posts or comments, no start fee.

### Use cases

- **Brand and keyword monitoring:** get every new post that mentions your product or competitors
- **Lead generation:** find people asking for tools or services like yours
- **Market and product research:** collect opinions, complaints and feature requests
- **AI and sentiment analysis:** feed posts and comments into LLMs or sentiment models
- **Content research:** find the top posts in any niche by week, month or year

### Input

| Field | Type | Description |
|---|---|---|
| `startUrls` | array | Subreddits (`r/technology`), sort pages (`/r/SaaS/top?t=month`), posts, users (`u/name`) or search URLs. |
| `searchQueries` | array | Search all of Reddit for these terms. |
| `searchInSubreddit` | string | Limit the search to one subreddit. |
| `sort` | string | `new`, `hot`, `top`, `rising`, `relevance`, `comments`. Default `new`. |
| `time` | string | For Top and search: `hour`, `day`, `week`, `month`, `year`, `all`. |
| `maxPostsPerSource` | integer | Posts per URL or query (up to about 1000). Default `100`. |
| `includeComments` | boolean | Also save the comments of each post. |
| `maxCommentsPerPost` | integer | Comments per post (up to 500). Default `100`. |
| `commentSort` | string | `top`, `best`, `new`, `controversial`, `old`, `qa`. |
| `onlyNewPosts` | boolean | Monitoring mode: only posts not returned before. |
| `monitorId` | string | Separate memory for different searches. |
| `postedWithinDays` | integer | Only posts from the last N days. |
| `keywords` / `excludeKeywords` | array | Text filters on title and body. |
| `maxItems` | integer | Hard limit on results saved (and paid for). |

#### Example: monitor brand mentions daily

```json
{
  "searchQueries": ["notion ai", "\"obsidian\" app"],
  "sort": "new",
  "onlyNewPosts": true,
  "monitorId": "brand-mentions",
  "includeComments": false
}
```

Save it as a task and add a daily schedule. Each run returns only new posts.

#### Example: top posts with comments

```json
{
  "startUrls": ["https://www.reddit.com/r/SaaS/top/?t=month"],
  "maxPostsPerSource": 50,
  "includeComments": true,
  "maxCommentsPerPost": 200
}
```

### Output

Posts and comments are saved as separate rows with the same schema. A post:

```json
{
  "type": "post",
  "id": "1gk3x9a",
  "url": "https://www.reddit.com/r/SaaS/comments/1gk3x9a/how_we_got_our_first_100_customers/",
  "title": "How we got our first 100 customers",
  "body": "Sharing what worked for us ...",
  "author": "founder123",
  "subreddit": "SaaS",
  "createdAt": "2026-10-20T14:02:11Z",
  "updatedAt": "2026-10-20T14:02:11Z",
  "link": null,
  "domain": "self.SaaS",
  "isSelf": true,
  "mediaUrls": [],
  "thumbnailUrl": null,
  "source": "https://www.reddit.com/r/SaaS/top/?t=month",
  "scrapedAt": "2026-10-27T08:00:00Z"
}
```

A comment:

```json
{
  "type": "comment",
  "id": "lvx2k1p",
  "url": "https://www.reddit.com/r/SaaS/comments/1gk3x9a/how_we_got_our_first_100_customers/lvx2k1p/",
  "postId": "1gk3x9a",
  "postTitle": "How we got our first 100 customers",
  "author": "growthnerd",
  "body": "Great write-up, the cold email part ...",
  "subreddit": "SaaS",
  "createdAt": "2026-10-20T15:10:42Z"
}
```

*Values above are illustrative.* The `RUN_SUMMARY` record shows posts, comments and skipped posts per source, and any errors.

### Pricing

$0.80 per 1000 results (posts or comments), no start fee. Filters run before saving, so filtered posts are free. Use `maxItems` to cap the cost of a run.

### Good to know

- Reddit's feeds do not include vote scores or comment counts, so these fields are not in the output. Sort by `top` with a time range to get the most popular posts.
- Reddit lists up to about 1000 posts per subreddit sort or search.
- Comments come as a flat list (up to 500 per post), without reply nesting.
- Private, banned and quarantined communities are reported in the run summary.

### More Actors by Martin Petrov

Pair with **YouTube Channel Monitor** to track the same brands and topics on YouTube.

- **[YouTube Channel Monitor (New Videos & Shorts)](https://apify.com/martin10291/youtube-channel-monitor)**: Only new videos, Shorts and streams from many channels, with exact date, views and likes.
- **[YouTube Transcript & Subtitles Scraper](https://apify.com/martin10291/youtube-transcript-bulk-extractor)**: Transcripts from videos, playlists and whole channels, any language, with translation.
- **[Google Trends Scraper](https://apify.com/martin10291/google-trends-explorer)**: Interest over time, regions and related queries for many keywords, compared on one scale.
- **[Remote Jobs Scraper (8 Job Boards)](https://apify.com/martin10291/remote-jobs-aggregator-pro)**: Remote jobs from RemoteOK, Remotive, We Work Remotely, HN Who is Hiring and more, deduplicated.
- **[ATS Jobs Scraper (Greenhouse, Lever, Ashby)](https://apify.com/martin10291/ats-jobs-aggregator)**: Company job boards from 5 ATS platforms with salaries, filters and only-new mode.

### Legal

The actor reads publicly available Reddit content without logging in. Scraped content may include personal data such as usernames; process it in line with GDPR and other applicable laws, and with Reddit's terms. Do not use it for spam or harassment.

# Actor input Schema

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

Subreddits (https://www.reddit.com/r/technology or r/technology), subreddit sort pages (/r/SaaS/top?t=month), posts, users (u/name) or Reddit search URLs.

## `searchQueries` (type: `array`):

Search all of Reddit for these terms (brand names, products, topics).

## `searchInSubreddit` (type: `string`):

Limit the search queries to one subreddit, e.g. webscraping.

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

Order of posts for subreddits and searches.

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

Used with Top, Controversial and search.

## `maxPostsPerSource` (type: `integer`):

Reddit lists up to about 1000 posts per listing.

## `includeComments` (type: `boolean`):

Also save comments for every post. Each comment is one result.

## `maxCommentsPerPost` (type: `integer`):

Comments saved for each post (Reddit's feed returns up to 500).

## `commentSort` (type: `string`):

Which comments come first.

## `onlyNewPosts` (type: `boolean`):

Return only posts not returned in earlier runs with the same monitor ID. Schedule the actor to track brands, keywords or subreddits.

## `monitorId` (type: `string`):

Name of the memory used by monitoring mode. Use different IDs for different searches.

## `postedWithinDays` (type: `integer`):

Only posts from the last N days. 0 = any date.

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

Keep only posts whose title or text contains any of these words.

## `excludeKeywords` (type: `array`):

Skip posts whose title or text contains any of these words.

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

Hard limit on posts + comments saved (and paid for).

## `proxyConfiguration` (type: `object`):

Optional. By default the actor connects directly and rotates to Apify Proxy automatically on rate limits.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.reddit.com/r/technology/"
  ],
  "sort": "new",
  "time": "week",
  "maxPostsPerSource": 100,
  "includeComments": false,
  "maxCommentsPerPost": 100,
  "commentSort": "top",
  "onlyNewPosts": false,
  "monitorId": "default",
  "postedWithinDays": 0,
  "maxItems": 1000,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

One row per post or comment.

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

Per-source counts, skipped posts and errors.

# 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 = {
    "startUrls": [
        "https://www.reddit.com/r/technology/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("martin10291/reddit-posts-comments-extractor").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 = { "startUrls": ["https://www.reddit.com/r/technology/"] }

# Run the Actor and wait for it to finish
run = client.actor("martin10291/reddit-posts-comments-extractor").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 '{
  "startUrls": [
    "https://www.reddit.com/r/technology/"
  ]
}' |
apify call martin10291/reddit-posts-comments-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,martin10291/reddit-posts-comments-extractor"
        }
    }
}
```

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/wFmGlsw32E1jdwpX0/builds/vjmBQLAWrfV9TqPmO/openapi.json
