# Discourse Forum Scraper — Topics, Threads & Posts (`actor-forge/discourse-forum-scraper`) Actor

Scrape topics and full threads from any public Discourse forum: titles, categories, tags, views, likes and every post's text and links. Latest, top, category, tag or topic URLs. Robots.txt and each forum's terms checked. No login. $0.30 per 1,000 posts.

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

## Pricing

from $0.40 / 1,000 topics

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

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 Forum Scraper — Topics, Threads & Posts

Scrape topics and full threads from any public Discourse forum: titles, categories, tags, views, likes and every post's text and links. Latest, top, category, tag or topic URLs. Robots.txt and each forum's terms checked. No login. $0.30 per 1,000 posts.

**A Discourse forum scraper for the thousands of public product, open-source and community forums built on Discourse.** Give it a forum, category, tag or topic URL and get clean rows from the forum's own JSON endpoints: **topics** with title, category, tags, opening author handle, created and last-activity dates, **posts, replies, views, likes and participants**, pinned/closed/solved flags; and **full threads**, one row per post with clean text (quotes and image clutter removed), likes, reads, reply links, accepted-answer flag and the links each post contains. Pick latest activity or top topics by period, filter titles by keywords and skip stale topics by date. Use it for **voice-of-customer and feature-request research**, support and documentation gap analysis, community health reporting, competitive research on rival products' forums, and building Q\&A datasets. Every forum's **robots.txt and terms of service are checked first** and the content licence the forum states is attached to each row. **$0.40 per 1,000 topics and $0.30 per 1,000 posts**, no compute bill on top; skipped forums and problems are free status rows.

### What data does it return?

Every run outputs clean, schema-validated rows like these:

| type | title | categoryName | postsCount | views | likeCount | text | authorUsername | status | message |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| topic | Is a personal Rust learning diary appropriate on this forum? | meta | 7 | 100 | 4 |  |  |  |  |
| post |  |  |  |  | 1 | I wouldn't mind this. A forum is after all a place for people to gather… | doublequartz |  |  |
| status |  |  |  |  |  |  |  | blocked-by-terms | forum.example.com was skipped: its terms of service do not allow automated access… |

### How much does it cost?

Transparent pay-per-event pricing — you only pay for what you get, and the
actor **always respects your run budget**: set a maximum total charge and it
stops cleanly at the cap instead of overrunning.

| Event | Price | Charged | Worked example |
| --- | --- | --- | --- |
| `topic` | $0.0004 | per topic row | 100 topics = $0.04 |
| `post` | $0.0003 | per post row | 1,000 posts = $0.30 |
| `apify-actor-start` | $0.00005 | per run per GB of memory (platform start fee) | One run at 256 MB = $0.00005 |

### Input options

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `startUrls` | array | no | — | Public Discourse forums (e.g. users.rust-lang.org), categories (forum.example.com/c/help/5), tags (forum.example.com/tag/async) or single topics (forum.example.com/t/some-topic/123). Each forum's robots.txt and terms of service are checked first; forums that do not allow automated access are skipped with a free status row. |
| `listing` | string | no | `"latest"` | Which topics to take from a forum's home URL: the most recently active (latest) or the most popular in a period (top). Category and tag URLs always use latest. |
| `topPeriod` | string | no | `"monthly"` | Period for the top listing. |
| `keywords` | array | no | — | Optional: only topics whose title contains one of these words or phrases (case-insensitive). |
| `maxTopicsPerSource` | integer | no | `20` | Maximum topics per forum, category or tag URL. |
| `maxPostsPerTopic` | integer | no | `50` | Posts to return from each topic, oldest first (post 1 is the opening post). 0 returns topic rows only, which is faster and cheaper. |
| `skipPinned` | boolean | no | `true` | Skip pinned welcome and rules topics. |
| `activeAfter` | string | no | — | Optional date (YYYY-MM-DD). Topics whose last activity is older are skipped (latest listings stop paging there). |
| `maxItems` | integer | no | `1000` | Upper limit on topic and post rows for the whole run. |

### Limits & honest notes

