# Discourse Forum Scraper (`properscraper/discourse-forum-scraper`) Actor

Export the topics of any public Discourse forum, a single category or a tag: title, author, dates, views, replies, likes and tags, and optionally the text of the posts. Uses the forum's own public JSON API.

- **URL**: https://apify.com/properscraper/discourse-forum-scraper.md
- **Developed by:** [jake mcclure](https://apify.com/properscraper) (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 topic saveds

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

Export the topics of any public Discourse forum, or of a single category or tag. For each topic you get the title, category, tags, author, dates, views, replies and likes, and optionally the text of the opening post or of every post.

Discourse powers thousands of community and support forums. This Actor uses the JSON API that every Discourse forum serves, so it returns clean structured data instead of scraped web pages. No login and no API key are needed.

Use it to:

- analyse what a product's users ask about and how often
- find unanswered or unsolved questions in a support forum
- collect discussions for research, sentiment analysis or an AI knowledge base
- track activity in a community over time

### Input

| Field | What it does |
|---|---|
| **Forums, categories or tags** | One address per line: a whole forum, one category (`/c/support/6`) or one tag (`/tag/release-notes`). |
| **Maximum topics per address** | Stop after this many topics for each address. Default 100. |
| **Order** | Latest activity, newest topics, most viewed, most liked or most replies. |
| **Post text** | Topic details only, the opening post, or the opening post and replies. |
| **Maximum posts per topic** | With replies: how many posts to return per topic. Default 20. |
| **Created on or after** | Only topics created from this date onwards. |

```json
{
    "forums": ["https://meta.discourse.org/c/support/6"],
    "maxTopicsPerForum": 200,
    "sortBy": "created",
    "content": "allPosts",
    "maxPostsPerTopic": 50
}
```

### Output

One record per topic:

```json
{
    "forum": "https://meta.discourse.org/c/support/6",
    "topicId": 357665,
    "title": "Pyx's Modern Theme",
    "url": "https://meta.discourse.org/t/pyxs-modern-theme/357665",
    "category": "Theme",
    "categoryId": 61,
    "tags": ["themes"],
    "author": "darkpixlz",
    "createdAt": "2025-03-17T23:17:47.268Z",
    "lastPostedAt": "2026-11-12T07:06:47.649Z",
    "lastPoster": "darkpixlz",
    "postCount": 55,
    "replyCount": 29,
    "views": 6649,
    "likeCount": 58,
    "pinned": false,
    "closed": false,
    "archived": false,
    "solved": false,
    "excerpt": null,
    "imageUrl": "https://global.discourse-cdn.com/meta/optimized/4X/c/b/5/example.png",
    "text": "A modern theme for Discourse ...",
    "posts": [
        {
            "postId": 1734068,
            "postNumber": 1,
            "author": "darkpixlz",
            "createdAt": "2025-03-17T23:17:47.372Z",
            "text": "A modern theme for Discourse ...",
            "likeCount": 31,
            "replyToPostNumber": null,
            "isAcceptedAnswer": false
        }
    ],
    "scrapedAt": "2026-11-12T09:00:00.000Z"
}
```

- `forum` is the line of input the topic was found under.
- `category` includes the parent category for sub-categories, such as `Support / Install`.
- `solved` is `true` or `false` on forums that mark accepted answers, and empty on forums that do not.
- `text` (the opening post as plain text) is added with **Opening post** or **Opening post and replies**.
- `posts` is added with **Opening post and replies**, oldest first.

A `SUMMARY` record in the run's key-value store lists, for each address, how many topics were saved and any error.

### Pricing

Pay per result. You are charged once for each topic saved to the dataset, at the per-result price shown on this page. A topic costs the same with or without its posts.

Forums that cannot be read cost nothing. The run stops as soon as it reaches the maximum charge you set for it.

### Limits

- Only public forums and public categories can be read. Forums that require a login are reported in the log and the summary.
- Private messages, hidden categories and deleted posts are never returned.
- A topic list returns about 30 topics per request and requests are spaced out, so very large exports take a while. With post text, expect one to three seconds per topic.
- If a forum asks the Actor to slow down, it waits, and stops reading that forum if the limit persists.
- Counts are as of the time of the run.

### Is this allowed?

The Actor reads the JSON API that the forum itself serves to any visitor, and only content that is public without logging in. Topics and posts are returned with the public usernames of their authors. You are responsible for how you use the data, including any personal data in it and the forum's own terms.

# Actor input Schema

## `forums` (type: `array`):

One address per line: a whole forum (https://meta.discourse.org), one category (https://meta.discourse.org/c/support/6) or one tag (https://meta.discourse.org/tag/release-notes).

## `maxTopicsPerForum` (type: `integer`):

Stop after this many topics for each forum, category or tag.

## `sortBy` (type: `string`):

Which topics come first. With a maximum set, this decides which topics you get.

## `content` (type: `string`):

Topic details only, or also the text of the opening post, or the opening post and the replies. Reading posts takes one or more extra requests per topic, so runs are slower.

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

With "Opening post and replies": how many posts to return for each topic, oldest first.

## `createdAfter` (type: `string`):

Only return topics created from this date onwards (YYYY-MM-DD). Combine with the order "Newest topics" so reading stops at the first older topic.

## Actor input object example

```json
{
  "forums": [
    "https://meta.discourse.org"
  ],
  "maxTopicsPerForum": 100,
  "sortBy": "activity",
  "content": "none",
  "maxPostsPerTopic": 20
}
```

# Actor output Schema

## `topics` (type: `string`):

Every topic saved by the run, one record per topic.

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

Totals for the run and, for each forum, how many results were saved and any error.

# 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 = {
    "forums": [
        "https://meta.discourse.org"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("properscraper/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 = { "forums": ["https://meta.discourse.org"] }

# Run the Actor and wait for it to finish
run = client.actor("properscraper/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 '{
  "forums": [
    "https://meta.discourse.org"
  ]
}' |
apify call properscraper/discourse-forum-scraper --silent --output-dataset

```

## MCP server setup

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