# 巴哈姆特爬蟲｜哈啦板貼文、回覆、GP/BP、輿情匯出（免 API） (`claude_code_reviewer/bahamut-scraper`) Actor

免登入抓巴哈姆特哈啦板：主題列表、主文與全部樓層回覆＋樓中留言，含 GP／BP、作者、時間，輸出 JSON／CSV／Excel。台灣遊戲社群輿情、品牌口碑、熱門話題監測必備。

- **URL**: https://apify.com/claude\_code\_reviewer/bahamut-scraper.md
- **Developed by:** [Chad](https://apify.com/claude_code_reviewer) (community)
- **Categories:** AI, News, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 主題列表

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?

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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## 巴哈姆特爬蟲｜哈啦板貼文、回覆、輿情一鍵匯出（免 API）

抓 **巴哈姆特（forum.gamer.com.tw）哈啦板** 的主題列表與單篇貼文全文，含樓層回覆與樓中留言、GP／BP、作者、時間。純 HTML（CheerioCrawler）、**免登入、無瀏覽器**，輸出結構化 JSON／CSV／Excel。台灣遊戲社群輿情、品牌口碑、熱門話題監測必備。

> 巴哈姆特是台灣最大的遊戲與綜合討論社群。本工具與 [PTT](https://apify.com/claude_code_reviewer/ptt-scraper)、[Mobile01](https://apify.com/claude_code_reviewer/mobile01-scraper) 爬蟲同屬台灣輿情系列，欄位可跨站彙整。

### 輸出欄位

| 欄位名稱 | 型別 | 說明 |
|---------|------|------|
| thread\_id | string | null | 主題 ID（snA），跨 run 穩定 |
| bsn | string | 板號 |
| board | string | null | 子板名稱（如「大混戰」）；主題模式為文章分類標籤 |
| site | string | 固定 `bahamut` |
| title | string | null | 主題標題 |
| author | string | null | 作者暱稱 |
| author\_id | string | null | 作者的 gamer.com.tw 帳號 ID |
| reply\_count | number | null | 互動數（列表模式） |
| view\_count | number | null | 人氣／瀏覽數（列表模式） |
| brief | string | null | 開頭貼文預覽文字（列表模式） |
| last\_reply\_at | string | null | 最後回覆時間（ISO 8601，由「N 分前」等相對時間換算） |
| is\_pinned | boolean | 是否為置頂主題（列表模式） |
| content | string | null | 主文／回覆內文純文字（主題模式） |
| content\_images | array | 內文圖片／貼圖網址（主題模式） |
| gp\_count | number | null | GP（推）數 |
| bp\_count | number | null | BP（噓）數 |
| floor | number | null | 樓層號（回覆為樓層；樓中留言為 null） |
| reply\_type | string | `floor`（樓層）或 `comment`（樓中留言） |
| total\_pages | number | null | 主題總頁數（主文列） |
| created\_at | string | null | 發文時間（ISO 8601，台灣 UTC+8 換算） |
| thread\_url | string | 主題網址 |
| source\_mode | string | `board` 或 `thread` |
| source\_query | string | 實際查詢（板號或 bsn/snA） |
| scraped\_at | string | 抓取時間（ISO 8601） |

缺值一律給 `null`，不省略欄位。

### 模式

| 模式 | 抓什麼 | 計費 |
|---|---|---|
| `board`（哈啦板列表，預設） | 指定板號（bsn）的最新主題列表，可用標題關鍵字過濾 | `search-listing` $0.002／筆 |
| `thread`（單篇主題） | 主文 + 全部樓層回覆 + 樓中留言（自動翻頁） | `product-detail` $0.008（主文）+ `review-item` $0.003／則回覆 |

### 輸入欄位

| 欄位 | 型別 | 預設 | 說明 |
|-----|------|------|------|
| mode | string | `board` | `board` 或 `thread` |
| boards | array | `["17532"]` | 板列表模式的板號 bsn（數字，或貼板網址自動抽出） |
| threadUrls | array | — | 主題模式的主題網址（C.php?bsn=\&snA=，或 `bsn/snA` 簡寫） |
| keywords | array | `[]` | （選填）只保留標題含任一關鍵字的主題 |
| dateFrom / dateTo | string | — | （選填）`3d`／`12h`／`2w` 或 `MM/DD/YY`，依最後回覆時間過濾 |
| bulkInput | string | — | 一行一個，依模式併入 boards 或 threadUrls |
| maxItems | integer | 50 | 每板主題數／每主題回覆數上限（上限 500） |
| proxyConfiguration | object | datacenter | 預設 Apify datacenter proxy |

#### 怎麼找板號 bsn？

打開任一哈啦板，網址是 `https://forum.gamer.com.tw/B.php?bsn=17532` —— `bsn=` 後面的數字就是板號。例如英雄聯盟＝`17532`。

### 輸入範例

**1. 抓某板最新主題列表**

```json
{ "mode": "board", "boards": ["17532"], "maxItems": 50 }
```

**2. 標題關鍵字過濾 + 只要近 7 天**

```json
{ "mode": "board", "boards": ["17532"], "keywords": ["改版", "活動"], "dateFrom": "7d", "maxItems": 50 }
```

**3. 多板批量**

```json
{ "mode": "board", "bulkInput": "17532\n60076\n60599", "maxItems": 30 }
```

**4. 抓單篇主題全文＋回覆**

```json
{ "mode": "thread", "threadUrls": ["https://forum.gamer.com.tw/C.php?bsn=17532&snA=705476"], "maxItems": 100 }
```

**5. 主題簡寫（bsn/snA）**

```json
{ "mode": "thread", "threadUrls": ["17532/705476"], "maxItems": 50 }
```

### 注意事項

- **免登入、無瀏覽器**：純 CheerioCrawler 打 HTML 端點，成本極低。
- **哈啦板依「最後回覆」排序**，`dateFrom`／`dateTo` 依最後回覆時間過濾；翻到整頁主題都早於 `dateFrom` 即自動停止翻頁，適合排程監控省成本。
- **時間**：主文時間依台灣時間（UTC+8）換算為 UTC；列表的相對時間（「12 分前」）依抓取當下換算。
- **年齡限制板**（少數標示「兒少保護警示」的板，如部分場外板）需登入成年帳號，**v1 不支援**，請使用一般哈啦板。全站關鍵字搜尋規劃於 v1.1。
- 每 domain 併發 ≤5、指數退避重試 ≤3 次；連續 5 頁無新資料即停止。

### FAQ

**Q：一次可以抓多個板嗎？** 可以，`boards` 填多個 bsn，或用 `bulkInput` 一行一個。

**Q：抓得到樓中留言嗎？** 可以，主題模式會抓樓層回覆（`reply_type=floor`）與樓中留言（`reply_type=comment`）。

**Q：要 proxy 嗎？** 預設已用 Apify datacenter proxy，一般不用改。

**Q：需要登入嗎？** 不需要，只抓公開內容。

### 免責聲明

本工具僅抓取巴哈姆特公開頁面資料，供研究、輿情分析與市場調查使用。請遵守巴哈姆特使用條款與當地法令，勿用於侵犯隱私或其他違法用途。抓取內容之著作權屬原作者所有。

***

巴哈姆特爬蟲 Bahamut scraper｜台灣遊戲論壇、哈啦板、貼文、回覆、GP/BP、輿情監測、社群口碑、品牌聲量、免 API、JSON/CSV/Excel 匯出

# Actor input Schema

## `mode` (type: `string`):

要抓什麼？選一個模式，填下面對應欄位就好。

## `boards` (type: `array`):

哈啦板列表模式的板號（bsn，數字）。可在該板網址 forum.gamer.com.tw/B.php?bsn=XXXX 找到。例如英雄聯盟＝17532。也可直接貼板網址，會自動抽出 bsn。

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

（選填）只保留標題包含任一關鍵字的主題。例如：改版、活動。留空表示不過濾。

## `dateFrom` (type: `string`):

支援格式：3d、12h、2w（相對時間）或 MM/DD/YY（絕對日期）。依主題的「最後回覆時間」判斷（哈啦板依最後回覆排序）。有設定時，翻到整頁主題都早於此時間即停止翻頁，適合排程監控省成本。

## `dateTo` (type: `string`):

支援格式：3d、12h、2w（相對時間）或 MM/DD/YY（絕對日期）。依主題的最後回覆時間判斷。

## `threadUrls` (type: `array`):

單篇模式的主題網址，例如：https://forum.gamer.com.tw/C.php?bsn=17532\&snA=705476。也接受「bsn/snA」簡寫（如 17532/705476）。

## `bulkInput` (type: `string`):

**一行一個**，按 Enter 換行。板列表模式貼板號 bsn，主題模式貼主題網址，執行時自動併入上面對應欄位。

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

板列表模式每個板最多抓幾筆主題；主題模式每篇最多抓幾則回覆。越多費用越高。上限 500。

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

預設用 Apify datacenter proxy（避免共用出口 IP 被限流）。一般不用改。

## Actor input object example

```json
{
  "mode": "board",
  "boards": [
    "17532"
  ],
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (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 = {
    "mode": "board",
    "boards": [
        "17532"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("claude_code_reviewer/bahamut-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 = {
    "mode": "board",
    "boards": ["17532"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("claude_code_reviewer/bahamut-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 '{
  "mode": "board",
  "boards": [
    "17532"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call claude_code_reviewer/bahamut-scraper --silent --output-dataset

```

## MCP server setup

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