# Discourse Forums & Community Threads Scraper (`whthpnd/discourse-forums-threads-scraper`) Actor

Proxy-free scraper for any public Discourse forum (n8n, Hugging Face, Cursor, Make, SaaS communities). Extract latest, top, or search-filtered topics, engagement metrics, OP usernames, and cleaned thread posts for RAG and market research.

- **URL**: https://apify.com/whthpnd/discourse-forums-threads-scraper.md
- **Developed by:** [DirectAPI Labs](https://apify.com/whthpnd) (community)
- **Categories:** Social media, Developer tools, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.70 / 1,000 extracted discourse topics

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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

## Discourse Forums & Community Threads Scraper

Fast, proxy-free Apify Actor that extracts structured topics, engagement stats, original posters, and cleaned plain-text thread replies from **any public Discourse forum** via native JSON endpoints — no headless browser, no login, and no residential proxies required.

Works out of the box on popular SaaS, developer, and AI communities including `community.n8n.io`, `discuss.huggingface.co`, `community.make.com`, `forum.cursor.com`, `community.openai.com`, `meta.discourse.org`, and thousands of other Discourse-powered sites.

### Why Use This Scraper?

- **AI & RAG Knowledge Pipelines**: Pull solved Q\&A threads, bug workarounds, and feature discussions with clean HTML-stripped plain text ready for vector databases and LLM fine-tuning.
- **SaaS Product & Market Research**: Track trending topics (`top`), newest questions (`latest`), or pain points (`search`) across competitor or ecosystem communities.
- **Developer & Community Lead Generation**: Capture active topic authors, post counts, view counts, and direct thread URLs without brittle DOM selectors.
- **Ultra-Low Compute Cost**: Runs comfortably inside **256 MB RAM** using async HTTP requests (~2–5 seconds for 20 full threads).

### Supported Modes

1. **Latest Topics (`latest`)** — Chronological feed of newest discussions across your target forums.
2. **Top / Popular Topics (`top`)** — High-engagement threads ranked by views, replies, and likes.
3. **Keyword Search (`search`)** — Discourse full-text search filtered by your custom `searchQuery`.

### Input Parameters

| Field | Type | Default | Description |
|---|---|---|---|
| `forumUrls` | Array of strings | `["https://community.n8n.io", "https://discuss.huggingface.co"]` | Base URLs of one or more public Discourse communities. Results are balanced across all provided forums. |
| `feed` | String | `"latest"` | Topic feed mode: `"latest"`, `"top"`, or `"search"`. |
| `searchQuery` | String | `""` | Search phrase used when `feed` is set to `"search"`. Falls back cleanly to `"latest"` if omitted. |
| `includePosts` | Boolean | `true` | Fetch `/t/{topicId}.json` for each thread to extract `firstPostText` and the `posts` array. Disable for ultra-fast metadata-only scans. |
| `maxPostsPerTopic` | Integer | `5` | Maximum number of cleaned posts (OP + top replies) attached per thread (`1` to `50`). |
| `maxTopics` | Integer | `20` | Total maximum topics to extract across all target forums (`1` to `500`). |

### Example Input

```json
{
  "forumUrls": [
    "https://community.n8n.io",
    "https://discuss.huggingface.co"
  ],
  "feed": "latest",
  "includePosts": true,
  "maxPostsPerTopic": 5,
  "maxTopics": 20
}
```

### Example Output

```json
{
  "forumUrl": "https://community.n8n.io",
  "topicId": 328026,
  "title": "How to batch HTTP requests inside a sub-workflow",
  "slug": "how-to-batch-http-requests-inside-a-sub-workflow",
  "topicUrl": "https://community.n8n.io/t/how-to-batch-http-requests-inside-a-sub-workflow/328026",
  "authorUsername": "Johan_Cutych",
  "authorName": "Johan",
  "categoryId": 12,
  "tags": ["http-request", "sub-workflow"],
  "postsCount": 3,
  "replyCount": 2,
  "views": 1699,
  "likeCount": 28,
  "pinned": false,
  "closed": false,
  "hasAcceptedAnswer": true,
  "createdAt": "2026-11-11T08:22:31.955Z",
  "lastPostedAt": "2026-11-12T10:15:04.000Z",
  "firstPostText": "I am trying to split 500 webhook items into chunks of 25 before sending...",
  "posts": [
    {
      "postNumber": 1,
      "username": "Johan_Cutych",
      "createdAt": "2026-11-11T08:22:31.955Z",
      "likes": 5,
      "text": "I am trying to split 500 webhook items into chunks of 25 before sending..."
    }
  ],
  "scrapedAt": "2026-11-24T20:40:00.123456+00:00"
}
```

### Pricing & Store Tier Discounts

This Actor uses transparent **Pay-Per-Event** pricing plus tiered Apify Store discounts:

| Plan Tier | Actor Start (one-time) | Price Per Extracted Topic |
|---|---|---|
| **Free** | $0.00005 | $0.0020 |
| **Bronze** | $0.00005 | $0.0019 |
| **Silver** | $0.00005 | $0.0018 |
| **Gold** | $0.00005 | $0.0017 |
| **Platinum** | $0.00005 | $0.0016 |
| **Diamond** | $0.00005 | $0.0015 |

### Integrations

Connect directly via the **Apify API**, **Apify MCP Server**, **n8n**, **Make**, **Zapier**, **LangChain**, or **LlamaIndex** to push fresh community insights straight into Slack, Notion, Postgres, Qdrant, Pinecone, or Google Sheets on a schedule.

### FAQ

**Do I need proxies or cookies?**
No. Public Discourse communities expose structured `.json` topic and thread endpoints directly over HTTPS.

**How many forums can I pass at once?**
Any number of Discourse URLs in `forumUrls`. Results are interleaved round-robin so every forum is represented inside `maxTopics`.

**Can I scrape just topic metadata without fetching thread bodies?**
Yes — set `"includePosts": false` to skip `/t/{topicId}.json` calls and run metadata-only extractions even faster.

# Actor input Schema

## `forumUrls` (type: `array`):

Base URLs of any public Discourse forums (e.g., https://community.n8n.io, https://discuss.huggingface.co).

## `feed` (type: `string`):

Select 'latest' for newest discussions, 'top' for most active threads, or 'search' to query topics matching searchQuery.

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

Keyword or phrase to search inside forum topics and posts when feed is set to 'search'. Falls back to 'latest' if left blank.

## `includePosts` (type: `boolean`):

Fetch full /t/{topicId}.json threads to extract cleaned plain-text firstPostText and replies.

## `maxPostsPerTopic` (type: `integer`):

Maximum number of cleaned posts (OP + top replies) to attach to each topic record.

## `maxTopics` (type: `integer`):

Maximum total number of forum topics to extract across the provided Discourse forums.

## Actor input object example

```json
{
  "forumUrls": [
    "https://community.n8n.io",
    "https://discuss.huggingface.co"
  ],
  "feed": "latest",
  "searchQuery": "",
  "includePosts": true,
  "maxPostsPerTopic": 5,
  "maxTopics": 20
}
```

# Actor output Schema

## `topics` (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 = {
    "forumUrls": [
        "https://community.n8n.io",
        "https://discuss.huggingface.co"
    ],
    "maxTopics": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("whthpnd/discourse-forums-threads-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 = {
    "forumUrls": [
        "https://community.n8n.io",
        "https://discuss.huggingface.co",
    ],
    "maxTopics": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("whthpnd/discourse-forums-threads-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 '{
  "forumUrls": [
    "https://community.n8n.io",
    "https://discuss.huggingface.co"
  ],
  "maxTopics": 20
}' |
apify call whthpnd/discourse-forums-threads-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,whthpnd/discourse-forums-threads-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/bB0wAxMOQDaoHqCkA/builds/3W2UnZ2YsxnbaFcTQ/openapi.json
