LIHKG 連登爬蟲|香港論壇貼文、留言、輿情、情緒一鍵匯出(免 API)
Pricing
from $2.00 / 1,000 帖子列表
LIHKG 連登爬蟲|香港論壇貼文、留言、輿情、情緒一鍵匯出(免 API)
免登入抓連登(LIHKG)香港論壇:分台主題列表、貼文全文與所有留言,含推/踩數與時間,輸出 JSON/CSV/Excel。香港輿情監測、品牌口碑、社群分析必備。
Pricing
from $2.00 / 1,000 帖子列表
Rating
0.0
(0)
Developer
Chad
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
LIHKG 連登爬蟲(免 API・免登入)
抓連登(LIHKG)香港論壇最新主題列表及完整貼文留言,走 api_v2 公開 JSON 端點,輸出結構化資料。
輸出欄位
主題列表 / 貼文主文(ThreadRow)
| 欄位名稱 | 型別 | 說明 |
|---|---|---|
| thread_id | string | 貼文 ID |
| title | string | null | 標題 |
| content | string | null | 貼文主文(列表模式為 null) |
| author | string | null | 作者暱稱 |
| category | string | null | 分台名稱 |
| reply_count | number | null | 回覆數 |
| like_count | number | null | 讚數 |
| dislike_count | number | null | 黑人問號數 |
| created_at | string | null | 發文時間(ISO 8601) |
| thread_url | string | 貼文網址 |
| source_mode | string | 抓取模式(thread-list / thread) |
| source_query | string | 查詢條件(分台 ID 或貼文 ID) |
| scraped_at | string | 抓取時間(ISO 8601) |
留言(ReplyRow)
| 欄位名稱 | 型別 | 說明 |
|---|---|---|
| reply_id | string | null | 留言 ID(post_id) |
| thread_id | string | 所屬貼文 ID |
| floor | number | null | 樓層(msg_num) |
| author | string | null | 作者暱稱 |
| content | string | null | 留言內容(已去除 HTML 標籤) |
| like_count | number | null | 讚數 |
| dislike_count | number | null | 黑人問號數 |
| created_at | string | null | 留言時間(ISO 8601) |
| scraped_at | string | 抓取時間(ISO 8601) |
模式說明
| 模式 | 輸入 | 輸出 | 計費 |
|---|---|---|---|
| thread-list | catIds(分台 ID 列表) | 主題列表(ThreadRow) | $0.002/篇 |
| thread | threadIds / threadUrls | 貼文主文($0.008/篇)+所有留言($0.003/則) | 依數量 |
輸入欄位
| 欄位 | 型別 | 預設 | 說明 |
|---|---|---|---|
| mode | enum | thread-list | 模式:thread-list(列表)/ thread(完整貼文) |
| catIds | array | — | 分台 ID,例如 1(吹水台)、2(體育台)、5(時事台) |
| threadIds | array | — | 貼文 ID 列表 |
| threadUrls | array | — | 貼文網址,自動抽出 ID |
| bulkInput | textarea | — | 批量貼上,一行一個,自動合併到對應欄位 |
| maxItems | integer | 50 | 最多抓幾篇(列表:每分台;貼文:總篇數) |
| keywords | array | — | 標題關鍵字過濾(列表模式,留空不過濾) |
| proxyConfiguration | proxy | 不用 proxy | 大量抓取時選用 Apify Proxy |
輸入範例
主題列表
{"mode": "thread-list","catIds": ["1", "5"],"maxItems": 100}
完整貼文及留言
{"mode": "thread","threadIds": ["4126423"],"maxItems": 50}
批量貼文網址
{"mode": "thread","threadUrls": ["https://lihkg.com/thread/4126423/page/1","https://lihkg.com/thread/4000000/page/1"],"maxItems": 50}
注意事項
- 只抓公開內容,不需要帳號或 token
- 使用 api_v2 JSON 端點(不用瀏覽器,速度快、成本低)
- 留言內容已自動去除 HTML 標籤(
<br>、<img>、<span>等) - thread 模式:maxItems 限制的是貼文篇數,每篇留言全數抓取不受限
- 分項計費:啟動費 $0.005(一次)、列表每篇 $0.002、貼文主文每篇 $0.008、留言每則 $0.003
- 連續 5 頁無新資料時自動停止,不空轉燒費用
- LIHKG api_v2 未來有機會加上
X-LI-DEVICE標頭驗證或 challenge,並封鎖資料中心 IP。判斷方式:以 Apify cloud smoke test 結果為準(go/no-go);若被擋,備援方案是改用 Apify residential proxy(proxyConfiguration),不預先過度設計
常見問題(FAQ)
Q: 需要登入才能看嗎?
A: 不需要。本 Actor 只抓公開主題列表及留言,不涉及任何需要登入的功能。
Q: 可以同時抓多個分台嗎?
A: 可以。在 catIds 填多個 ID,或用 bulkInput 一行一個貼上。
Q: 留言的 HTML 要怎麼處理?
A: 已自動處理。content 欄位輸出的是純文字,HTML 標籤已去除,HTML 實體已解碼(& → &、< → < 等)。
Q: 為什麼 thread-list 模式的 content 是 null?
A: 列表 API 不返回貼文內容,只有標題和元資料。若需要內文,改用 thread 模式。
免責聲明
本工具僅供學術研究及合法商業分析用途。使用者應遵守 LIHKG 服務條款及相關法規。請勿以本工具進行任何侵害他人隱私、散布虛假資訊或其他違法行為。作者不對任何濫用行為承擔責任。
LIHKG 爬蟲、連登、香港輿情、論壇監控、品牌聲量、香港社群數據