{
  "openapi": "3.0.1",
  "info": {
    "title": "Discourse Forum Scraper — Topics, Posts & Search",
    "description": "Scrape any public Discourse forum: latest, top, category, tag or search topics, or specific thread URLs, with full posts (HTML and text) included in the per-topic price. No login or API key.",
    "version": "0.1",
    "x-build-id": "4gMQbAlfLP8UoY86W"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation-lab~discourse-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation-lab-discourse-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/automation-lab~discourse-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automation-lab-discourse-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/automation-lab~discourse-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automation-lab-discourse-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": {
          "forumUrl": {
            "title": "🌐 Forum URL",
            "pattern": "^(https?://.+)?$",
            "type": "string",
            "description": "Address of the Discourse forum, e.g. <code>https://community.openai.com</code>. Any link on the forum works (a category, tag or topic page); the forum's base address is used. Not needed in <b>Topic URLs</b> mode."
          },
          "scrapeMode": {
            "title": "📋 Scrape Mode",
            "enum": [
              "latestTopics",
              "topTopics",
              "categoryTopics",
              "tagTopics",
              "searchTopics",
              "topicUrls"
            ],
            "type": "string",
            "description": "What to collect. <b>Latest</b>: newest activity. <b>Top</b>: most popular topics for a period. <b>Category</b>: one category. <b>Tag</b>: one tag. <b>Search</b>: the forum's own keyword search. <b>Topic URLs</b>: specific topics you list.",
            "default": "latestTopics"
          },
          "categorySlug": {
            "title": "📁 Category",
            "type": "string",
            "description": "For <b>Category topics</b>: the category slug or its URL, e.g. <code>api</code> or <code>https://community.openai.com/c/api/7</code>. Subcategories: <code>parent/child</code>."
          },
          "tag": {
            "title": "🏷️ Tag",
            "type": "string",
            "description": "For <b>Tag topics</b>: the tag name or its URL, e.g. <code>gpt-4</code> or <code>https://community.openai.com/tag/gpt-4</code>."
          },
          "searchQuery": {
            "title": "🔍 Search Query",
            "type": "string",
            "description": "For <b>Search topics</b>: keywords, using the forum's search syntax (e.g. <code>embeddings status:solved</code>, <code>after:2026-01-01</code>)."
          },
          "topPeriod": {
            "title": "📈 Top Period",
            "enum": [
              "daily",
              "weekly",
              "monthly",
              "quarterly",
              "yearly",
              "all"
            ],
            "type": "string",
            "description": "For <b>Top topics</b>: the period popularity is counted over.",
            "default": "monthly"
          },
          "topicUrls": {
            "title": "🔗 Topic URLs",
            "type": "array",
            "description": "For <b>Topic URLs</b>: links to topics, e.g. <code>https://meta.discourse.org/t/discourse-rest-api-documentation/22706</code>. Topics from different forums can be mixed. Turn on <b>Include Post Content</b> to get each thread's posts.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxTopics": {
            "title": "📊 Max Topics",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of topics to save. You pay per topic saved.",
            "default": 50
          },
          "includePostContent": {
            "title": "💬 Include Post Content",
            "type": "boolean",
            "description": "Add each topic's posts (HTML and plain text, author, likes, accepted answer) in conversation order. Included in the per-topic price.",
            "default": false
          },
          "maxPostsPerTopic": {
            "title": "📝 Max Posts Per Topic",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum posts per topic, from the first post on (only with <b>Include Post Content</b>).",
            "default": 10
          },
          "maxRequestRetries": {
            "title": "🔄 Max Request Retries",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Retries for a request the forum rate-limits or fails (HTTP 429 or 5xx).",
            "default": 3
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}