Threads reactions API
參數依 2026-10-25 規格快照;回應資料列依 2026-11-21 實際 API 回應
快速解答
POST /threads/reactions/task 帶貼文網址,會建立一個非同步任務,蒐集該則貼文的 reactions。輪詢 GET /threads/reactions/task/{task_id},任務執行中回傳狀態與計數;DONE 之後,回應包含 task 物件(帶有貼文的 view_count、like_count、share_count)、reactions 清單 data(每筆有 type,例如 LIKE,以及做出反應的帳號)與 pagination,每頁最多 1000 筆。輪詢時帶 mask_author=true 可移除回應中的作者身分欄位。資料以網路爬蟲蒐集 Threads 公開發布的內容。
常見用途
- 用一個任務掌握單則貼文的瀏覽、按讚與分享數。
- 比較關鍵字搜尋找到的多則貼文各自的 reactions 數量。
- 只需要數量與類型時,遮蔽作者欄位後再蒐集 reactions。
端點一覽
Base URL 為 https://api.infominer.io/api/v2,每個請求以 auth-header 標頭帶 API 金鑰。
| 方法 | 路徑 | 說明 |
|---|---|---|
| POST | /threads/reactions/task |
以貼文網址建立 reactions 蒐集任務,rerun 預設為 true。 |
| GET | /threads/reactions/task/{task_id} |
輪詢 reactions 任務;成功完成時回傳 reactions 清單與分頁。 |
請求參數
POST /threads/reactions/task
| 參數 | 位置 | 型別 | 必填 | 預設值/可用值 | 說明 |
|---|---|---|---|---|---|
post_url |
body | string | 是 | 要蒐集 reactions 的 Threads 貼文網址。 | |
mask_author |
body | boolean | 否 | false |
設為 true 時,該次回應會移除作者身分欄位。要遮蔽回傳的資料列,請在每次 GET 輪詢時帶上。 |
rerun |
body | boolean | 否 | true |
預設為 true:重送同一個 post_url 會建立新任務。 |
GET /threads/reactions/task/{task_id}
| 參數 | 位置 | 型別 | 必填 | 預設值/可用值 | 說明 |
|---|---|---|---|---|---|
task_id |
path | string | 是 | 建立任務時回傳的任務 ID。 | |
mask_author |
query | boolean | 否 | false |
設為 true 時,該次回應會移除作者身分欄位。要遮蔽回傳的資料列,請在每次 GET 輪詢時帶上。 |
page |
query | integer | 否 | 頁碼,從 1 開始。 | |
per_page |
query | integer | 否 | 最多 1000 |
每頁 reactions 筆數,最多 1000。 |
回應欄位
| 資料 | 欄位 | 端點 |
|---|---|---|
| reactions | task: status, post_id, view_count, like_count, share_count, total, completed; data: id, post_id, type, author, author_id, updated_at; pagination: page, per_page, total_count, total_pages, has_next, has_prev; error_message | GET /threads/reactions/task/{task_id} |
程式碼範例
curl:建立任務
curl -X POST https://api.infominer.io/api/v2/threads/reactions/task \
-H "auth-header: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"post_url": "https://www.threads.com/@sample_user_1/post/00000000001", "mask_author": false}'
curl:以任務 ID 輪詢
curl "https://api.infominer.io/api/v2/threads/reactions/task/$TASK_ID?page=1&per_page=1000" \
-H "auth-header: YOUR_API_KEY"
Python(requests):建立、輪詢、讀取
import time
import requests
BASE_URL = "https://api.infominer.io/api/v2"
HEADERS = {"auth-header": "YOUR_API_KEY"}
# 1. Create the task
resp = requests.post(
f"{BASE_URL}/threads/reactions/task",
headers=HEADERS,
json={
"post_url": "https://www.threads.com/@sample_user_1/post/00000000001",
"mask_author": False,
},
timeout=30,
)
resp.raise_for_status()
task = resp.json()
# 2. Poll until the task leaves INIT / RUNNING
for _ in range(120):
resp = requests.get(
f"{BASE_URL}/threads/reactions/task/{task['id']}",
headers=HEADERS,
params={
"page": 1,
"per_page": 1000,
},
timeout=30,
)
resp.raise_for_status()
result = resp.json()
status = result.get("status") or result.get("task", {}).get("status")
if status not in ("INIT", "RUNNING"):
break
time.sleep(15)
else:
raise SystemExit("task still running; poll it again later")
if status == "FAILED":
raise SystemExit("task failed")
if status != "DONE":
print("task ended with status", status, "- results may be incomplete")
# 3. Read the records (use page / per_page to fetch further pages)
if result.get("error_message"):
raise SystemExit(result["error_message"])
for row in result.get("data", []):
print(row.get("type"), row.get("author"))
示意回應樣本
以下為人工撰寫的示意資料:帳號為 sample_user_n,ID 明顯為假值。欄位名稱取自 2026-11-21 實際的 API 回應,範例只列出部分欄位。
任務完成後的輪詢回應(示意資料)
{
"task": {
"id": "00000000-0000-4000-8000-000000000001",
"status": "DONE",
"post_url": "https://www.threads.com/@sample_user_1/post/00000000001",
"post_id": "0000000000000000001",
"view_count": 1250,
"like_count": 2,
"share_count": 1,
"total": 2,
"completed": 2,
"partial": false,
"timed_out": false,
"failed_articles": 0,
"failed_pages": 0
},
"data": [
{
"id": "00000000-0000-4000-8000-000000000007",
"post_id": "0000000000000000001",
"type": "LIKE",
"author": "sample_user_3",
"author_id": "0000000003",
"updated_at": 1781143200
},
{
"id": "00000000-0000-4000-8000-000000000008",
"post_id": "0000000000000000001",
"type": "LIKE",
"author": "sample_user_4",
"author_id": "0000000004",
"updated_at": 1781143200
}
],
"pagination": {
"page": 1,
"per_page": 1000,
"total_count": 2,
"total_pages": 1,
"has_next": false,
"has_prev": false
}
}
限制與注意事項
- per_page 最多 1000。
- reactions 回應的 post_id 是 Threads 的數字貼文 ID,與搜尋、時間軸資料列的 post_id(網址中的代碼)不同;請以 post_url 對應。
- rerun 預設為 true,重送同一個 post_url 會建立新任務。
- 任務成功但清單取不到時,回應會帶 error_message。
- 每則貼文的筆數與更新頻率,依專案範圍確認。
更多 Threads API 頁面
申請試用
填寫下方申請表單時,請註明 Threads,並說明要搜尋的關鍵字或帳號、是否需要回覆與 reactions,以及是否需要遮蔽作者欄位。我們會確認範圍,並回覆試用與 API 金鑰的安排。
填寫表單申請試用,專人確認範圍後回覆試用與介接安排。
填寫申請表單常見問題
- reactions 任務會回傳哪些數字?
- task 物件回傳貼文的 view_count、like_count 與 share_count,pagination.total_count 為 reactions 的資料列數。
- reactions 要怎麼翻頁?
- 在 GET 請求帶 page 與 per_page。per_page 最多 1000,pagination 會回傳 has_next 與 total_pages。
- 可以不回傳做出反應的帳號嗎?
- 可以。在每次 GET 輪詢請求帶 mask_author=true,該次回應會移除作者身分欄位。
- 資料是怎麼蒐集的?這是 Threads 官方的 API 嗎?
- 資料以網路爬蟲蒐集 Threads 公開發布的內容。大數軟體與 Meta、Threads 沒有隸屬或合作關係,這也不是 Meta 提供的 Threads API。是否適用於您的用途,依用途與法域由買方法務評估,我們可提供來源與蒐集方式說明。