# Reddit Multi-Mode Scraper for Posts, Comments & Profiles (`nimbryxo-studio/reddit-multi-mode-scraper-for-posts-comments`) Actor

Pick one of five modes to pull subreddit posts, full comment threads, user profiles, keyword search results or curated community listings from Reddit, each with deep post/comment filters. No account or API key needed.

- **URL**: https://apify.com/nimbryxo-studio/reddit-multi-mode-scraper-for-posts-comments.md
- **Developed by:** [Nimbryxo-studio](https://apify.com/nimbryxo-studio) (community)
- **Categories:** Social media, Automation, Lead generation
- **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 Multi-Mode Scraper for Posts, Comments & Profiles

Extract public Reddit data without an account, cookie, or API key. Choose a subreddit feed, specific post URLs with their comment trees, a user profile and history, or a keyword search. Every record is JSON with a stable `recordType` (`post`, `comment`, `profile`, or `community`), the original `dataType`, and a `source` tag so mixed datasets stay easy to audit.

### What this actor does

- **Four modes:** `subreddit` (post listings), `post` (one or more post URLs plus comments), `profile` (account metadata, posts and comments), and `search` (posts, comments, communities, and users).
- **Two data sources with provenance:** `live` reads Reddit's public rendered pages, while `archive` reads the Arctic Shift historical snapshot. `auto` uses live data first and archive for depth, bulk history, or fallback.
- **Full comment trees:** the archive path returns nested replies with `depth` and `parent_id`; live mode starts with the visible tree and expands top-level pages up to your cap.
- **Rich post fields:** score, upvote ratio, comment count, flair, domain, media URLs, galleries, video metadata, awards, crossposts, NSFW/spoiler/locked flags, and derived engagement metrics.
- **Filters and incremental runs:** score, comment count, upvote ratio, date range, post type, text matches, author allow/deny lists, flair, domain, awards, and an optional `onlyNew` watermark.
- **Empty fields are omitted:** records never contain `null`, empty strings, or empty arrays/objects.

### Output per post

- `recordType: "post"`, `dataType: "post"`, `source`, `sourceDetail`, `fetchedAt`, `snapshotFreshness`
- `id`, `post_id`, `post_name`, `title`, `author`, `author_id`, `author_meta`
- `subreddit`, `subreddit_prefixed`, `subreddit_id`, `subreddit_subscribers`, `subreddit_type`
- `content` / `body`, `content_html`, `content_url`, `url`, `permalink`, `domain`, `is_self`, `post_type`, `media_type`
- `score`, `ups`, `downs`, `upvote_ratio`, `num_comments`, `commentCount`, `gilded`, `total_awards_received`, `awards[]`
- `link_flair`, flair colors/classes/richtext, `thumbnail_url`, `images[]`, `gallery_images[]`, `gallery_count`
- `video_url`, `video_duration_seconds`, `video_width`, `video_height`, `video_has_audio`, `video_bitrate_kbps`
- `poll_data`, embed metadata, `crosspost_parent_id`
- `created_utc`, `created_at`, `createdAt`, `edited`, `edited_at`
- `is_nsfw`, `nsfw`, `is_spoiler`, `is_stickied`, `is_locked`, `is_archived`, `is_original_content`, `is_crosspost`
- `derived` (`ageHours`, `scorePerHour`, `commentsPerHour`, `engagementTotal`)
- `warning` and `degraded` when the record came from the archive snapshot

### Output per comment

- `recordType: "comment"`, `dataType: "comment"`, `source`, `sourceDetail`, `fetchedAt`
- `id`, `comment_id`, `comment_name`, `post_id`, `post_url`, `post_title`, `link_id`
- `parent_id`, `parentId`, `parent_kind`, `depth`, `body`, `body_html`
- `author`, `author_id`, `author_meta`
- `subreddit`, `subreddit_prefixed`, `subreddit_id`, `subreddit_type`
- `score`, `ups`, `downs`, `controversiality`, `gilded`, `total_awards_received`, `awards[]`
- `is_op`, `is_stickied`, `is_locked`, `collapsed`, `removed_by_category`
- `replies_count`, `replies`, `created_utc`, `created_at`, `createdAt`, `edited`, `edited_at`, `permalink`
- `coverage` on the parent post when comment coverage is known
- `warning` and `degraded` for archive records

### Output per profile

- `recordType: "profile"`, `dataType: "user_profile"`, `source`, `fetchedAt`
- `id`, `username`, `user_id`, `profile_url`, `icon_img`, `snoovatar_img`
- `karma` (`total`, `post`, `comment`), plus the flat `post_karma`, `comment_karma`, `total_karma`
- `post_count`, `comment_count`, `created_utc`, `created_at`, `createdAt`
- `description`, `is_gold`, `is_mod`, `is_employee`, `has_verified_email`, `verified`
- Profile history records are emitted as separate `post` and `comment` records.

### Output per community

Community records appear when `includeSubredditInfo`, `searchCommunities`, or the MCP `get_subreddit_info` tool is used.

- `recordType: "community"`, `dataType: "community"`, `source`, `fetchedAt`
- `id`, `subreddit`, `subreddit_prefixed`, `subreddit_id`, `url`, `title`
- `subscribers`, `active_user_count`, `created_utc`, `created_at`, `createdAt`
- `description`, `public_description`, `subreddit_type`, `over18`, `quarantine`
- `rules[]` when rules are requested

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `subreddit` | `subreddit`, `post`, `profile`, or `search`. Legacy `comments` maps to `post`; `posts`, `profiles`, and `subreddits` are accepted aliases. |
| `source` | string | `auto` | `auto`, `live`, or `archive`. `auto` prefers live data and uses the archive for depth, history, or fallback. |
| `subreddits` | array | `["programming"]` | Subreddits for `mode=subreddit`; names, `r/` names, and URLs are accepted. |
| `postUrls` | array | - | Post URLs, comment URLs, share links, or bare post IDs for `mode=post`. |
| `usernames` | array | - | Reddit usernames for `mode=profile`; `u/` names and profile URLs are accepted. |
| `searchQuery` | string | - | Keyword or phrase for `mode=search`. Reddit search operators are supported by the live path. |
| `maxItems` | int | `50` | Hard cap on all records emitted by the run (1-10,000). |
| `maxPosts` | int | `25` | Posts per subreddit, keyword, or profile section (1-5,000). |
| `maxComments` | int | `100` | Comments per post, keyword, or profile comment section; `0` disables comment records. |
| `maxDepth` | int | `6` | Deepest reply level to emit (0-20). |
| `includeComments` | bool | `true` | Emit comment records in `mode=post`. |
| `includePost` | bool | `true` | Emit the parent post record before its comments in `mode=post`. |
| `sort` | string | `hot` | `hot`, `new`, `top`, `rising`, `controversial`, `best`, or search values `relevance` and `comments`. |
| `timeFilter` | string | `day` | `hour`, `day`, `week`, `month`, `year`, or `all`. |
| `commentSort` | string | `confidence` | `confidence`, `top`, `new`, `controversial`, `old`, or `qa`. |
| `includeNSFW` | bool | `false` | Include over-18 posts and communities. |
| `includeSubredditInfo` | bool | `false` | Emit one community record per subreddit. |
| `includeSubredditRules` | bool | `false` | Attach rules to community records. |
| `includeProfileInfo` | bool | `true` | Emit the profile record in `mode=profile`. |
| `sections` | array | `["overview"]` | Profile history sections: `overview`, `posts`, `comments`. |
| `searchPosts` / `searchComments` / `searchCommunities` / `searchUsers` | bool | posts on | Select which result types `mode=search` returns. |
| `withinCommunity` | string | - | Restrict search to one subreddit; required for archive keyword search. |
| `maxCommunities` / `maxUsers` | int | `10` / `25` | Caps for community and user search results. |
| `onlyNew` | bool | `false` | Emit only records newer than the watermark stored under `stateKey`. |
| `stateKey` | string | `reddit-mcp-state` | Key-value store key prefix for `onlyNew` watermarks. |
| `failOnEmpty` | bool | `true` | Fail the run with a clear message when no records are found. |
| `proxyMode` | string | `none` | `none`, `datacenter`, or `residential`. Residential is an explicit fallback and is capped by `maxProxyBytesMb`. |
| `maxProxyBytesMb` | int | `50` | Stop the run before paid proxy traffic exceeds this many megabytes. |
| `minScore` / `maxScore` | int | - | Score range for posts and comments. |
| `minPostComments` / `maxPostComments` | int | - | Comment-count range for posts. |
| `minUpvoteRatio` | number | - | Minimum post upvote ratio (0-1). |
| `postType` | string | - | `self`, `link`, `image`, `video`, `gallery`, or `poll`. |
| `titleContains` / `contentContains` / `flairContains` / `authorFlairContains` | string | - | Case-insensitive text matches. |
| `domain` | string | - | Link domain contains this text. |
| `authors` / `excludeAuthors` | array | - | Author allow/deny lists. |
| `excludeKeywords` | array | - | Drop posts whose title, body, or flair contains any term. |
| `excludeStickied` / `excludeRemoved` / `excludeCrossposts` / `excludeSpoilers` / `excludeLocked` / `excludeDeletedAuthor` / `excludeArchived` | bool | `false` | Exclusion toggles. |
| `onlyWithFlair` / `onlyOriginalContent` | bool | `false` | Flair and OC filters. |
| `minAwards` | int | - | Minimum total awards. |
| `minContentLength` / `maxContentLength` | int | - | Body length range. |
| `postedAfter` / `postedBefore` | string | - | UTC date bounds (`YYYY-MM-DD`); `postedBefore` is inclusive. |
| `restrictSubreddits` | array | - | Keep profile history only from these subreddits. |
| `keyword` | string | - | Keep profile posts/comments containing this phrase. |
| `minCommunitySubscribers` / `maxCommunitySubscribers` | int | - | Community search size filters. |
| `minUserKarma` / `maxUserKarma` | int | - | User search karma filters. |
| `distinguished` | string | - | `moderator`, `admin`, `special`, or `none`. |

### Example: subreddit listing

```json
{
  "mode": "subreddit",
  "subreddits": ["programming", "r/Python"],
  "sort": "top",
  "timeFilter": "week",
  "maxItems": 100,
  "maxPosts": 50,
  "includeNSFW": false
}
```

### Example: post URLs with comments

```json
{
  "mode": "post",
  "postUrls": [
    "https://www.reddit.com/r/programming/comments/1xbl8y1/",
    "https://www.reddit.com/r/Python/s/example"
  ],
  "maxComments": 250,
  "maxDepth": 6,
  "includePost": true,
  "source": "auto"
}
```

### Example: profile and history

```json
{
  "mode": "profile",
  "usernames": ["spez"],
  "sections": ["overview"],
  "maxPosts": 25,
  "maxComments": 50,
  "postedAfter": "2026-01-01"
}
```

### Example: keyword search

```json
{
  "mode": "search",
  "searchQuery": "asyncio",
  "withinCommunity": "python",
  "searchPosts": true,
  "searchComments": true,
  "sort": "relevance",
  "timeFilter": "month",
  "maxItems": 50
}
```

### MCP server (Standby)

The actor runs a native Streamable HTTP MCP server at `/mcp` when started in Standby mode. It exposes five typed tools that reuse the same scrapers as the batch modes:

| Tool | What it returns |
|---|---|
| `search_reddit` | Posts, comments, communities, or users matching a query, with optional subreddit scope, sort, time window, and NSFW toggle. |
| `get_subreddit_posts` | A subreddit's posts with sort, time window, NSFW toggle, and item cap. |
| `get_post_comments` | One post plus its flat, depth-tagged comments, with `max_comments`, `max_depth`, comment sort, and an optional parent-post record. |
| `get_user_profile` | Profile metadata plus recent posts/comments for one user. |
| `get_subreddit_info` | Community metadata, optional rules, subscriber count, and description. |

MCP responses include `items`, `count`, `source`, and `degraded`; archive-backed responses also include a freshness warning. Use the Actor's Standby URL followed by `/mcp`:

```json
{
  "mcpServers": {
    "reddit": {
      "type": "streamable-http",
      "url": "https://<your-actor-standby-host>/mcp",
      "headers": {
        "Authorization": "Bearer <your-apify-token>"
      }
    }
  }
}
```

### Use cases

- **Community monitoring:** follow new and top posts in a set of subreddits on a schedule with `onlyNew`.
- **Thread research:** export a full comment tree for sentiment, topic, or quote analysis.
- **Creator and moderator analysis:** profile karma, posting history, and subreddit participation.
- **Trend discovery:** keyword search across Reddit posts and comments, optionally scoped to one community.
- **AI and RAG pipelines:** consume flat JSON records or call the MCP tools from an agent.
- **Moderation and compliance review:** filter by flair, domain, score, date, NSFW, and author.

### Data source, freshness, and cost

Live records come from Reddit's public rendered pages. The archive path uses the Arctic Shift historical snapshot, which typically lags live Reddit by several hours and can have fewer comments or older scores. Archive records are marked `source: "archive"`, `degraded: true`, and include a `warning`; the `snapshotFreshness` field distinguishes them from live data.

The actor defaults to 1 GB of memory; Apify bills the run by allocated memory and any proxy traffic. Browser requests block images, fonts, and media to keep traffic and cost down. No proxy is used by default; `datacenter` is available when Reddit blocks a run, and `residential` is an explicit last resort. `maxProxyBytesMb` stops the run when the configured proxy traffic ceiling is reached.

### FAQ

#### Do I need a Reddit account or API key?

No. The actor reads public pages and a public archive, and no cookies, login, or API key are required.

#### Why do live and archive records disagree on score or comment count?

The archive is a historical crawl. Live pages reflect the current score, upvote ratio, and comment count; archive records can be several hours stale and are marked `degraded`.

#### Why are some comments missing from a very large thread?

Live mode starts with the comments Reddit renders and expands top-level pages up to `maxComments`; replies can be limited by Reddit's pagination. Use `source: "auto"` or `"archive"` for deeper trees, and check the parent post's `coverage` fields.

#### Why did my search return fewer results than expected?

Reddit limits search result pages and caps many queries. The actor follows the available result pages up to `maxItems`; use a narrower `withinCommunity`, a different sort, or a broader time window.

#### What does `onlyNew` do?

It stores a watermark in the key-value store under `stateKey` and emits only records newer than the previous run. Archive watermarks keep a small overlap so a late-indexed comment is not skipped.

#### Does the actor work for private or quarantined communities?

No. Only public, cookieless content is supported. NSFW posts can be included with `includeNSFW`, but login-gated or quarantined communities are out of scope.

#### How do I get community rules?

Set `includeSubredditInfo` and `includeSubredditRules` in `mode=subreddit`, or call the `get_subreddit_info` MCP tool with `include_rules: true`.

#### How do I keep runs cheap?

Use `source: "archive"` when you only need historical posts or deep trees, keep `maxItems` and `maxComments` small, and leave `proxyMode` at `none`. The actor defaults to 1 GB of memory and does not download images, fonts, or media. If you choose a proxy, `maxProxyBytesMb` stops the run when its traffic ceiling is reached.

#### Is this affiliated with Reddit?

No. This is a third-party tool that reads public Reddit pages and a public archive. Respect Reddit's terms and applicable law when using the data.

# Actor input Schema

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

What to scrape: a subreddit listing, post URLs with comments, a user profile, or keyword search.

## `source` (type: `string`):

auto uses live Reddit first and the Arctic Shift archive for depth/bulk or as a fallback. archive is faster and cheaper but lags live Reddit by several hours; live never uses archive data.

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

Subreddits to scrape (mode=subreddit). Accepts names, r/ names or URLs.

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

Post URLs, comment URLs, share links or bare post IDs (mode=post).

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

Reddit usernames to scrape (mode=profile). Accepts names, u/ names or profile URLs.

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

Keyword or phrase to search for (mode=search). Reddit search syntax such as "exact phrase", author:name, subreddit:name and -exclude is supported by live search.

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

Hard cap on all records pushed by the run, across every target.

## `maxPosts` (type: `integer`):

Posts per subreddit, keyword or profile section.

## `maxComments` (type: `integer`):

Comments per post, keyword, or profile comment section. 0 disables comment records.

## `maxDepth` (type: `integer`):

Deepest reply level to emit (0 = top-level comments only).

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

Emit comment records for each post. Disable to fetch only the parent post.

## `includePost` (type: `boolean`):

Emit the post record before its comments.

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

Post/listing sort. Search accepts relevance, hot, top, new or comments; other modes use hot, new, top, rising, controversial or best.

## `timeFilter` (type: `string`):

Time window for top/controversial sorts and search.

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

Comment ordering for mode=post.

## `includeNSFW` (type: `boolean`):

Include over-18 posts and communities.

## `includeSubredditInfo` (type: `boolean`):

Emit one community record per subreddit before its posts.

## `includeSubredditRules` (type: `boolean`):

Attach posting rules to the community record. Requires includeSubredditInfo.

## `includeProfileInfo` (type: `boolean`):

Emit a profile record with karma, counts and account metadata.

## `sections` (type: `array`):

Which history sections to fetch (mode=profile). Allowed values: overview, posts, comments.

## `searchPosts` (type: `boolean`):

Include post results in keyword search.

## `searchComments` (type: `boolean`):

Include comment results in keyword search when Reddit's comment tab returns them.

## `searchCommunities` (type: `boolean`):

Include subreddit matches in keyword search.

## `searchUsers` (type: `boolean`):

Include matching Reddit accounts in keyword search.

## `withinCommunity` (type: `string`):

Limit post/comment search to a single subreddit (name, r/name or URL). Required for archive keyword search.

## `maxCommunities` (type: `integer`):

Maximum subreddit matches per search query.

## `maxUsers` (type: `integer`):

Maximum account matches per search query.

## `onlyNew` (type: `boolean`):

Emit only records newer than the watermark saved under stateKey by a previous run.

## `stateKey` (type: `string`):

Key-value store key prefix used by onlyNew watermarks.

## `failOnEmpty` (type: `boolean`):

Mark the run FAILED with a clear status message instead of finishing silently with 0 records.

## `maxProxyBytesMb` (type: `integer`):

Safety ceiling for paid proxy traffic. The run stops when the ceiling is reached. Images, media and fonts are never downloaded.

## `proxyMode` (type: `string`):

Direct (no proxy) is the default. Choose datacenter if Reddit blocks your runs. Residential is an explicit last resort and is capped by maxProxyBytesMb.

## `minScore` (type: `integer`):

Drop posts/comments below this score.

## `maxScore` (type: `integer`):

Drop posts/comments above this score.

## `minPostComments` (type: `integer`):

Drop posts with fewer comments than this.

## `maxPostComments` (type: `integer`):

Drop posts with more comments than this.

## `minUpvoteRatio` (type: `number`):

Drop posts below this upvote ratio (0-1).

## `postType` (type: `string`):

Keep only posts of this type.

## `titleContains` (type: `string`):

Keep only posts whose title contains this text.

## `contentContains` (type: `string`):

Keep only posts whose body/self-text contains this text.

## `flairContains` (type: `string`):

Keep only posts whose link flair contains this text.

## `authorFlairContains` (type: `string`):

Keep only posts whose author flair contains this text.

## `domain` (type: `string`):

Keep only posts whose link domain contains this text.

## `authors` (type: `array`):

Keep posts by these usernames.

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

Drop posts by these usernames.

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

Drop posts whose title, body or flair contains any of these terms.

## `excludeStickied` (type: `boolean`):

Exclude pinned/stickied posts from results.

## `excludeRemoved` (type: `boolean`):

Exclude posts or comments removed by moderators.

## `excludeCrossposts` (type: `boolean`):

Exclude crossposts.

## `excludeSpoilers` (type: `boolean`):

Exclude posts marked as spoilers.

## `excludeLocked` (type: `boolean`):

Exclude locked posts and comments.

## `excludeDeletedAuthor` (type: `boolean`):

Exclude records whose author account was deleted.

## `excludeArchived` (type: `boolean`):

Exclude archived posts that no longer accept votes or comments.

## `onlyWithFlair` (type: `boolean`):

Drop posts without a link flair.

## `onlyOriginalContent` (type: `boolean`):

Keep only posts tagged as OC.

## `minAwards` (type: `integer`):

Keep only posts with at least this many awards.

## `minContentLength` (type: `integer`):

Keep only posts whose body is at least this many characters.

## `maxContentLength` (type: `integer`):

Keep only posts whose body is at most this many characters.

## `postedAfter` (type: `string`):

UTC date lower bound (YYYY-MM-DD).

## `postedBefore` (type: `string`):

UTC date upper bound (YYYY-MM-DD), inclusive.

## `restrictSubreddits` (type: `array`):

Only keep profile posts/comments made in these subreddits.

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

Only keep profile posts/comments whose title, body or text contains this phrase.

## `minCommunitySubscribers` (type: `integer`):

Community search only: drop smaller subreddits.

## `maxCommunitySubscribers` (type: `integer`):

Community search only: drop larger subreddits.

## `minUserKarma` (type: `integer`):

User search only: drop accounts with less total karma.

## `maxUserKarma` (type: `integer`):

User search only: drop accounts with more total karma.

## `distinguished` (type: `string`):

Keep only moderator/admin/special posts, or only regular posts.

## Actor input object example

```json
{
  "mode": "subreddit",
  "source": "archive",
  "subreddits": [
    "programming",
    "r/Python"
  ],
  "postUrls": [
    "https://www.reddit.com/r/programming/comments/1vqukkf/",
    "1xbw0h8"
  ],
  "usernames": [
    "spez"
  ],
  "searchQuery": "asyncio",
  "maxItems": 2,
  "maxPosts": 2,
  "maxComments": 5,
  "maxDepth": 6,
  "includeComments": true,
  "includePost": true,
  "sort": "hot",
  "timeFilter": "day",
  "commentSort": "confidence",
  "includeNSFW": false,
  "includeSubredditInfo": false,
  "includeSubredditRules": false,
  "includeProfileInfo": true,
  "sections": [
    "posts"
  ],
  "searchPosts": true,
  "searchComments": false,
  "searchCommunities": false,
  "searchUsers": false,
  "withinCommunity": "r/technology",
  "maxCommunities": 10,
  "maxUsers": 25,
  "onlyNew": false,
  "stateKey": "reddit-mcp-state",
  "failOnEmpty": true,
  "maxProxyBytesMb": 50,
  "proxyMode": "none",
  "authors": [],
  "excludeAuthors": [],
  "excludeKeywords": [],
  "excludeStickied": false,
  "excludeRemoved": false,
  "excludeCrossposts": false,
  "excludeSpoilers": false,
  "excludeLocked": false,
  "excludeDeletedAuthor": false,
  "excludeArchived": false,
  "onlyWithFlair": false,
  "onlyOriginalContent": false,
  "restrictSubreddits": []
}
```

# Actor output Schema

## `redditRecords` (type: `string`):

Dataset containing post, comment, profile or community records (see `recordType`). Every record carries `source` (live/archive), `fetchedAt` and, for archive data, `snapshotFreshness` plus a warning.

# 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": "subreddit",
    "source": "archive",
    "subreddits": [
        "programming"
    ],
    "postUrls": [],
    "usernames": [],
    "searchQuery": "",
    "maxItems": 2,
    "maxPosts": 2,
    "maxComments": 5,
    "maxDepth": 6,
    "includeComments": false,
    "includePost": true,
    "sort": "hot",
    "timeFilter": "day",
    "commentSort": "confidence",
    "includeNSFW": false,
    "includeSubredditInfo": false,
    "includeSubredditRules": false,
    "includeProfileInfo": true,
    "sections": [
        "posts"
    ],
    "searchPosts": true,
    "searchComments": false,
    "searchCommunities": false,
    "searchUsers": false,
    "maxCommunities": 0,
    "maxUsers": 0,
    "onlyNew": false,
    "stateKey": "reddit-mcp-state",
    "failOnEmpty": false,
    "maxProxyBytesMb": 50,
    "proxyMode": "none",
    "authors": [],
    "excludeAuthors": [],
    "excludeKeywords": [],
    "excludeStickied": false,
    "excludeRemoved": false,
    "excludeCrossposts": false,
    "excludeSpoilers": false,
    "excludeLocked": false,
    "excludeDeletedAuthor": false,
    "excludeArchived": false,
    "onlyWithFlair": false,
    "onlyOriginalContent": false,
    "restrictSubreddits": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("nimbryxo-studio/reddit-multi-mode-scraper-for-posts-comments").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": "subreddit",
    "source": "archive",
    "subreddits": ["programming"],
    "postUrls": [],
    "usernames": [],
    "searchQuery": "",
    "maxItems": 2,
    "maxPosts": 2,
    "maxComments": 5,
    "maxDepth": 6,
    "includeComments": False,
    "includePost": True,
    "sort": "hot",
    "timeFilter": "day",
    "commentSort": "confidence",
    "includeNSFW": False,
    "includeSubredditInfo": False,
    "includeSubredditRules": False,
    "includeProfileInfo": True,
    "sections": ["posts"],
    "searchPosts": True,
    "searchComments": False,
    "searchCommunities": False,
    "searchUsers": False,
    "maxCommunities": 0,
    "maxUsers": 0,
    "onlyNew": False,
    "stateKey": "reddit-mcp-state",
    "failOnEmpty": False,
    "maxProxyBytesMb": 50,
    "proxyMode": "none",
    "authors": [],
    "excludeAuthors": [],
    "excludeKeywords": [],
    "excludeStickied": False,
    "excludeRemoved": False,
    "excludeCrossposts": False,
    "excludeSpoilers": False,
    "excludeLocked": False,
    "excludeDeletedAuthor": False,
    "excludeArchived": False,
    "onlyWithFlair": False,
    "onlyOriginalContent": False,
    "restrictSubreddits": [],
}

