# Meta Threads 爬蟲 — 貼文、用戶、標籤與關鍵字一次搞定 (`claude_code_reviewer/threads-feed-scraper`) Actor

一個 Actor 搞定五種模式：用戶主頁、標籤話題、關鍵字搜尋、單篇貼文（含留言）、自訂動態。批量貼上 100 個帳號、支援相對日期（「7 天」、「1 個月」）、完整互動數據（讚、回覆、轉發、分享、觀看、引用）、ISO 時間戳、媒體網址。不用登入、不用 API token。每筆結果 $0.005。

- **URL**: https://apify.com/claude\_code\_reviewer/threads-feed-scraper.md
- **Developed by:** [Chad](https://apify.com/claude_code_reviewer) (community)
- **Categories:** Social media, Automation, Developer tools
- **Stats:** 101 total users, 12 monthly users, 100.0% runs succeeded, 6 bookmarks
- **User rating**: 4.89 out of 5 stars

## Pricing

from $2.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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

## Meta Threads 爬蟲 — 貼文、用戶、標籤與關鍵字一次搞定

一個 Actor 搞定 Threads 上五種你會用到的抓取模式：**用戶主頁**、**標籤話題**、**關鍵字搜尋**、**單篇貼文 + 留言**、**自訂動態 feed**。不需要登入、不需要 API token、批量貼上 100 個帳號都吃得下。輸出欄位該有的全部都有：讚、回覆、轉發、分享、觀看、引用、媒體網址、ISO 時間。每筆結果 **$0.005**，沒有啟動費。

給誰用的：做品牌輿情的、追 KOL 的、寫競品報告的、跑 SaaS 串 Threads 資料的、論文需要資料集的、自己寫 side project 的工程師。

***

### 能抓到什麼

每一篇貼文都會拿到下面這些欄位：

| 欄位 | 說明 | 範例 |
|------|------|------|
| `postId` | 貼文 ID | `DWOlac1D3-Z` |
| `author` | 作者帳號 | `ponbu` |
| `content` | 貼文全文 | `東森寵物大里國光店 打烊之後把狗留在...` |
| `publishedAt` | 發佈時間（原始） | `5d` 或 `03/04/26` |
| `publishedAtISO` | 發佈時間（ISO 8601） | `2026-03-24T05:16:47.304Z` |
| `likeCount` | 讚數 | `48700` |
| `replyCount` | 回覆數 | `6300` |
| `repostCount` | 轉發數 | `4400` |
| `shareCount` | 分享數 | `20300` |
| `viewCount` | 觀看數 | `150000` |
| `quoteCount` | 引用數 | `230` |
| `mediaType` | 媒體類型 | `text`、`photo`、`video`、`carousel` |
| `mediaUrls` | 媒體連結陣列 | `[{ url, type }]` |
| `postUrl` | 貼文網址 | `https://www.threads.com/@user/post/...` |
| `sourceType` | 這筆從哪個模式來的 | `profile`、`tag`、`search`、`post`、`feed` |
| `sourceQuery` | 抓取時用的查詢條件 | `寵物醫療` |
| `scrapedAt` | 抓取當下時間 | `2026-03-29T05:23:28.617Z` |
| `threadParts` | 如果是串文，自動合併每一段 | `[{ postId, content, postUrl, mediaUrls }]` |
| `replies` | 留言（只有 post 模式才有） | `[{ author, content, publishedAt, likeCount }]` |

Dataset 欄位名稱是英文（`username`、`like_count` 那種），方便你下游的程式接。

***

### 五種模式一個爬蟲

別人家的 Threads 爬蟲常常拆成 4-5 個不同的 Actor，你要抓用戶一個、抓標籤又一個、抓留言再一個，串 API 串到想關電腦。這個就是把全部塞在同一個 Actor 裡，選 Mode 就好。

| 模式 | 幹嘛用的 | 要填哪個欄位 |
|------|----------|--------------|
| 👤 **User** | 抓某個用戶的所有貼文 | `usernames[]` |
| 🏷️ **Hashtag** | 抓 hashtag 話題頁面 | `keywords[]` |
| 🔎 **Search** | 關鍵字搜尋（可選熱門 / 最新） | `keywords[]` + `searchSort` |
| 💬 **Post** | 單篇貼文 + 前 20 則留言 | `postUrls[]` |
| 📰 **Feed** | Threads 自訂 feed 網址 | `feedUrls[]` |

一次跑一個 mode，從 Apify Console 的下拉選單選就好。

***

### 輸入欄位

| 欄位 | 型別 | 必填 | 預設 | 說明 |
|------|------|:----:|:----:|------|
| `mode` | enum | 建議填 | `user` | `user` / `hashtag` / `search` / `post` / `feed` 擇一。不填的話會自動偵測你填了什麼欄位。 |
| `usernames` | string\[] | `user` 模式必填 | — | 純帳號，不用加 `@` 也不用貼整串網址。單次最多 **100** 個。 |
| `bulkUsernames` | string | 選填 | — | 貼上一整欄 Google Sheet / Excel 的帳號（一行一個），會自動併進 `usernames`。適合懶人模式。 |
| `keywords` | string\[] | `hashtag` / `search` 必填 | — | 關鍵字或 hashtag（開頭 `#` 可有可無）。單次最多 **100** 個。 |
| `bulkKeywords` | string | 選填 | — | 同上，一行一個關鍵字貼上去就好。 |
| `postUrls` | string\[] | `post` 模式必填 | — | Threads 貼文完整網址，留言會一起抓。 |
| `feedUrls` | string\[] | `feed` 模式必填 | — | Threads 自訂 feed 網址。 |
| `searchSort` | enum | 選填 | `top` | `top`（熱門）或 `recent`（最新），只對 `search` 模式有效。 |
| `dateFrom` | string | 選填 | — | `YYYY-MM-DD` **或**相對日期：`7 days`、`1 month`、`2 weeks`、`1 year`。 |
| `dateTo` | string | 選填 | — | 同 `dateFrom` 格式。 |
| `maxPosts` | integer | 選填 | `50` | 每個來源最多抓幾篇（1-500）。捲動次數會自動算，你不用管。 |

***

### 範例

**👤 抓一批 Threads 紅人**

```json
{
  "mode": "user",
  "usernames": ["ponbu", "zuck", "mosseri"],
  "maxPosts": 50
}
```

**🏷️ 追一個月內的 `#寵物友善` 話題**

```json
{
  "mode": "hashtag",
  "keywords": ["#寵物友善"],
  "dateFrom": "1 month",
  "maxPosts": 200
}
```

**🔎 過去 7 天講「台積電」的最新貼文**

```json
{
  "mode": "search",
  "keywords": ["台積電", "護國神山"],
  "searchSort": "recent",
  "dateFrom": "7 days",
  "maxPosts": 100
}
```

**💬 單篇爆文 + 留言**

```json
{
  "mode": "post",
  "postUrls": ["https://www.threads.com/@ponbu/post/DWOlac1D3-Z"]
}
```

**📋 懶人模式：一次貼 80 個 KOL 帳號**

直接把 Google Sheet / Excel 那一整欄 Ctrl+C → 貼到 `bulkUsernames` 就好，不用一個一個點「新增」。

**Console 表單的填法：一行一個，按 Enter 換行，不要加引號、不要用逗號。** 長這樣：

```
ponbu
zuck
mosseri
threadsapp
taylornikolai
```

如果是走 API 呼叫（不是 Console 表單），`bulkUsernames` 是一個字串，裡面用 `\n` 換行：

```json
{
  "mode": "user",
  "bulkUsernames": "ponbu\nzuck\nmosseri\nthreadsapp\ntaylornikolai",
  "maxPosts": 20
}
```

***

### 幾個要注意的地方

- **`maxPosts` 是上限不是保證**。如果那個帳號本來就沒幾篇、或那個 hashtag 很冷，抓出來就會少於你設的數字。爬蟲連續 5 次捲不到新東西就會自己停，不會傻傻跑整場。
- **相對日期是執行當下算的**。`"7 days"` 今天跑跟明天跑會得到不同的 `dateFrom`，這對排程任務很好用（每天抓「最近一週」就設一次、永遠對）。
- **Threads 顯示的大數字是簡寫**（像 `12.5K`、`1.7M`），爬蟲會幫你換算成整數，所以 `12.5K` 會變 `12500`，不是精準的真實值。這點 Threads 自己也沒給精確數字，沒辦法。
- **留言只有 `post` 模式才會抓**，每篇最多抓前 ~20 則，用來看風向夠用、但不適合拿去做完整留言情緒分析。
- **串文會自動合併**。那種「1/」、「2/」一路接下去的多段貼文會被併成同一筆，每段變成 `threadParts[]` 裡的元素，你不會看到 7 段同主題被當成 7 筆個別貼文。
- **不用登入 = 只抓得到公開內容**。鎖帳號的、需要追蹤才能看的貼文，這隻看不到，請不要 Issue 說為什麼抓不到你前男友的限動。

***

### 常見問題

**Q: 帳號要加 `@` 嗎？要貼整串網址嗎？**
都不用。直接 `ponbu` 就好。有加 `@` 會自動去掉，貼舊版 `profileUrls` 整串網址的舊用戶也會自動遷移，現有 schedule 不會爛掉。

**Q: 我設 `maxPosts: 100` 但只抓到 60 篇，是不是壞了？**
八成不是，是那個來源本來就沒那麼多可見貼文。看 run log 裡的 `totalItems` 和 `in date range` 的數字就知道爬蟲是不是有正常工作。如果你 search 的是熱門詞但每次都只回 20 篇以下，再來開 Issue。

**Q: 為什麼有些欄位是 `null` 或 `0`？**
Threads 自己就沒給。觀看數（`viewCount`）特別明顯，只有公開且互動夠高的帳號才會顯示；引用數（`quoteCount`）也會依貼文類型時有時無。這是資料缺失不是 silent failure，該有的欄位都會出現，只是值是空的。

**Q: `dateFrom` / `dateTo` 對每個 mode 都有效嗎？**
技術上每個 mode 都會套日期過濾，但只有 `search`、`hashtag`、`user` 三個模式有意義。`post` 模式你給的是確定的網址，不會被日期篩掉。`feed` 模式會篩，但取決於那個 feed 本身怎麼排序。

**Q: 可以匯出哪些格式？**
JSON、CSV、Excel、XML、HTML table — Apify dataset 標準的幾種都有，可以從 Console 下載，或接 Apify API / Python / JavaScript SDK。串 Zapier、Make、n8n、Google Sheets 也都行。

***

### 跟官方 Threads API 的差別

Meta 有出[官方 Threads API](https://developers.facebook.com/docs/threads)，但限制很硬：

- 只能讀**你自己的帳號**或**授權給你的帳號**的資料 — 想追競品、追 KOL、追公眾話題？官方 API 一律不給。
- 要跑 OAuth、要申請 Facebook Developer 帳號、發布類應用還要過審。
- Rate limit 跟端點覆蓋度比「一個沒登入的瀏覽器看得到的東西」還窄。

如果你的用途是公開資料分析（輿情、趨勢、競品、社群研究），走 scraper 快很多。如果你是要發文 / 管理自己帳號 / 跑自動化回覆，那就乖乖用官方 API。

***

### 免責聲明

本爬蟲只收集**公開可見**的 Threads 資料，不會存取私人帳號、不會繞過登入牆、不會蒐集一個沒登入的訪客看不到的個人資料。用途記得自己評估是否符合當地法規（GDPR、CCPA、個資法）跟 Meta 的服務條款。拿去做正經研究、品牌監控、學術分析都 OK，拿去做騷擾、垃圾訊息、未授權資料轉售就別鬧了。

***

*Threads 爬蟲 · Meta Threads 資料抓取 · Threads 貼文擷取 · Threads 關鍵字搜尋 · Threads 標籤抓取 · Threads 用戶主頁 · Threads 留言抓取 · Threads 自訂動態 · 輿情監控 · 品牌監控 · 競品分析 · KOL 追蹤 · 社群聆聽 · 網紅行銷數據 · 台灣 Threads · Threads API 替代方案*

# Actor input Schema

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

要抓什麼?選一個模式,下面對應的欄位填一下就好。

## `usernames` (type: `array`):

Threads 純帳號(不用加 @ 也不用貼網址)。例如:ponbu、zuck。用戶模式用這個欄位。

## `bulkUsernames` (type: `string`):

**一行一個帳號**,按 Enter 換行。**不要加引號、不要用逗號分隔。** 範例:

```
ponbu
zuck
mosseri
```

直接從 Google Sheet / Excel 複製一整欄貼進來最快。執行時會自動併進上面的「帳號列表」。

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

搜尋模式的關鍵字,或標籤模式的 hashtag(開頭 # 可有可無)。例如:AI news、#寵物友善、台積電。⚠️ **一個概念一個關鍵字** — Threads 搜尋會把整串當一個詞匹配,複合詞像「冥想正念」會回 0 筆,要拆成「冥想」和「正念」兩個關鍵字分別跑。

## `bulkKeywords` (type: `string`):

**一行一個關鍵字或 hashtag**,按 Enter 換行。**不要加引號、不要用逗號分隔。** 範例:

```
台積電
護國神山
#AI
```

執行時會自動併進上面的「關鍵字 / 標籤」。

## `searchSort` (type: `string`):

關鍵字搜尋的排序方式,只有「搜尋」模式會吃這個設定。

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

最早的貼文日期。可填 YYYY-MM-DD 絕對日期,或相對表示法:「7 days」、「1 month」、「2 weeks」。

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

最晚的貼文日期。格式同起始日期。

## `postUrls` (type: `array`):

Threads 貼文完整網址,會一併抓留言。例如:https://www.threads.com/@user/post/ABC123。

## `feedUrls` (type: `array`):

Threads 自訂 feed 網址。例如:https://www.threads.com/custom\_feed/18113589370710265。

## `maxPosts` (type: `integer`):

每個來源最多抓幾篇貼文。越多費用越高 (每筆 $0.005)。捲動次數會自動算,不用手動調。

## Actor input object example

```json
{
  "mode": "user",
  "usernames": [
    "zuck"
  ],
  "searchSort": "top",
  "maxPosts": 50
}
```

# 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": "user",
    "usernames": [
        "zuck"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("claude_code_reviewer/threads-feed-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": "user",
    "usernames": ["zuck"],
}

# Run the Actor and wait for it to finish
run = client.actor("claude_code_reviewer/threads-feed-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": "user",
  "usernames": [
    "zuck"
  ]
}' |
apify call claude_code_reviewer/threads-feed-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=claude_code_reviewer/threads-feed-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/gYxIBYI7YR97txviU/builds/EfLRR2aqopvAZGR1g/openapi.json
