# Reddit Scraper - Posts, Comments, Search & Subreddits (`fetch_cat/reddit-scraper`) Actor

Export public Reddit posts and comments from subreddit, user, search, post, comment, and short-link URLs for social listening, lead research, AI datasets, and alerts.

- **URL**: https://apify.com/fetch_cat/reddit-scraper.md
- **Developed by:** [Fetch Cat](https://apify.com/fetch_cat) (community)
- **Categories:** Social media, Lead generation, AI
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 92 total users, 19 monthly users, 94.7% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.07 / 1,000 post extracteds

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 Scraper** exports public Reddit posts and optional comments from subreddit feeds, keyword searches, user submissions and individual discussion URLs. Use the structured text and source links for social listening, research, spreadsheets or AI-assisted summaries.

Get available post text, images, video previews, post flair and discussion context alongside public scores and timestamps. Select **Full details · text, media and context** in the dataset, or open the **Full details** run-output link, to see the expanded fields. Unavailable values remain null. This is a public snapshot, not a complete Reddit archive.

### Quick start

1. Open the Actor and enter a public Reddit URL or a search query.
2. Start with a small post limit and leave comments off until the results are relevant.
3. Run the Actor and open its dataset to inspect and export the records.

```json
{
  "searchQuery": "web scraping",
  "sort": "new",
  "timeFilter": "week",
  "maxPostsPerSource": 5,
  "includeComments": false
}
```

When using this search recipe in the form, clear the prefilled URLs and subreddit restriction if you want only a global keyword search. URLs and a search query supplied together are both processed.

Prefer a video guide? This short Apify walkthrough shows you how to set up and run an Actor. It uses a different Actor, but the setup steps are the same.

https://youtu.be/1OW8gOqlZbY?t=25

### Ready-to-run examples

Choose a small, preconfigured example and adjust its target before running.

- [Scrape posts from a subreddit](https://apify.com/fetch_cat/reddit-scraper/examples/scrape-subreddit-posts) — Collect up to three posts with bounded optional comments.
- [Scrape Reddit posts by keyword](https://apify.com/fetch_cat/reddit-scraper/examples/scrape-reddit-posts-by-keyword) — Search for web scraping discussions without comment collection.
- [Review a public Reddit thread with comments](https://apify.com/fetch_cat/reddit-scraper/examples/reddit-public-thread-review) — Request a small comment sample from one public thread. Replace the thread URL if it is no longer available.

### What you get

- **Several public sources:** Subreddit listings, keyword searches, user submissions, post URLs and focused comment URLs.
- **Useful text and context:** Post or comment text, public author information, permalinks, source context and available timestamps.
- **Optional comments:** Bounded comment collection with parent and depth information when available.
- **Reusable records:** A dataset plus a `RUN_SUMMARY` record describing counts, partial results and source errors.

### Who is it for?

- **Market researchers:** Find questions, objections and public product discussions.
- **Community teams:** Review a focused subreddit or topic snapshot.
- **Analysts and developers:** Export structured discussion text for downstream classification, summaries or retrieval datasets.

### Input settings

Provide at least one URL, a nonempty `searchQuery`, or `searchQueries`. A `searchSubreddit` requires at least one query. No field is globally required because URL-only and search-only inputs are both supported.

| Setting | JSON key | Purpose |
| --- | --- | --- |
| Reddit URLs | `urls` | Up to 100 subreddit, user, search, post, comment, short or `/r/community/s/token` Share links. |
| Single URL aliases | `url`, `comment_url`, `commentUrl` | One target. Equal aliases coalesce; conflicts fail before extraction. With a nonempty `urls` batch, the alias must exactly match one trimmed batch target. |
| Keywords | `filterKeywords` | Up to 100 nonempty keywords, at most 256 characters each. Empty list keeps all records. |
| Match mode | `filterMode` | `any` (default), `all`, `titleOnly` or `exactPhrase`. See matching rules below. |
| AI export | `outputFormat` | `default` (dataset only), `jsonl-finetune` or `rag-markdown` (dataset plus an export file). |
| Search query | `searchQuery` | Global keyword search or search within one subreddit. Uses your original spelling without Reddit's automatic spell correction; no matches produce an empty dataset with a run-summary reason. |
| Additional searches | `searchQueries` | Optional array of up to 100 nonempty queries, at most 512 characters each. Combined with `searchQuery`; repeated query strings run once. Every query uses the same sort, time filter, subreddit scope and per-source post cap. |
| Deduplicate posts | `deduplicatePosts` | Default `true` preserves one saved/charged post across sources and pages. `false` keeps a separate post row per source occurrence; repeated pages within a source and duplicate comments still deduplicate. Each saved post row uses the unchanged post-event price. |
| Search subreddit | `searchSubreddit` | Restrict all keyword searches to one community. |
| Sort order | `sort` | `hot`, `new`, `top`, `rising` or `relevance`. Default `hot`. |
| Time filter | `timeFilter` | `hour`, `day`, `week`, `month`, `year` or `all` where supported. Default `week`. |
| Maximum posts per source | `maxPostsPerSource` | Requested cap from 1 to 1000. Default 20, not a completeness guarantee. |
| Include comments | `includeComments` | Collect comments on discovered posts. Default `false`. |
| Maximum comments per post | `maxCommentsPerPost` | Comment cap from 0 to 1000. Default 10. |
| Comment URL mode | `commentContextMode` | `focused` or `post`. Default `focused`. |
| Comment context depth | `commentContextDepth` | Up to 0–10 known ancestors after the focused target, within the comment cap. Default 3. |
| Comment levels | `commentDepth` | Optional 1–10 known levels. 1 keeps depth 0; 10 keeps depths 0–9. Omitted preserves legacy depth behavior. Unknown depth stays null and is retained. |
| Retry attempts | `retryCount` | Bounded request retries. Default 4. |
| Initial retry delay | `initialRetryDelayMillis` | Base delay in milliseconds. Default 750. |
| Request pacing | `requestPacingMillis` | Minimum request spacing in milliseconds. Default 750. |
| Safe run deadline | `runTimeSecs` | Run work budget in seconds. Default 260. |
| MCP connectors | `mcpConnectors` | Optional post-run delivery destinations. |
| MCP delivery mode | `mcpMode` | `off`, `sendSummary` or `sendRecords`. Default `off`. |
| Delivery instruction | `mcpInstruction` | Short instruction for selected connectors. Do not include credentials. |
| Maximum MCP records | `maxMcpRecords` | Cap the delivered sample. Default 20. |
| Connection configuration | `proxyConfiguration` | Existing direct-only and managed connection settings remain supported. Managed connections can incur additional platform costs. |

Explicit sort and time settings in a Reddit URL take precedence over the corresponding form settings. User URLs collect submitted posts, not private user activity.

#### Multiple searches and source outcomes

```json
{
  "searchQueries": ["web scraping", "data extraction"],
  "sort": "new",
  "timeFilter": "week",
  "maxPostsPerSource": 5,
  "deduplicatePosts": true
}
```

Clear prefilled URLs/subreddit when requesting only these global searches. Search-derived rows add `searchQuery` (the query that first saved the row); `sourceIndex` links every newly saved row to its source occurrence. With deduplication enabled, a post already saved by an earlier query is not saved or charged again. Source work is sequential and bounded by the existing run/request/charge limits, so large batches may stop before all queries finish.

`RUN_SUMMARY.sourceResults` reports each source separately: `status` (`complete`, `partial`, `failed`), `requested`, `delivered`, `commentsDelivered` and `stopReason`. Counts describe saved rows attributed to that source, after filtering/deduplication; a complete source can deliver fewer than requested when exhausted, empty, filtered or duplicated elsewhere. A configured post limit is normal completion, not an error; deadline, safety page caps, blocks and charge limits are reported explicitly. Unstarted sources after a limit are partial, not successful-empty. No summary/status rows are inserted into the dataset.

For media/link posts with no exposed self-text, the existing `warnings` array now uses `NO_SELF_TEXT`; the nullable `text`/`selfText` fields and all exports remain unchanged. Unknown/text-type body absence remains `BODY_NOT_EXPOSED`. Media posts that expose text retain it. This adds no body-fetch fallback. Existing smaller HTML fragments, gzip/Brotli decoding and session-scoped keep-alive proxy tunnels are reused. Omitted API proxy settings already try direct before residential fallback; explicit proxy selections and opt-outs remain authoritative.

#### Keyword matching and Share links

Matching applies per record, before saving or result-event charging. It uses Unicode NFKC normalization, lowercase text and collapsed whitespace. Keywords are literal substrings, not regular expressions:

- `any`: at least one keyword in title or body.
- `all`: every keyword in title or body.
- `titleOnly`: any keyword in the post title; comment rows have no title and do not match.
- `exactPhrase`: all supplied keyword entries joined, in order, with one space, matched in title or body.

A filtered post is not expanded for comments. Empty filtered results contain no placeholder rows and incur no post/comment events; the existing batch startup event still applies.

Only subreddit Share `/r/community/s/token` links are supported; user-profile Share links are rejected with a canonical-post instruction. A Share link must identify the intended public post. If it cannot be resolved, use the canonical `/comments/<post-id>/...` URL instead. Existing limits and connection preferences remain unchanged.

#### Comment depth and partial coverage

Available comment depths and verified parent relationships are retained. A depth-zero comment can use the discussion as its parent. Unknown ancestry stays null with a warning.

Collection stays within finite record and time limits. Focused mode selects the requested comment first, then available known ancestors and replies within your cap; the target counts toward that cap. `targetCommentId`, `isTargetComment` and `commentContextRole` distinguish the target from its context. Post mode collects a bounded ordinary-thread selection. Useful saved rows remain available if later collection is incomplete; check `warnings` and the run summary. Neither mode promises a complete archive.

### Output data

Rows have `type: "post"` or `type: "comment"`. Fields unavailable from the source are null rather than estimated.

| Fields | Meaning |
| --- | --- |
| `type`, `id`, `thingId` | Record type and available Reddit identifiers. |
| `subreddit`, `title`, `text` | Community, title and extracted text. |
| `selfText`, `body` | Post text or comment body where applicable. |
| `author`, `authorUrl` | Public author name and profile link when available. |
| `url`, `permalink`, `externalUrl`, `domain` | Reddit and external links. |
| `isSelfPost` | Whether the post is a text/self post when known. |
| `createdAt`, `publishedAt`, `scrapedAt` | Source timestamps and collection time. |
| `score`, `upvoteRatio`, `awardCount` | Actual available vote score, upvote ratio and award count; never estimated. |
| `numComments`, `commentCount` | Available public comment count, or null. |
| `parentId`, `depth` | Comment context when available, not guaranteed for every route. |
| `thumbnailUrl` | Available thumbnail link. |
| `isSubmitter`, `distinguished`, `isStickied`, `isLocked`, `flairText`, `editedAt` | Available public flags, comment author flair and edit timestamp. `flairText` remains author flair, not post link flair. Unavailable values stay null. |
| `sourceKind`, `sourceInputUrl`, `sourceUrl` | Source classification, supplied URL and resolved source. |
| `rssMetadataLimited`, `warnings` | Legacy compatibility flag and field/context limitations. A false flag does not promise every field is available. |

#### Expanded fields and availability

All additions are optional. Existing fields, separate post/comment rows, overview columns and named export links retain their meanings. Old saved rows may omit the new fields and are not fetched or billed again.

| Fields | Use and availability |
| --- | --- |
| `postType`, `postLanguage` | Explicit content category and post language when available. `multi_media` can describe a text post with links; it does not guarantee attached images, a gallery or video. |
| `imageUrls`, `media` | Available post or comment image links and image/video/preview details, including known dimensions and captions. Preview and original sizes can refer to the same image. Gallery images retain source order; completeness is not guaranteed. If a post supplies only text and hyperlinks, media fields remain null; its links appear in `bodyLinks`. |
| `videoUrl`, `videoPreviewUrl`, `videoPosterUrl` | Available public video, preview clip and poster links. A preview need not be the full video or contain sound. No media is downloaded. |
| `videoDurationSeconds`, `videoHasAudio` | Only explicitly available duration/audio information; usually null when not provided. |
| `linkFlairText` | Post link flair. Existing `flairText` still means comment author flair. |
| `authorId`, `authorAvatarUrl`, `subredditId`, `subredditIconUrl` | Available public identities and icons. Avatars, community icons and award icons are never post images. |
| `isNSFW`, `isSpoiler`, `isArchived`, `isCrosspost`, `isOriginalContent`, `isPromoted`, `isEvent` | Explicit post flags only. Missing means null, not false. |
| `subredditIsNSFW`, `subredditIsQuarantined` | Explicit community flags when available. Community subscriber counts are not supplied or estimated. |
| `crosspostParentId` | Original discussion ID for a known crosspost when available. |
| `postId`, `postTitle` | Comment's discussion ID and already-known title. Comment `title` stays unchanged. No extra profile/community lookups are enabled. |
| `targetCommentId`, `isTargetComment`, `commentContextRole` | Requested focused comment and its target/ancestor/reply role. Ordinary comments use `thread`; the target flag is null outside focused selection. |
| `sourceCommentCount`, `commentCoverage` | Public discussion total versus a `focused_context` or `limited_selection`. The source total does not mean that many comments were collected. |
| `parentPermalink`, `replyCount` | Available parent link and explicit reply count, never the number of selected replies presented as a full total. |
| `awardId`, `awardIconUrl` | Featured award identity/icon when available, not a complete award inventory. `awardCount` retains actual known counts, including zero. |
| `bodyLinks` | Available public links in the text, deduplicated in source order. |

GIF-only and image-only comments retain their public assets in `media`, `imageUrls` or `videoUrl`; their `body` is null with `MEDIA_ONLY_COMMENT` rather than invented text. Text-and-media comments keep both. Explicit anonymous deleted-reply placeholders are skipped without inventing an identity or charging for them; other public replies continue to be collected. No media is downloaded.

Media details are bounded to 100 entries and body links to 100, with additional size limits; row warnings identify a reached limit. Unknown values remain null, and known zero/false values are preserved. Some sources expose fewer fields than others: discovery results can have less context, individual discussions can lack media or language, and comment-only requests may not know a post title. No subscriber counts, full reply totals or complete-thread coverage are guessed.

`RUN_SUMMARY.options.commentCollections` separates the source total, selected comments and newly persisted comments for each collection in the current execution. After recovery, these per-collection counts do not replace the run-wide saved totals. The comments HTTP response also includes `commentSelection` with selected, returned and persisted counts. Filters, limits and previously saved rows can make these counts differ.

Synthetic shape-only example, not an observed Reddit record:

```json
{
  "type": "post",
  "id": null,
  "title": "Example discussion title",
  "text": "Example public discussion text",
  "score": null,
  "upvoteRatio": null,
  "rssMetadataLimited": false,
  "warnings": []
}
```

#### Download your results

Open your run's dataset and select **Full details · text, media and context** to inspect post `text`/`selfText` and the expanded fields. The existing **Reddit records** overview is unchanged. The run's **Full details** output link opens the enriched view directly; API users can request dataset items with `view=fullDetails`. Existing `view=overview` links still work.

Choose **Export** and select JSON, CSV or Excel. JSON keeps nested media together. For spreadsheets, select the full-details fields you need. Standard dataset records contain the additive fields regardless of the selected display view.

For `outputFormat: "jsonl-finetune"` or `"rag-markdown"`, the default dataset remains unchanged. The run also exposes **AI export file** (`AI_EXPORT`) and **AI export verification** (`EXPORT_INFO`) links in its output. These files exist only for selected AI modes; default mode adds no export storage work.

- **Training JSONL:** each line contains only a `messages` array with system/user/assistant chat messages. Source IDs and links appear in user text; the assistant text is the actual available post title/body or comment body, not generated labels or sentiment. This is a source-text reproduction corpus, not a curated instruction-following dataset. Review rights, privacy and suitability before training.
- **RAG Markdown:** source-attributed text sections include stable `thingId` (or permalink fallback), links, available metadata and honest parent/depth values. No model or paid AI provider is called.
- **Context:** when a parent already appeared in the preceding 128 exported records, at most 512 characters are included as an explicitly labelled excerpt. Missing or out-of-order context is not invented. This is not full-thread reconstruction.
- **Bounds and recovery:** output is streamed from saved rows to a temporary disk file and uploaded without accumulating the dataset. A record is capped at 4 MiB and the file at 128 MiB, under the existing run deadline. Export errors fail truthfully while leaving the saved dataset available. Restart overwrites the same export from the durable dataset; it does not add post/comment events. `EXPORT_INFO` reports the count, bytes and SHA-256 for verification. Export count must agree with saved record counts; no additional result-event fee is charged.

Example AI export input:

```json
{
  "url": "https://www.reddit.com/r/webscraping/",
  "maxPostsPerSource": 5,
  "filterKeywords": ["scraping"],
  "filterMode": "any",
  "outputFormat": "jsonl-finetune",
  "includeComments": false
}
```

See [Apify's download and export guide](https://docs.apify.com/storage/dataset#apify-console) for the available formats and field options.

### Pricing

This Actor uses pay-per-event pricing. The `start` event is a one-time run charge after input and connection setup.

The `item` event charges for saved post records. The `comment` event charges for saved comment records. Source-error diagnostics are not dataset records. Comment collection can produce many more charged rows than posts alone.

See the [live Pricing tab](https://apify.com/fetch_cat/reddit-scraper/pricing) for current rates, upcoming prices and discounts.

When Reddit explicitly identifies the requested community as private, batch mode returns no rows for that source and records `PUBLIC_COMMUNITY_PRIVATE` in `RUN_SUMMARY.options.sourceOutcomes`. An all-private batch uses `EMPTY_UNAVAILABLE`. Mixed batches retain available public records. The normal batch start charge still applies. Generic blocking, malformed responses and unfinished extraction remain errors or partial outcomes.

### Tips for best results

- **Start with a small sample.** Check relevance before increasing post or comment limits.
- **Choose focused sources.** A community-specific search is easier to review than a broad keyword.
- **Add comments deliberately.** Use a small comment cap when only a sample is needed.
- **Inspect partial results.** Review `RUN_SUMMARY` and row warnings before treating missing values as facts.
- **Resume the same run safely.** After an interrupted run is resurrected, already saved records are retained without charging for them again. Requested comments can continue within the original run's remaining time and request limits; resurrection does not start a fresh allowance. Separate new runs collect and charge for records again.

### Limits and caveats

- Only publicly available content is supported. Private, login-gated and moderator-only data are outside scope.
- Public pages and search indexes expose limited records. Pagination follows available cursors, but a high requested limit does not guarantee that many results or a complete archive.
- Comments are best-effort. Full thread coverage, vote scores and full tree depth are not guaranteed.
- Sources may be blocked or unavailable. Mixed-source runs can keep useful rows and report partial results. If every source fails, the current Actor can fail with no records. Inaccessibility does not prove privacy or deletion.
- This Actor collects data. It does not label sentiment, create embeddings, train models or deduplicate across separate runs.
- Oversized or invalid source content remains a visible collection error, not a successful empty result. Finite size and time limits preserve saved output and leave time for exports and summaries. Diagnostic counters in the run summary are not an invoice or a completeness guarantee.

### Automation and integrations

#### Save your settings for next time

Once you have an input that works for you, [save it as an Apify task](https://docs.apify.com/actors/running/tasks). This keeps your settings together so you can use them again without filling in the form from scratch.

#### Run on a schedule

Need fresh results regularly? You can [schedule the Actor or a saved task](https://docs.apify.com/actors/running/schedules) to run at a time that suits you.

Each scheduled run collects the data again. If you want to compare results or highlight changes, add that step in your own workflow.

#### Send results to your other tools

Use **n8n, Make or Zapier** to connect this scraper to the rest of your workflow. For example, you could pass its results to an AI assistant or add records to a spreadsheet. Follow the [Apify integration guides](https://docs.apify.com/integrations) for your chosen tool.

For a custom connection, an [Apify webhook](https://docs.apify.com/integrations/webhooks) can notify your app when a run finishes or fails. Your app can then fetch the results or handle the failure.

### Short-request HTTP API

Preview builds are restricted to the Actor owner; supplied identity headers cannot unlock them. Normal caller access begins only after verified publication.

The short HTTP API uses authenticated on-demand **SINGLE_TENANT Standby** endpoints. Use the canonical URL from the Actor's **Endpoints** tab once enabled, not a per-run container URL. There is no always-warm allocation. Standby build/settings overrides are locked: caller Task/query settings cannot select an unreviewed historical HTTP build; the service uses the configured release build. The linked [OpenAPI description](.actor/web_server_schema.json) specifies the request and response schemas.

```bash
## Set REDDIT_STANDBY_URL to the verified canonical URL displayed in Endpoints.
curl "$REDDIT_STANDBY_URL/subreddit/posts" \
  -H "X-Apify-Authorization: Bearer $APIFY_TOKEN" \
  -H "X-Reddit-Authorization: Bearer $APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: public-post-snapshot-001' \
  -d '{"subreddit":"webscraping","limit":5,"filterKeywords":["scraping"],"filterMode":"any"}'
```

- `POST /subreddit/posts`: public community name, up to 20 posts, the batch keyword modes, listing `sort`/`timeFilter` and `proxyMode`.
- `POST /post/comments`: `postId` or canonical/Share `url`, up to 50 available comments only (no paid post context row); optional `commentDepth` 1–10, context depth 0–10 and legacy `focused`/`post` context modes. Known depths are filtered; unavailable ancestry stays null. Partial collection retains useful available comments.
- `GET /ready`: readiness only, no scraping or output charge.

Use your own Apify token in **both** headers as shown: `X-Apify-Authorization` for [platform authentication](https://docs.apify.com/actors/running/standby), and `X-Reddit-Authorization` for independent application authentication. Do not substitute the reserved `Authorization` header for the custom application header. The application checks this token only against the fixed trusted Apify current-user API and requires the identity to match the authenticated SINGLE_TENANT run. Tokens/profile data are never journaled, logged or returned. Missing, invalid or cross-account credentials are rejected before Reddit work, including direct-container requests with forged Host/identity headers. Never supply an owner/third-party token or a fabricated caller/run/request identity. The platform creates a separate caller run; each operation has its own dataset and durable caller-owned result journal. One active request per run serializes its SDK budget. Successful saved rows use the unchanged `item`/`comment` events, with **no custom batch `start` event** on the HTTP path. [Standby platform usage costs are billed to the calling user in addition to event charges](https://docs.apify.com/actors/running/standby); idle time and explicitly selected proxy traffic can add cost. `charged` reports acknowledged counts; pending/error snapshots use null for an unacknowledged charge, never a false zero.

Keep the same **Idempotency-Key and exact parameters** when retrying, even across separate runs of your account. Completed responses replay without another scrape or charge. Terminal collection failures (including cached 429 responses) acknowledge zero output-event charges and remain cached for that key. They normally use `retryable:false`; temporary configured-proxy unavailability uses a retryable 502, but replaying its completed key still returns the cached result without repeating extraction. Platform/proxy usage may still apply. After the cause or server cooldown clears, deliberately start a new operation/key only for such a known no-result failure; never do this for pending or uncertain output/billing. Reusing a key for different parameters returns 409. Pending/interrupted/uncertain requests do not re-execute paid work: inspect the original run, charge history and returned dataset before considering another operation. Do not change the key to bypass an uncertain charge. The caller-owned deduplication store retains up to 10,000 keys; it is not a disposable process cache.

Bounds: 8 KiB JSON body, 256 KiB response, up to 20 posts or 50 comments, 55-second request budget, 100 requests/run and at most 270 seconds of run lifetime. Default `proxyMode:"direct"` preserves direct-only access; `automatic` explicitly permits managed connection usage and associated platform costs. Failed required collection returns an error, not fabricated empty success. Explicitly confirmed unavailable or no-match targets return an empty collection with a reason; inaccessibility alone does not prove privacy or deletion. Partial results identify limits. The first matching record exceeding the response limit returns 413; use batch mode for larger payloads or AI export files. Both endpoints provide the same additive fields where available, with smaller limits than batch mode; complete threads are not promised.

### API usage

Want to collect this data from your own app or automation? The examples below send input to the scraper and show how to collect its results.

The Node.js and Python examples wait for the run to finish before reading its results. The cURL example starts the run and returns its details. Wait for that run to finish, then use its `defaultDatasetId` to fetch the results.

For setup instructions, see Apify's [JavaScript client guide](https://docs.apify.com/api/client/js), [Python client guide](https://docs.apify.com/api/client/python) and [Actor runs API reference](https://docs.apify.com/api/v2/acts-runs-post).

#### cURL

```bash
curl -X POST 'https://api.apify.com/v2/acts/fetch_cat~reddit-scraper/runs' \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"searchQuery":"web scraping","sort":"new","maxPostsPerSource":5,"includeComments":false}'
```

#### Node.js

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('fetch_cat/reddit-scraper').call({
  searchQuery: 'web scraping',
  sort: 'new',
  maxPostsPerSource: 5,
  includeComments: false,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('fetch_cat/reddit-scraper').call(run_input={
    'searchQuery': 'web scraping',
    'sort': 'new',
    'maxPostsPerSource': 5,
    'includeComments': False,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

### MCP and AI agents

You can ask your AI assistant to collect data with **Reddit Scraper** and help you work with the results. The scraper returns the data, and your assistant can then summarize it, compare records or prepare notes.

Connect your assistant through the [Apify MCP server](https://mcp.apify.com/). MCP gives your assistant a way to find this scraper, run it and read the results. Follow the [official setup and sign-in guide](https://docs.apify.com/mcp) for your app.

#### Easier setup with an Apify plugin

If you use a supported coding assistant, the [official Apify plugin](https://docs.apify.com/agents/plugins) can set up the connection for you. It connects your assistant to Apify and includes instructions for common tasks. Follow the guide for your particular app.

#### Use Apify AI in Console

Prefer to keep everything in Apify? Open [Apify AI in Console](https://docs.apify.com/account/apify-ai) and ask it to find Fetch Cat's **Reddit Scraper**. You can describe the data you want and ask questions about the results.

Apify AI is currently in beta. It asks for confirmation before starting an Actor, and normal run charges apply.

#### Choose your assistant

- **Claude and Claude Code (Anthropic):** [Apify setup guide](https://docs.apify.com/integrations/claude).
- **ChatGPT and Codex (OpenAI):** [Apify setup guides](https://docs.apify.com/integrations/openai).
- **Grok Bot (xAI):** [Apify plugin guide](https://docs.apify.com/integrations/grok-bot).
- **Gemini CLI (Google):** [MCP server setup guide](https://geminicli.com/docs/tools/mcp-server/). Use the server URL below with the HTTP configuration supported by Gemini CLI.

#### Connect just this scraper

To keep your setup focused on this scraper, add this server configuration to a compatible MCP client:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=fetch_cat/reddit-scraper"
    }
  }
}
```

Sign in to Apify when your client asks. If your client uses a Bearer token instead, follow its setup guide and keep the token in its secure configuration. Configuration formats vary by app, so use the linked guide if your client needs a different format.

#### Use Apify's general server

Already connected to the general Apify MCP server at `https://mcp.apify.com`? You can use it to find this scraper without adding another server. Ask your assistant to use **Reddit Scraper** by Fetch Cat, or give it the identifier `fetch_cat/reddit-scraper`.

Your assistant can check the available settings and retrieve the results from the returned run. If the run is still working, it should follow that run rather than start it again. Both connection options use Apify's hosted service.

#### Example requests

- "Collect five recent Reddit posts about web scraping and summarize the main questions with source links."
- "Get a small sample of posts from the webscraping subreddit, include a few comments, and compare the recurring topics."
- "Retrieve the available public comments from this Reddit thread and prepare a concise discussion summary with links."

Normal Apify charges apply. Check the [live Pricing tab](https://apify.com/fetch_cat/reddit-scraper/pricing) before asking your assistant to run a larger batch.

### Pay with x402

If your AI agent has a funded wallet, it can pay for Apify usage through [x402](https://docs.apify.com/integrations/x402). This experimental option lets an agent use Apify without a conventional account.

[Apify AGI](https://agi.apify.com/) provides a prepaid API token with a spending cap after payment. Your agent can use that token to run this scraper through the Apify API or an authenticated MCP connection.

Some MCP setups also support paying for each request directly. That is a different payment option, so check the official guide for its availability.

Follow the official guide for wallet setup, supported payment options and current terms. Apify handles the payments. Keep wallet keys and payment tokens in your agent's secure configuration.

#### Other ways for agents to pay

Apify also supports **MPP** for prepaid access through AGI and **Skyfire** for eligible Actors. If your agent already uses one of these, see the [agentic payment guide](https://docs.apify.com/agents/payments) to choose the right setup.

### Build a Reddit dataset for research or RAG

Use this Actor as the collection layer for public-discussion research. Your downstream pipeline handles quality checks, labels, embeddings and storage. Keep source links, available parent IDs and warnings with the text. Do not rely on scores or complete thread structure being present.

For new matching post discovery with cross-run deduplication, consider [Reddit Post Monitor Lite](https://apify.com/fetch_cat/reddit-post-monitor-lite). Selected public post URLs can then be supplied here when comments are needed.

### FAQ

#### Does this Actor need Reddit API credentials?

No. It collects public discussion data without Reddit login credentials.

#### Can it collect every comment in a thread?

No. Access restrictions and source limits can prevent complete collection. The requested comment cap is an upper bound, not a completeness promise.

#### Can I export Reddit data to CSV or Excel?

Yes. Export the run dataset in Apify Console or retrieve records through the Dataset API.

#### Why are vote scores or comment counts missing?

Not every public source exposes every field. Available metrics are retained; check null values and `warnings` rather than assuming an absent metric is zero.

#### Can I use it as a Reddit API alternative with an AI assistant?

Yes, for its documented public-data coverage. Use the API or Apify MCP connection above. It is not the official Reddit API and does not provide private data or every API feature.

#### How do I check charges or choose another tool?

Review the live Pricing tab before a large run. For post discovery with persistent deduplication, compare Reddit Post Monitor Lite below. For complete historical archives or authenticated data, this Actor is not the right fit.

### Related Actors

- [Reddit Post Monitor Lite](https://apify.com/fetch_cat/reddit-post-monitor-lite) — Discover new matching posts with cross-run deduplication.
- [Hacker News Search Scraper](https://apify.com/fetch_cat/hacker-news-search-scraper) — Research public technology discussions.
- [Substack Posts Scraper](https://apify.com/fetch_cat/substack-posts-scraper) — Collect public newsletter posts.
- [Telegram Channel Posts Scraper](https://apify.com/fetch_cat/telegram-channel-posts-scraper) — Collect public channel posts.
- [YouTube Comments Scraper](https://apify.com/fetch_cat/youtube-comments-scraper) — Research video discussions.

### Support and feedback

For custom additions or integrations, email <hello@fetchcat.dev>.

Found an error or have a feature request? [Open an issue](https://apify.com/fetch_cat/reddit-scraper/issues) with the run URL, a non-sensitive input example and what you expected.

Need help sharing it? See [Apify’s guide to sharing a run when reporting an issue](https://docs.apify.com/account/collaboration/general-resource-access#automatically-sharing-runs-via-actor-issues). Sharing a run can give the developer access to its input, logs and results, so use a run that contains no sensitive data. Please leave out API tokens, passwords, cookies, private documents and personal data. Use a public sample URL or a redacted example instead.

Tried this scraper? We'd love to hear how it worked for you. [Leave a review](https://apify.com/fetch_cat/reddit-scraper/reviews) to help others choose the right tool and help us improve it. Your feedback means a lot to us. If the review page is unavailable, open the [Actor page](https://apify.com/fetch_cat/reddit-scraper) instead.

Made with care for curious people, AI agents and the possibilities in data. ♥

# Changelog

This Actor's version history is a separate document: https://apify.com/fetch_cat/reddit-scraper/changelog.md

# Actor input Schema

## `urls` (type: `array`):

Subreddit, post, comment, user profile, Reddit search, or Reddit Share /r/community/s/token URLs. Share redirects must resolve to an exact safe public post; unresolved links fail explicitly instead of scraping the community. At most 100 targets.

## `url` (type: `string`):

Convenience alias for urls. If other aliases or urls are also provided, the target must agree; conflicting targets are rejected before extraction.

## `comment_url` (type: `string`):

Compatibility alias for a single Reddit URL. Must agree with url/commentUrl and any nonempty urls batch.

## `commentUrl` (type: `string`):

Compatibility alias for comment_url. Conflicting aliases are rejected.

## `filterKeywords` (type: `array`):

Keep matching records only, before saving or charging. Case-insensitive Unicode NFKC normalization; whitespace is collapsed. Literal substrings, not regular expressions. Empty list keeps all records. Each keyword must contain text.

## `filterMode` (type: `string`):

any: any keyword in title/body; all: every keyword in title/body; titleOnly: any keyword in the post title (comments have no title and do not match); exactPhrase: keywords joined in order with a single space, in title/body. Filtering is per record. A filtered post is not expanded for comments.

## `outputFormat` (type: `string`):

default preserves the dataset only. AI modes additionally export the same saved records to the AI_EXPORT key-value file (strict messages-only training JSONL or RAG Markdown) and EXPORT_INFO. No additional event charges. Exports are bounded to 128 MiB total and 4 MiB per record; split larger inputs. Parent excerpts are available only from the preceding 128 exported records, at most 512 characters each; not a complete thread.

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

Optional Reddit search query. Used with global Reddit search unless Search subreddit is filled.

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

Up to 100 nonempty queries, each at most 512 characters. Combined with searchQuery; repeated query strings run once. Each uses the same subreddit, sort, time filter and per-source post cap. Total work remains bounded by the run deadline.

## `deduplicatePosts` (type: `boolean`):

Default true preserves existing behavior: save and charge each post once across sources/queries. False retains a separate post row per source occurrence; page repeats within that source and duplicate comments are still removed. Additional saved rows incur existing post event charges.

## `searchSubreddit` (type: `string`):

Optional subreddit name for restricting searchQuery and searchQueries, for example technology or webscraping.

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

Sort mode for subreddit listings and public searches.

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

Time window for top listings and public search where supported.

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

Maximum requested post records per source, within finite collection limits. Reddit may expose fewer records than requested; incomplete collection is reported explicitly.

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

Collect available comments for discovered posts, up to maxCommentsPerPost. Useful saved rows remain available if later collection is incomplete; inspect the partial summary.

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

Maximum number of comment records to save per post when comments are enabled.

## `commentDepth` (type: `integer`):

Optional 1–10 known reply levels: 1 includes depth 0, 10 includes depths 0–9. Omitted keeps available levels. Unknown depths stay null and are retained with a warning. Does not promise full-thread completeness.

## `commentContextMode` (type: `string`):

For comment URLs, focused selects the exact target first, bounded known ancestors and available replies. Post collects the ordinary thread. Limits include the target; unknown ancestry is never fabricated.

## `commentContextDepth` (type: `integer`):

Maximum known ancestors included after the focused comment target, within the comment limit.

## `retryCount` (type: `integer`):

Maximum recovery attempts after a temporary collection failure, within the original run deadline.

## `initialRetryDelayMillis` (type: `integer`):

Base waiting time in milliseconds after a temporary collection failure.

## `requestPacingMillis` (type: `integer`):

Minimum collection pacing in milliseconds, within the original run deadline.

## `runTimeSecs` (type: `integer`):

Stops starting Reddit requests before the platform timeout so partial records and diagnostics can be saved cleanly.

## `mcpConnectors` (type: `array`):

Connector(s) this Actor may use after scraping, such as Slack, Notion, Supabase, or another MCP-compatible destination. The actor discovers tools at runtime and only calls safe send/post/write/create/insert/append/log-style tools.

## `mcpMode` (type: `string`):

Off by default. Choose Summary to send only a compact run digest, or Records to include capped sample records after saving the dataset.

## `mcpInstruction` (type: `string`):

Short instruction for the selected connector, for example: Send a digest to #social-listening. Do not paste API keys or third-party credentials here.

## `maxMcpRecords` (type: `integer`):

Maximum number of scraped records included when MCP delivery mode sends records. The full dataset remains available separately.

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

Existing connection preferences are preserved. The form defaults to managed US residential access. Set useApifyProxy to false for direct-only access, or supply your own proxyUrls. Omitted API settings allow managed US access when needed; explicit groups and countries remain supported. Managed connection usage can incur platform costs. No additional connection setting is required for expanded output.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://www.reddit.com/r/technology/"
    },
    {
      "url": "https://www.reddit.com/r/webscraping/"
    }
  ],
  "filterMode": "any",
  "outputFormat": "default",
  "searchQuery": "web scraping tools",
  "deduplicatePosts": true,
  "searchSubreddit": "technology",
  "sort": "hot",
  "timeFilter": "week",
  "maxPostsPerSource": 20,
  "includeComments": false,
  "maxCommentsPerPost": 10,
  "commentContextMode": "focused",
  "commentContextDepth": 3,
  "retryCount": 4,
  "initialRetryDelayMillis": 750,
  "requestPacingMillis": 750,
  "runTimeSecs": 260,
  "mcpMode": "off",
  "mcpInstruction": "Send a concise Reddit monitoring digest to #social-listening.",
  "maxMcpRecords": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

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

No description

## `fullDetails` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

## `aiExport` (type: `string`):

No description

## `exportInfo` (type: `string`):

No description

## `mcpDeliveryStatus` (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 = {
    "urls": [
        {
            "url": "https://www.reddit.com/r/technology/"
        },
        {
            "url": "https://www.reddit.com/r/webscraping/"
        }
    ],
    "searchQuery": "web scraping tools",
    "deduplicatePosts": true,
    "searchSubreddit": "technology",
    "mcpInstruction": "Send a concise Reddit monitoring digest to #social-listening."
};

// Run the Actor and wait for it to finish
const run = await client.actor("fetch_cat/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 = {
    "urls": [
        { "url": "https://www.reddit.com/r/technology/" },
        { "url": "https://www.reddit.com/r/webscraping/" },
    ],
    "searchQuery": "web scraping tools",
    "deduplicatePosts": True,
    "searchSubreddit": "technology",
    "mcpInstruction": "Send a concise Reddit monitoring digest to #social-listening.",
}

# Run the Actor and wait for it to finish
run = client.actor("fetch_cat/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 '{
  "urls": [
    {
      "url": "https://www.reddit.com/r/technology/"
    },
    {
      "url": "https://www.reddit.com/r/webscraping/"
    }
  ],
  "searchQuery": "web scraping tools",
  "deduplicatePosts": true,
  "searchSubreddit": "technology",
  "mcpInstruction": "Send a concise Reddit monitoring digest to #social-listening."
}' |
apify call fetch_cat/reddit-scraper --silent --output-dataset

```

## MCP server setup

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