- **Forum rules come first.** Before reading a forum, the actor fetches its robots.txt (RFC 9309) and its /tos page. Forums whose terms forbid automated access are skipped with a free status row. Discourse's current default terms do forbid it, so many forums are skipped; forums on the older default terms (for example several large open-source language forums) and forums with no such clause can be read. A terms page that only points elsewhere is followed once; terms that cannot be read are treated as a refusal. This check reads text automatically and is not legal advice: you remain responsible for using each forum's content within its terms and stated licence.
- **Content licences:** each row carries the licence named in the forum's terms (for example CC BY-NC-SA 3.0 or MIT OR Apache-2.0) when one is stated. Non-commercial licences restrict how you may reuse the text.
- Search is not offered because Discourse's default robots.txt disallows /search; use title keywords, categories or tags instead. Private, login-only and members-only forums or categories are not read (free status row). Whispers, moderator actions, hidden and deleted posts are skipped.
- Only topic and post content is returned. Usernames appear as public handles; real names, avatars, profile pages, badges and user statistics are never collected, and e-mail addresses in post text are removed. Do not use the data for spam or harassment.
- Plain HTTPS requests with an honest user agent (ActorForge-Discourse), at most one request per second per forum, retries with back-off on HTTP 429/503, no login, cookies or proxies. Requests to private or internal network addresses are refused. Not affiliated with, endorsed by or sponsored by Discourse or any forum. Set a maximum total charge and the run stops cleanly at the cap.

### Related ActorForge actors

- [Dev Community Mentions](https://apify.com/actor-forge/dev-community-mentions) — keyword mentions across developer communities
- [Mastodon Scraper](https://apify.com/actor-forge/mastodon-scraper) — posts and hashtags from the fediverse

### Changelog

- **2026-11-12** — Initial release: latest, top, category, tag and topic URLs; full threads with paging; title keywords and activity-date filter; per-forum robots.txt and terms-of-service checks; content licence on every row; free status rows.

***

*Built and maintained by **ActorForge**. Reliability first: every actor in the
portfolio is monitored by an automated nightly self-test, and breakages are
typically fixed the same day.*

# Actor input Schema

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

Public Discourse forums (e.g. users.rust-lang.org), categories (forum.example.com/c/help/5), tags (forum.example.com/tag/async) or single topics (forum.example.com/t/some-topic/123). Each forum's robots.txt and terms of service are checked first; forums that do not allow automated access are skipped with a free status row.

## `listing` (type: `string`):

Which topics to take from a forum's home URL: the most recently active (latest) or the most popular in a period (top). Category and tag URLs always use latest.

## `topPeriod` (type: `string`):

Period for the top listing.

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

Optional: only topics whose title contains one of these words or phrases (case-insensitive).

## `maxTopicsPerSource` (type: `integer`):

Maximum topics per forum, category or tag URL.

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

Posts to return from each topic, oldest first (post 1 is the opening post). 0 returns topic rows only, which is faster and cheaper.

## `skipPinned` (type: `boolean`):

Skip pinned welcome and rules topics.

## `activeAfter` (type: `string`):

Optional date (YYYY-MM-DD). Topics whose last activity is older are skipped (latest listings stop paging there).

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

Upper limit on topic and post rows for the whole run.

## Actor input object example

```json
{
  "startUrls": [
    "https://users.rust-lang.org"
  ],
  "listing": "latest",
  "topPeriod": "monthly",
  "maxTopicsPerSource": 3,
  "maxPostsPerTopic": 5,
  "skipPinned": true,
  "maxItems": 1000
}
```

# Actor output Schema

## `results` (type: `string`):

Topic rows (title, category, tags, counts, dates) and post rows (text, author handle, likes, links).

## `summary` (type: `string`):

Rows delivered, requests made, whether a forum refused a request, and billing.

# 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": [
        "https://users.rust-lang.org"
    ],
    "maxTopicsPerSource": 3,
    "maxPostsPerTopic": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("actor-forge/discourse-forum-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": ["https://users.rust-lang.org"],
    "maxTopicsPerSource": 3,
    "maxPostsPerTopic": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("actor-forge/discourse-forum-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 '{
  "startUrls": [
    "https://users.rust-lang.org"
  ],
  "maxTopicsPerSource": 3,
  "maxPostsPerTopic": 5
}' |
apify call actor-forge/discourse-forum-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,actor-forge/discourse-forum-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/9JeAhbrJihXeyGMli/builds/mYmKH8cWl6HmcIfV3/openapi.json
