# Reddit Scraper – Posts, Comments & Users (`techforce.global/reddit-scraper`) Actor

Scrape Reddit posts, comments, users, no login or API key. Search or paste URLs, filter by keyword/date, export to JSON/CSV/Excel or push to Notion, Slack & more.

- **URL**: https://apify.com/techforce.global/reddit-scraper.md
- **Developed by:** [Techforce Global](https://apify.com/techforce.global) (community)
- **Categories:** Social media, Agents, News
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 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/platform/actors/running/actors-in-store#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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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 Scraper & MCP Connector

Scrape **posts, comments, communities, and user profiles from any corner of Reddit** — from subreddits, individual threads, user pages, or keyword searches — as clean, structured data with full engagement metrics. **No Reddit login, no API keys, no app registration, no code.**

Built for market researchers, brand and social teams, analysts, and builders who need Reddit's real, unfiltered discussion as ready-to-use data — in minutes, not hours of scrolling and copy-pasting.

> **Paste a subreddit, thread, user, or search → get posts, comments, and metrics → deliver them straight into Notion, Slack, Jira, or your CRM.**

---

### ⭐ Why This Actor?

- ✅ **Just paste a URL or a search term** — subreddits (`r/…`), sorted subreddits, single posts, user profiles (`user/…`), and search pages all work. Or skip URLs entirely and type keywords to search. No login, API key, or OAuth setup required.
- ✅ **Four data types in one run** — posts, comments, communities (subreddits), and users, each as a flat, clearly-typed record.
- ✅ **Full engagement data** — score, upvotes, upvote ratio, comment counts, awards, karma, subscriber counts, and more.
- ✅ **Deep comment trees** — follow reply threads to the depth you choose, with threading info (`parentId`, `depth`, `postId`) preserved.
- ✅ **Filter as you scrape** — keyword filters, date ranges, and an NSFW toggle keep your dataset focused.
- ✅ **Media extraction** — pull thumbnails, images, videos, galleries, and external links from posts.
- ✅ **No 403s, no keys** — loads Reddit in a **real headless Chromium browser**, so Reddit serves its `.json` data exactly like it would to a genuine visitor. Nothing to authenticate.
- ✅ **Anti-block resilient** — runs through **Apify Proxy** (residential recommended) with automatic recovery on rate limits.
- ✅ **Deliver anywhere via MCP connectors** — push results straight into Notion, Slack, Jira, GitHub, Linear, Airtable, and more.
- ✅ **Export-ready** — JSON, CSV, Excel, HTML, or direct API integration for your own pipeline.

---

### 📝 Use Cases & ROI

| Use Case | Time Saved | What You Get |
| --- | --- | --- |
| **Market & brand research** | 3–6 hrs/topic | Everything people say about your product, competitors, or industry |
| **Trend & lead discovery** | 2–4 hrs/niche | Rising posts, active communities, and influential users in a space |
| **Sentiment & content analysis** | 4–8 hrs/dataset | Posts and full comment threads ready for NLP / AI pipelines |
| **Training data / RAG & AI** | 5–10 hrs/dataset | Structured discussion data to feed models, search, or Q&A |
| **Academic & data science** | 3–6 hrs/study | Datasets of discussions, karma, and engagement over time |

---

### 🚀 How to Use

1. Open the Actor on Apify.
2. Add one or more **Start URLs** (a subreddit, post, user, or search page) and/or type **Search terms**.
3. Choose what searches should return — **posts, comments, communities, or users** — and how to **sort** them.
4. Set your limits: **Max items**, **posts per source**, **comments per post**, and **comment depth**.
5. _(Optional)_ Filter with **keywords**, **date range**, and the **NSFW** toggle.
6. _(Optional)_ Pick an **MCP connector** to deliver each result into Notion, Slack, Jira, etc.
7. Click **Run** — results stream into the dataset as each source is processed.
8. Download as CSV, Excel, JSON, or HTML — or let the connector push them into your tools automatically.

> 🌐 **Proxy**: keep **Apify Proxy** enabled (residential is best). Reddit rate-limits by IP, and a rotating residential proxy lets the Actor recover automatically if a request is throttled.
> 💡 First time with a connector? Run once with a connector selected — the run log prints the connector's available tool names, so you know what to put in **Connector tool name**.

---

### 🧩 Input Configuration

You can drive the scraper with **Start URLs**, **Search terms**, or both. Supported start URL types:

| URL type | Example | What you get |
| --- | --- | --- |
| Subreddit | `https://www.reddit.com/r/technology/` | Community info + its posts (and comments) |
| Sorted subreddit | `https://www.reddit.com/r/technology/top/?t=week` | Top posts this week |
| Post | `https://www.reddit.com/r/AskReddit/comments/abc123/...` | The post + its comment tree |
| User | `https://www.reddit.com/user/spez/` | Profile + their posts and comments |
| Search | `https://www.reddit.com/search/?q=bitcoin` | Matching posts |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `startUrls` | Array | ➖ One of | Direct Reddit URLs: subreddits, posts, users, or search pages. |
| `searches` | Array | ➖ One of | Keywords to search on Reddit (used with **Search for** below). |
| `searchType` | Enum | Optional | What each search returns: `posts`, `comments`, `communities`, or `users`. Default: `posts`. |
| `sort` | Enum | Optional | Sort order: `relevance`, `hot`, `top`, `new`, `rising`, `comments`. Default: `new`. |
| `time` | Enum | Optional | Time window for `top`/`relevance`: `hour`, `day`, `week`, `month`, `year`, `all`. Default: `all`. |
| `commentSort` | Enum | Optional | Comment order within a post: `confidence` (best), `top`, `new`, `controversial`, `old`, `qa`. Default: `top`. |
| `maxItems` | Integer | Optional | Total dataset items cap across the whole run (`0` = unlimited). Default: `100`. |
| `maxPostCount` | Integer | Optional | Max posts per subreddit / search / user (`0` = unlimited). Default: `50`. |
| `maxComments` | Integer | Optional | Max comments per post (`0` = skip comments). Default: `20`. |
| `maxCommentDepth` | Integer | Optional | How deep to follow reply threads (`1` = top-level, `0` = unlimited). Default: `3`. |
| `maxCommunitiesCount` | Integer | Optional | Max communities per source (`0` = unlimited). Default: `10`. |
| `maxUserCount` | Integer | Optional | Max users per source (`0` = unlimited). Default: `10`. |
| `skipComments` | Boolean | Optional | Post data only — faster and cheaper. Default: `false`. |
| `skipUserPosts` | Boolean | Optional | For user URLs, return only the profile (no posts/comments). Default: `false`. |
| `skipCommunityInfo` | Boolean | Optional | For subreddit URLs, skip the community "about" item. Default: `false`. |
| `includeNSFW` | Boolean | Optional | Include content marked NSFW (`over_18`). Default: `true`. |
| `keywords` | Array | Optional | Keep only items whose title/body/text contains one of these (case-insensitive). |
| `postDateFrom` / `postDateTo` | String | Optional | Date filter — `YYYY-MM-DD` or relative like `7 days`, `3 months`. |
| `extractMedia` | Boolean | Optional | Extract image/video/gallery URLs, thumbnails, and links. Default: `true`. |
| `dedupItems` | Boolean | Optional | Drop duplicate items within a run. Default: `true`. |
| `proxyConfiguration` | Object | Optional | Proxy used for requests. Residential/rotating strongly recommended for larger runs. |
| `maxConcurrency` | Integer | Optional | Max parallel requests (1–50). Lower it if you hit rate limits. Default: `10`. |
| `maxRequestRetries` | Integer | Optional | Retries for a failed/blocked request. Default: `5`. |
| `mcpConnector` | Connector | Optional | Deliver results into a connector you've authorized (Notion, Slack, Jira, GitHub, Linear, Airtable, …). |
| `deliveryMode` | Enum | Optional | `perItem` (one call per item), `summary` (one digest call for the run), or `none`. Default: `perItem`. |
| `mcpTool` | String | Optional | Tool to call on the connector (e.g. `create_page`, `send_message`, `create_issue`). |
| `mcpArguments` | Object | Optional | Arguments for the tool; string values support `{placeholders}`. |
| `mcpMessageTemplate` | String | Optional | Template rendered per item/run, exposed as the `{message}` placeholder. |

#### Example — Scrape a subreddit and a search

```json
{
    "startUrls": [{ "url": "https://www.reddit.com/r/technology/top/?t=week" }],
    "searches": ["artificial intelligence"],
    "searchType": "posts",
    "sort": "top",
    "time": "week",
    "maxItems": 200,
    "maxPostCount": 50,
    "maxComments": 20,
    "maxCommentDepth": 3
}
````

#### Example — Filtered, post-only run

```json
{
    "startUrls": [{ "url": "https://www.reddit.com/r/MachineLearning/" }],
    "maxItems": 100,
    "skipComments": true,
    "includeNSFW": false,
    "keywords": ["openai", "llm"],
    "postDateFrom": "30 days",
    "proxyConfiguration": { "useApifyProxy": true }
}
```

***

### 📦 Output Fields

Every result is a flat JSON object with a `type` field — `post`, `comment`, `community`, or `user`. The Output tab has ready-made views for each. Download as **JSON, HTML, CSV, or Excel**.

| Field | Applies to | Description |
| --- | --- | --- |
| `type` | all | `post`, `comment`, `community`, or `user` |
| `id` / `parsedId` | all | Reddit item ID and full name (`t3_…`, `t1_…`, etc.) |
| `title` / `body` | posts / comments | Post title & self-text, or comment text |
| `author` / `subreddit` | posts, comments | Author username and subreddit |
| `url` | all | Permalink to the item |
| `link` / `domain` | posts | Outbound link and its domain (for link posts) |
| `flair` | posts | Post flair text |
| `score` / `upVotes` / `upvoteRatio` | posts, comments | Engagement metrics |
| `numberOfComments` / `numberOfCrossposts` / `awardsCount` | posts | Post activity counts |
| `depth` / `parentId` / `postId` | comments | Comment threading info |
| `numberOfReplies` | comments | Direct replies to a comment |
| `over18` / `spoiler` / `locked` / `stickied` | posts | Content flags |
| `media` | posts | Thumbnail, images, video, gallery, external link |
| `username` / `linkKarma` / `commentKarma` / `totalKarma` | users | Profile and karma |
| `isGold` / `isMod` / `isEmployee` / `verified` | users | Account flags |
| `name` / `numberOfMembers` / `activeUsers` | communities | Subreddit name and size |
| `description` / `longDescription` | communities, users | Public description / sidebar text |
| `createdAt` / `createdTimestamp` | all | Creation time (ISO 8601 + Unix) |

#### Example Output

```json
{
    "type": "post",
    "id": "1abc23",
    "subreddit": "technology",
    "title": "New AI model released",
    "body": "Full self-text here...",
    "author": "example_user",
    "url": "https://www.reddit.com/r/technology/comments/1abc23/...",
    "link": "https://example.com/article",
    "score": 4213,
    "upVotes": 4500,
    "upvoteRatio": 0.95,
    "numberOfComments": 812,
    "flair": "AI",
    "over18": false,
    "createdAt": "2026-07-08T14:03:21+00:00",
    "media": {
        "thumbnail": "https://...",
        "images": ["https://..."],
        "video": null,
        "gallery": [],
        "externalLink": "https://example.com/article"
    }
}
```

> Note: some fields only appear on the relevant item type (karma on users, member counts on communities, etc.), and values Reddit doesn't publish may come back `null`.

***

### 🔌 Integrations & Delivery

Beyond the dataset, this Actor can push each scraped item straight into any MCP connector you've authorized in Apify — no glue code, no webhooks:

- **Notion** — create a page per post, or one summary page for the whole run
- **Slack / Discord** — post results or a run digest to a channel
- **Jira / GitHub / Linear** — open issues or tasks from posts
- **Airtable / Google Sheets** — append a structured row per item
- …or any other MCP-compatible connector

Credentials stay private — delivery runs through the **Apify MCP Proxy**, so the Actor never sees your connector tokens. You can also consume the dataset directly via the **Apify API**, or wire it into **n8n, Zapier, and Make**.

> ⚙️ **Delivery modes:** `perItem` sends one connector call per scraped post/comment/user/community; `summary` sends a single call with a digest of the whole run; `none` saves to the dataset only. MCP delivery only runs on the Apify platform and never affects what's saved to the dataset.

#### Placeholders available in arguments / template

**Per-item mode:** `{type}` · `{id}` · `{title}` · `{text}` · `{body}` · `{author}` · `{subreddit}` · `{url}` / `{permalink}` · `{score}` · `{upVotes}` · `{upvoteRatio}` · `{numberOfComments}` · `{createdAt}` · `{username}` · `{name}` · `{numberOfMembers}` · `{message}` (plus any other field on the item)
**Summary mode:** `{itemCount}` · `{postCount}` · `{commentCount}` · `{userCount}` · `{communityCount}` · `{items}` (a formatted digest) · `{message}`

> `{title}` falls back to the subreddit/username for comment/user/community items; `{text}` is populated for every item type, so it's the safest content placeholder when mixing types.

#### Example — post each result to Slack

```json
{
    "searches": ["artificial intelligence"],
    "searchType": "posts",
    "maxItems": 50,
    "mcpConnector": "<your-slack-connector>",
    "deliveryMode": "perItem",
    "mcpTool": "send_message",
    "mcpArguments": { "channel": "#reddit", "text": "{message}" },
    "mcpMessageTemplate": "*[r/{subreddit}] {title}*\n{url}\nScore {score} · {numberOfComments} comments · by u/{author}"
}
```

#### Example — create a Notion page per post

```json
{
    "startUrls": [{ "url": "https://www.reddit.com/r/technology/top/?t=week" }],
    "maxItems": 50,
    "mcpConnector": "<your-notion-connector>",
    "deliveryMode": "perItem",
    "mcpTool": "notion-create-pages",
    "mcpArguments": {
        "parent": { "page_id": "<your-page-id>" },
        "pages": [
            {
                "properties": { "title": "{title}" },
                "content": "{text}\n\nr/{subreddit} · by u/{author}\nScore {score} · {numberOfComments} comments\n{url}"
            }
        ]
    }
}
```

#### Example — one Notion page summarizing the run

```json
{
    "startUrls": [{ "url": "https://www.reddit.com/r/technology/top/?t=week" }],
    "maxItems": 100,
    "mcpConnector": "<your-notion-connector>",
    "deliveryMode": "summary",
    "mcpTool": "notion-create-pages",
    "mcpArguments": {
        "parent": { "page_id": "<your-page-id>" },
        "pages": [
            {
                "properties": { "title": "Reddit digest ({itemCount} items)" },
                "content": "{items}"
            }
        ]
    }
}
```

***

### 🛠️ How It Works

`my_actor/main.py` reads the input, then turns your start URLs and search terms into labelled seed requests. For each:

1. A **real headless Chromium browser** (Playwright) loads Reddit's public `.json` endpoint, so requests carry a genuine browser's headers, cookies, and TLS fingerprint — Reddit serves the data instead of returning HTTP 403.
2. If Reddit's WAF returns a block page instead of JSON, the handler **warms up on the Reddit homepage and re-fetches via an in-page `fetch()`**, which carries the real browser session — no login or keys needed.
3. `my_actor/routes.py` parses each response into flat, typed records (posts, comments, communities, users), following listing pagination and comment trees up to your limits.
4. Records are filtered (keywords, dates, NSFW), de-duplicated, and pushed to the dataset — then, if a connector is configured, delivered via MCP.

**Built with:** [Apify SDK for Python](https://docs.apify.com/sdk/python/) · [Crawlee (Playwright)](https://crawlee.dev/python/) · [MCP](https://modelcontextprotocol.io/)

***

### 💲 Cost & Tips

The Actor reads Reddit's compact JSON through a real browser, so cost is driven mainly by pages loaded (roughly one page per ~100 posts, plus one per post for comments) and proxy usage. To keep runs fast and cheap:

- **Use a proxy** (residential ideally) for larger runs — Reddit rate-limits by IP.
- **Skip comments** (`skipComments: true`) for post-only runs.
- **Filter after fetch** with `keywords`, `postDateFrom` / `postDateTo`, and `includeNSFW`.
- **Lower `maxConcurrency`** if you see HTTP 429 (rate-limit) warnings.
- **Schedule** the Actor to monitor a subreddit and get fresh data automatically.

***

### 🆘 Support

For issues, custom scraping requests, or feature suggestions:

**Email**: bhavin.shah@techforceglobal.com

***

#### Need a Custom Pipeline?

Want multi-subreddit batch runs, scheduled refreshes, deeper enrichment, or a full data-warehouse integration?

#### [📅 Book a Free 15-min Consultation](https://calendly.com/techforce-infotech-pvt-ltd/intro-meeting?month=2026-01)

***

Made with ❤️ by **[Techforce](https://www.techforceglobal.com)**
Specialists in High-Performance Web Scrapers and AI Automation.

***

### Disclaimer

This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by Reddit. Reddit® is a trademark of Reddit, Inc.; all trademarks are property of their respective owners. The Actor collects only publicly available information and does not log into, or scrape behind the authentication of, any platform. Use the data responsibly and in compliance with applicable laws (including GDPR/CCPA) and the terms of the platforms you operate on.

# Actor input Schema

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

Direct Reddit URLs to scrape. Supports subreddits (r/...), posts (/comments/...), user profiles (user/...), search result pages, and community lists.

## `searches` (type: `array`):

Keywords to search on Reddit. Each term runs a search according to the 'Search for' setting below.

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

What each search term should return.

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

How to sort posts/search results.

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

Time window used when sorting by 'top' or 'relevance'.

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

How to sort comments within a post.

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

Total maximum number of dataset items to push (0 = unlimited). Hard safety cap across the whole run.

## `maxPostCount` (type: `integer`):

Maximum posts to scrape per subreddit / search / user (0 = unlimited).

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

Maximum comments to extract per post (0 = skip comments, only post data).

## `maxCommentDepth` (type: `integer`):

How deep to follow reply threads (1 = top-level only, 0 = unlimited).

## `maxCommunitiesCount` (type: `integer`):

Maximum communities (subreddits) to scrape per source (0 = unlimited).

## `maxUserCount` (type: `integer`):

Maximum users to scrape per source (0 = unlimited).

## `skipComments` (type: `boolean`):

Do not scrape comments for posts (faster and cheaper).

## `skipUserPosts` (type: `boolean`):

When scraping a user, skip their submitted posts/comments and only return the profile.

## `skipCommunityInfo` (type: `boolean`):

When scraping a subreddit, skip the community 'about' metadata item.

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

Include content marked NSFW (over\_18). When off, NSFW items are filtered out.

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

Only keep items whose title/body/text contains at least one of these keywords (case-insensitive). Leave empty to keep everything.

## `postDateFrom` (type: `string`):

Only keep items created on/after this date. Accepts YYYY-MM-DD or relative like '7 days', '3 months'.

## `postDateTo` (type: `string`):

Only keep items created on/before this date (YYYY-MM-DD).

## `extractMedia` (type: `boolean`):

Extract image/video/gallery URLs, thumbnails, and external links from posts.

## `dedupItems` (type: `boolean`):

Automatically drop duplicate posts/comments/users/communities within a run.

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

Proxy used for requests. Reddit rate-limits by IP, so residential/rotating proxies are strongly recommended for larger runs.

## `maxConcurrency` (type: `integer`):

Maximum parallel requests. Lower this if you hit rate limits.

## `maxRequestRetries` (type: `integer`):

How many times to retry a failed/blocked request.

## `debugMode` (type: `boolean`):

Enable verbose debug logging.

## `mcpConnector` (type: `string`):

Optionally deliver the scraped Reddit items into a connector you have authorized — Notion, Slack, Linear, Airtable, Jira, GitHub, or any MCP-compatible connector. Leave empty to only save the results to the dataset.

## `deliveryMode` (type: `string`):

How to deliver to the connector: 'perItem' (one call per scraped post/comment/user/community), 'summary' (a single call containing a digest of everything scraped), or 'none' (save to dataset only).

## `mcpTool` (type: `string`):

Name of the tool to call on the connector (e.g. 'create\_page' for Notion, 'send\_message' for Slack, 'create\_issue' for Jira/GitHub). If unsure, run once with a connector selected — the log lists the connector's available tools.

## `mcpArguments` (type: `object`):

Arguments passed to the connector tool. String values support {placeholders}. In 'perItem' mode every field of the item is a placeholder — common ones: {type}, {id}, {title}, {text}, {body}, {author}, {subreddit}, {url}/{permalink}, {score}, {upVotes}, {upvoteRatio}, {numberOfComments}, {createdAt}, {username}, {name}, {numberOfMembers}, plus {message} (the rendered template below). In 'summary' mode: {itemCount}, {postCount}, {commentCount}, {userCount}, {communityCount}, {items} (a formatted digest) and {message}. Example for Slack: {"channel": "#reddit", "text": "{message}"}.

## `mcpMessageTemplate` (type: `string`):

Optional template rendered and exposed as the {message} placeholder in the tool arguments. Per-item example: '\[{subreddit}] {title}\n{url}\nScore {score}, {numberOfComments} comments'. Summary example: 'Scraped {itemCount} Reddit items ({postCount} posts, {commentCount} comments):\n\n{items}'.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/AskReddit/"
    }
  ],
  "searches": [
    "bitcoin"
  ],
  "searchType": "posts",
  "sort": "new",
  "time": "all",
  "commentSort": "top",
  "maxItems": 100,
  "maxPostCount": 50,
  "maxComments": 20,
  "maxCommentDepth": 3,
  "maxCommunitiesCount": 10,
  "maxUserCount": 10,
  "skipComments": false,
  "skipUserPosts": false,
  "skipCommunityInfo": false,
  "includeNSFW": true,
  "extractMedia": true,
  "dedupItems": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxConcurrency": 10,
  "maxRequestRetries": 5,
  "debugMode": false,
  "deliveryMode": "perItem",
  "mcpTool": "",
  "mcpArguments": {},
  "mcpMessageTemplate": ""
}
```

# Actor output Schema

## `results` (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 = {
    "startUrls": [
        {
            "url": "https://www.reddit.com/r/AskReddit/"
        }
    ],
    "searches": [
        "bitcoin"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("techforce.global/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 = {
    "startUrls": [{ "url": "https://www.reddit.com/r/AskReddit/" }],
    "searches": ["bitcoin"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("techforce.global/reddit-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/AskReddit/"
    }
  ],
  "searches": [
    "bitcoin"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call techforce.global/reddit-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=techforce.global/reddit-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Scraper – Posts, Comments & Users",
        "description": "Scrape Reddit posts, comments, users, no login or API key. Search or paste URLs, filter by keyword/date, export to JSON/CSV/Excel or push to Notion, Slack & more.",
        "version": "1.0",
        "x-build-id": "HrkjvzWtgnesFMoE3"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/techforce.global~reddit-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-techforce.global-reddit-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/techforce.global~reddit-scraper/runs": {
            "post": {
                "operationId": "runs-sync-techforce.global-reddit-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/techforce.global~reddit-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-techforce.global-reddit-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "Direct Reddit URLs to scrape. Supports subreddits (r/...), posts (/comments/...), user profiles (user/...), search result pages, and community lists.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "searches": {
                        "title": "Search terms",
                        "type": "array",
                        "description": "Keywords to search on Reddit. Each term runs a search according to the 'Search for' setting below.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "searchType": {
                        "title": "Search for",
                        "enum": [
                            "posts",
                            "comments",
                            "communities",
                            "users"
                        ],
                        "type": "string",
                        "description": "What each search term should return.",
                        "default": "posts"
                    },
                    "sort": {
                        "title": "Sort by",
                        "enum": [
                            "relevance",
                            "hot",
                            "top",
                            "new",
                            "rising",
                            "comments"
                        ],
                        "type": "string",
                        "description": "How to sort posts/search results.",
                        "default": "new"
                    },
                    "time": {
                        "title": "Time range",
                        "enum": [
                            "hour",
                            "day",
                            "week",
                            "month",
                            "year",
                            "all"
                        ],
                        "type": "string",
                        "description": "Time window used when sorting by 'top' or 'relevance'.",
                        "default": "all"
                    },
                    "commentSort": {
                        "title": "Comment sort",
                        "enum": [
                            "confidence",
                            "top",
                            "new",
                            "controversial",
                            "old",
                            "qa"
                        ],
                        "type": "string",
                        "description": "How to sort comments within a post.",
                        "default": "top"
                    },
                    "maxItems": {
                        "title": "Max items",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Total maximum number of dataset items to push (0 = unlimited). Hard safety cap across the whole run.",
                        "default": 100
                    },
                    "maxPostCount": {
                        "title": "Max posts per source",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum posts to scrape per subreddit / search / user (0 = unlimited).",
                        "default": 50
                    },
                    "maxComments": {
                        "title": "Max comments per post",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum comments to extract per post (0 = skip comments, only post data).",
                        "default": 20
                    },
                    "maxCommentDepth": {
                        "title": "Max comment depth",
                        "minimum": 0,
                        "type": "integer",
                        "description": "How deep to follow reply threads (1 = top-level only, 0 = unlimited).",
                        "default": 3
                    },
                    "maxCommunitiesCount": {
                        "title": "Max communities",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum communities (subreddits) to scrape per source (0 = unlimited).",
                        "default": 10
                    },
                    "maxUserCount": {
                        "title": "Max users",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum users to scrape per source (0 = unlimited).",
                        "default": 10
                    },
                    "skipComments": {
                        "title": "Skip comments",
                        "type": "boolean",
                        "description": "Do not scrape comments for posts (faster and cheaper).",
                        "default": false
                    },
                    "skipUserPosts": {
                        "title": "Skip user posts",
                        "type": "boolean",
                        "description": "When scraping a user, skip their submitted posts/comments and only return the profile.",
                        "default": false
                    },
                    "skipCommunityInfo": {
                        "title": "Skip community info",
                        "type": "boolean",
                        "description": "When scraping a subreddit, skip the community 'about' metadata item.",
                        "default": false
                    },
                    "includeNSFW": {
                        "title": "Include NSFW / 18+ content",
                        "type": "boolean",
                        "description": "Include content marked NSFW (over_18). When off, NSFW items are filtered out.",
                        "default": true
                    },
                    "keywords": {
                        "title": "Keyword filter",
                        "type": "array",
                        "description": "Only keep items whose title/body/text contains at least one of these keywords (case-insensitive). Leave empty to keep everything.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "postDateFrom": {
                        "title": "Posted after",
                        "type": "string",
                        "description": "Only keep items created on/after this date. Accepts YYYY-MM-DD or relative like '7 days', '3 months'."
                    },
                    "postDateTo": {
                        "title": "Posted before",
                        "type": "string",
                        "description": "Only keep items created on/before this date (YYYY-MM-DD)."
                    },
                    "extractMedia": {
                        "title": "Extract media",
                        "type": "boolean",
                        "description": "Extract image/video/gallery URLs, thumbnails, and external links from posts.",
                        "default": true
                    },
                    "dedupItems": {
                        "title": "Deduplicate items",
                        "type": "boolean",
                        "description": "Automatically drop duplicate posts/comments/users/communities within a run.",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Proxy used for requests. Reddit rate-limits by IP, so residential/rotating proxies are strongly recommended for larger runs.",
                        "default": {
                            "useApifyProxy": true
                        }
                    },
                    "maxConcurrency": {
                        "title": "Max concurrency",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Maximum parallel requests. Lower this if you hit rate limits.",
                        "default": 10
                    },
                    "maxRequestRetries": {
                        "title": "Max request retries",
                        "minimum": 0,
                        "type": "integer",
                        "description": "How many times to retry a failed/blocked request.",
                        "default": 5
                    },
                    "debugMode": {
                        "title": "Debug mode",
                        "type": "boolean",
                        "description": "Enable verbose debug logging.",
                        "default": false
                    },
                    "mcpConnector": {
                        "title": "Deliver to (MCP connector)",
                        "type": "string",
                        "description": "Optionally deliver the scraped Reddit items into a connector you have authorized — Notion, Slack, Linear, Airtable, Jira, GitHub, or any MCP-compatible connector. Leave empty to only save the results to the dataset."
                    },
                    "deliveryMode": {
                        "title": "Delivery mode",
                        "enum": [
                            "perItem",
                            "summary",
                            "none"
                        ],
                        "type": "string",
                        "description": "How to deliver to the connector: 'perItem' (one call per scraped post/comment/user/community), 'summary' (a single call containing a digest of everything scraped), or 'none' (save to dataset only).",
                        "default": "perItem"
                    },
                    "mcpTool": {
                        "title": "Connector tool name",
                        "type": "string",
                        "description": "Name of the tool to call on the connector (e.g. 'create_page' for Notion, 'send_message' for Slack, 'create_issue' for Jira/GitHub). If unsure, run once with a connector selected — the log lists the connector's available tools.",
                        "default": ""
                    },
                    "mcpArguments": {
                        "title": "Connector tool arguments",
                        "type": "object",
                        "description": "Arguments passed to the connector tool. String values support {placeholders}. In 'perItem' mode every field of the item is a placeholder — common ones: {type}, {id}, {title}, {text}, {body}, {author}, {subreddit}, {url}/{permalink}, {score}, {upVotes}, {upvoteRatio}, {numberOfComments}, {createdAt}, {username}, {name}, {numberOfMembers}, plus {message} (the rendered template below). In 'summary' mode: {itemCount}, {postCount}, {commentCount}, {userCount}, {communityCount}, {items} (a formatted digest) and {message}. Example for Slack: {\"channel\": \"#reddit\", \"text\": \"{message}\"}.",
                        "default": {}
                    },
                    "mcpMessageTemplate": {
                        "title": "Message template",
                        "type": "string",
                        "description": "Optional template rendered and exposed as the {message} placeholder in the tool arguments. Per-item example: '[{subreddit}] {title}\\n{url}\\nScore {score}, {numberOfComments} comments'. Summary example: 'Scraped {itemCount} Reddit items ({postCount} posts, {commentCount} comments):\\n\\n{items}'.",
                        "default": ""
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
