# Reddit Post & Subreddit Scraper (`scrapeai/reddit-advanced-scraper`) Actor

Collect structured Reddit data including posts, comments, author details, scores, awards, and timestamps using Reddit JSON endpoints.

- **URL**: https://apify.com/scrapeai/reddit-advanced-scraper.md
- **Developed by:** [ScrapeAI](https://apify.com/scrapeai) (community)
- **Categories:** Social media, Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $4.99 / 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?

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 Post & Subreddit Scraper

Collect structured Reddit data including posts, comment threads, author details, scores, and metadata from subreddits or post URLs using Reddit JSON endpoints.

### Features

- **Advanced keyword discovery** — scrape Reddit content using targeted search terms and topics
- **Direct page extraction** — crawl individual Reddit URLs for detailed post and comment data
- **Adjustable output volume** — customize scrape limits for optimized data collection
- **Apify cloud compatible** — designed for automated runs, proxy management, and webhook workflows

### Use Cases

- Creator and influencer research — analyze audience interaction, reach, and social performance
- Content trend detection — uncover trending topics and viral discussions in real time
- Brand reputation monitoring — track mentions, feedback, and public perception across platforms
- Competitor content analysis — compare posting frequency, engagement, and content effectiveness

### Input

```json
{
  "mode": "subreddit",
  "subreddit": "technology",
  "maxItems": 5
}
```

#### Sample Output

```json
{
	"id": "t3_1tp2vck",
	"title": "Demis Hassabis on his rush to ‘solve all disease’ and Isomorphic’s new $2.1 billion",
	"url": "https://fortune.com/2026/05/27/spacexs-ipo-filing-is-full-of-surprises/",
	"permalink": "https://www.reddit.com/r/technology/comments/1tp2vck/demis_hassabis_on_his_rush_to_solve_all_disease/",
	"subreddit": "technology",
	"subredditId": "t5_2qh16",
	"subredditType": "public",
	"subredditSubscribers": 20306497,
	"author": "Logical_Welder3467",
	"authorFullname": "t2_14l1ppgci2",
	"authorFlair": null,
	"authorPremium": false,
	"score": 0,
	"upvoteRatio": 0.5,
	"numComments": 1,
	"createdAt": "2026-05-27T11:35:02.000Z",
	"editedAt": null,
	"selfText": null,
	"postType": "link",
	"isVideo": false,
	"isSelf": false,
	"isGallery": null,
	"isOC": false,
	"thumbnail": "https://external-preview.redd.it/7u82BsSEa__82PAT6aM55KObX3OWQe6qfOLLH9YK4DQ.jpeg?width=140&amp;height=70&amp;auto=webp&amp;s=d87b1af1c6ffa21600403c065db19c95dfc947f3",
	"flair": "Artificial Intelligence",
	"flairBackgroundColor": null,
	"domain": "fortune.com",
	"nsfw": false,
	"spoiler": false,
	"locked": false,
	"pinned": false,
	"stickied": false,
	"archived": false,
	"distinguished": null,
	"suggestedSort": null,
	"numCrossposts": 0,
	"postHint": "link",
	"isCrossPost": false,
	"crosspostFrom": null,
	"awardsCount": 0,
	"gilded": 0,
	"gildings": null,
	"awards": [],
	"topAwardedType": null,
	"contentCategories": null,
	"contestMode": false,
	"hideScore": true,
	"isMeta": false,
	"allowLiveComments": false,
	"quarantine": false,
	"removedByCategory": null,
	"modNote": null,
	"discussionType": null,
	"urlOverride": "https://fortune.com/2026/05/27/spacexs-ipo-filing-is-full-of-surprises/",
	"authorPatreonFlair": false,
	"authorFlairTextColor": null,
	"flairTextColor": "dark",
	"previewImages": {
		"source": {
			"url": "https://external-preview.redd.it/7u82BsSEa__82PAT6aM55KObX3OWQe6qfOLLH9YK4DQ.jpeg?auto=webp&s=8ab3765d1c49ebe3b8fc0d55a5bbe496adf65e4b",
			"width": 1200,
			"height": 600
		},
		"resolutions": [
			{
				"url": "https://external-preview.redd.it/7u82BsSEa__82PAT6aM55KObX3OWQe6qfOLLH9YK4DQ.jpeg?width=108&crop=smart&auto=webp&s=82184b1625d99fd519b621e8cac97d3a0d25f308",
				"width": 108,
				"height": 54
			},
			{
				"url": "https://external-preview.redd.it/7u82BsSEa__82PAT6aM55KObX3OWQe6qfOLLH9YK4DQ.jpeg?width=216&crop=smart&auto=webp&s=789ada1def1fb7ea9359f715b5174a6f196d4ad3",
				"width": 216,
				"height": 108
			},
			{
				"url": "https://external-preview.redd.it/7u82BsSEa__82PAT6aM55KObX3OWQe6qfOLLH9YK4DQ.jpeg?width=320&crop=smart&auto=webp&s=b4e57e444c0a2c668b2ef6bf7211a84f87160dec",
				"width": 320,
				"height": 160
			},
			{
				"url": "https://external-preview.redd.it/7u82BsSEa__82PAT6aM55KObX3OWQe6qfOLLH9YK4DQ.jpeg?width=640&crop=smart&auto=webp&s=13aa51cc18debf2875f3bf50a482af169cc821ab",
				"width": 640,
				"height": 320
			},
			{
				"url": "https://external-preview.redd.it/7u82BsSEa__82PAT6aM55KObX3OWQe6qfOLLH9YK4DQ.jpeg?width=960&crop=smart&auto=webp&s=dd429339bb687c2a5072ebe3c6bda81a799df925",
				"width": 960,
				"height": 480
			},
			{
				"url": "https://external-preview.redd.it/7u82BsSEa__82PAT6aM55KObX3OWQe6qfOLLH9YK4DQ.jpeg?width=1080&crop=smart&auto=webp&s=77ebfd2970dd488dda59a748951d199f71622d75",
				"width": 1080,
				"height": 540
			}
		]
	},
	"videoData": null,
	"mediaEmbed": null,
	"crosspostOriginal": null,
	"galleryImages": null,
	"scrapedAt": "2026-05-27T11:34:19.605Z"
}
```

# Actor input Schema

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

Select what to scrape: subreddit posts, keyword search, specific post URLs, user profiles, or subreddit users.

## `subreddit` (type: `string`):

Subreddit name (without r/). For modes: subreddit, search (restrict), subredditUsers.

## `searchQuery` (type: `string`):

Keyword or phrase to search Reddit for. Used when mode is 'search'.

## `sortBy` (type: `string`):

Sort order for subreddit/search modes. Subreddit: new/hot/top/rising/controversial. Search: relevance/new/hot/top/comments.

## `topTime` (type: `string`):

Time period when sortBy is 'top' or 'controversial'.

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

List of Reddit post URLs to scrape directly. Used when mode is 'postUrl'.

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

List of Reddit usernames (or profile URLs) to scrape. Used when mode is 'profile'.

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

Maximum posts/profiles/users to scrape.

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

Fetch top 20 comments with nested replies for each post (deepScraping must be enabled).

## `deepScraping` (type: `boolean`):

Open each post in a parallel browser tab for full data: selfText, images, video, gallery, awards, crosspost data.

## `includeRecentPosts` (type: `boolean`):

Fetch each user's recent submitted posts. Used when mode is 'profile'.

## `includeRecentComments` (type: `boolean`):

Fetch each user's recent comments. Used when mode is 'profile'.

## `includeCommentAuthors` (type: `boolean`):

Also extract comment authors from each post. Used when mode is 'subredditUsers'.

## `fetchProfileDetails` (type: `boolean`):

Enrich each discovered user with full profile data. Used when mode is 'subredditUsers'.

## `headless` (type: `boolean`):

Run the browser in headless mode (recommended for production).

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

Proxy settings to avoid IP blocking. Recommended: Apify Residential proxy.

## Actor input object example

```json
{
  "mode": "subreddit",
  "subreddit": "javascript",
  "searchQuery": "nodejs tutorial",
  "sortBy": "new",
  "topTime": "week",
  "startUrls": [
    "https://www.reddit.com/r/javascript/comments/1t9jt9w/bluejs_compile_javascript_to_12mb_native_binaries/"
  ],
  "usernames": [
    "spez",
    "GallowBoob"
  ],
  "maxItems": 50,
  "includeComments": false,
  "deepScraping": true,
  "includeRecentPosts": false,
  "includeRecentComments": false,
  "includeCommentAuthors": true,
  "fetchProfileDetails": false,
  "headless": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "subreddit": "javascript",
    "searchQuery": "nodejs tutorial",
    "startUrls": [
        "https://www.reddit.com/r/javascript/comments/1t9jt9w/bluejs_compile_javascript_to_12mb_native_binaries/"
    ],
    "usernames": [
        "spez",
        "GallowBoob"
    ],
    "maxItems": 50,
    "includeComments": false,
    "deepScraping": true,
    "includeRecentPosts": false,
    "includeRecentComments": false,
    "includeCommentAuthors": true,
    "fetchProfileDetails": false,
    "headless": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapeai/reddit-advanced-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 = {
    "subreddit": "javascript",
    "searchQuery": "nodejs tutorial",
    "startUrls": ["https://www.reddit.com/r/javascript/comments/1t9jt9w/bluejs_compile_javascript_to_12mb_native_binaries/"],
    "usernames": [
        "spez",
        "GallowBoob",
    ],
    "maxItems": 50,
    "includeComments": False,
    "deepScraping": True,
    "includeRecentPosts": False,
    "includeRecentComments": False,
    "includeCommentAuthors": True,
    "fetchProfileDetails": False,
    "headless": True,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapeai/reddit-advanced-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 '{
  "subreddit": "javascript",
  "searchQuery": "nodejs tutorial",
  "startUrls": [
    "https://www.reddit.com/r/javascript/comments/1t9jt9w/bluejs_compile_javascript_to_12mb_native_binaries/"
  ],
  "usernames": [
    "spez",
    "GallowBoob"
  ],
  "maxItems": 50,
  "includeComments": false,
  "deepScraping": true,
  "includeRecentPosts": false,
  "includeRecentComments": false,
  "includeCommentAuthors": true,
  "fetchProfileDetails": false,
  "headless": true
}' |
apify call scrapeai/reddit-advanced-scraper --silent --output-dataset

```

## MCP server setup

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