# Run the Actor and wait for it to finish
run = client.actor("nimbryxo-studio/reddit-multi-mode-scraper-for-posts-comments").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": "subreddit",
  "source": "archive",
  "subreddits": [
    "programming"
  ],
  "postUrls": [],
  "usernames": [],
  "searchQuery": "",
  "maxItems": 2,
  "maxPosts": 2,
  "maxComments": 5,
  "maxDepth": 6,
  "includeComments": false,
  "includePost": true,
  "sort": "hot",
  "timeFilter": "day",
  "commentSort": "confidence",
  "includeNSFW": false,
  "includeSubredditInfo": false,
  "includeSubredditRules": false,
  "includeProfileInfo": true,
  "sections": [
    "posts"
  ],
  "searchPosts": true,
  "searchComments": false,
  "searchCommunities": false,
  "searchUsers": false,
  "maxCommunities": 0,
  "maxUsers": 0,
  "onlyNew": false,
  "stateKey": "reddit-mcp-state",
  "failOnEmpty": false,
  "maxProxyBytesMb": 50,
  "proxyMode": "none",
  "authors": [],
  "excludeAuthors": [],
  "excludeKeywords": [],
  "excludeStickied": false,
  "excludeRemoved": false,
  "excludeCrossposts": false,
  "excludeSpoilers": false,
  "excludeLocked": false,
  "excludeDeletedAuthor": false,
  "excludeArchived": false,
  "onlyWithFlair": false,
  "onlyOriginalContent": false,
  "restrictSubreddits": []
}' |
apify call nimbryxo-studio/reddit-multi-mode-scraper-for-posts-comments --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/reddit-multi-mode-scraper-for-posts-comments"
        }
    }
}
```

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/TvCs8gaYvL352HNwD/builds/ilFk20SGtzrsuw9Db/openapi.json
