Threads 回覆 API

參數依 2026-10-25 規格快照;回應資料列依 2026-11-21 實際 API 回應

快速解答

POST /threads/pushs/task 帶貼文網址,會建立一個非同步任務,蒐集該則貼文的回覆。輪詢 GET /threads/pushs/task/{task_id},data 內含原貼文與它的回覆,total_count 為資料列數。每則回覆有 reply_level(1 為直接回覆,2 為回覆的回覆)、reply_to_author、回覆本身的網址、作者、內文、時間戳記,以及按讚、回覆與分享數;第二層回覆另帶 parent_id,值是被回覆那則回覆的 comment_id。資料以網路爬蟲蒐集 Threads 公開發布的內容。

常見用途

  • 了解讀者對品牌公告、活動貼文或新聞貼文的回應,而不只是貼文本身寫了什麼。
  • 沿著直接回覆與回覆的回覆,追蹤一則貼文底下的對話。
  • 搭配 reactions API,把回覆和貼文的瀏覽、按讚與分享數放在一起看。

端點一覽

Base URL 為 https://api.infominer.io/api/v2,每個請求以 auth-header 標頭帶 API 金鑰。

方法路徑說明
POST /threads/pushs/task 以貼文網址建立回覆蒐集任務。
GET /threads/pushs/task/{task_id} 輪詢回覆任務:回傳狀態、計數,以及 data 內的原貼文與回覆。

請求參數

POST /threads/pushs/task

參數位置型別必填預設值/可用值說明
post_url body string 是 Threads 貼文網址,例如 https://www.threads.com/@username/post/{id}。
mask_author body boolean 否 false 設為 true 時,該次回應會移除作者身分欄位。要遮蔽回傳的資料列,請在每次 GET 輪詢時帶上。
max_scroll body integer 否 爬取時的捲動上限,整數。
rerun body boolean 否 布林值;重新執行蒐集。

GET /threads/pushs/task/{task_id}

參數位置型別必填預設值/可用值說明
task_id path string 是 建立任務時回傳的任務 ID。
mask_author query boolean 否 false 設為 true 時,該次回應會移除作者身分欄位。要遮蔽回傳的資料列,請在每次 GET 輪詢時帶上。

回應欄位

資料欄位端點
回覆 id, comment_id, post_id, url, post_url, root_post_id, parent_id, reply_level, reply_to_author, author, author_id, content, tm, tm_crawler, like_count, reaction_count, comment_count, share_count, is_reply, is_quote GET /threads/pushs/task/{task_id}

程式碼範例

curl:建立任務

curl -X POST https://api.infominer.io/api/v2/threads/pushs/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/pushs/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/pushs/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/pushs/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)
for row in result.get("data", []):
    print(row.get("reply_level"), row.get("author"), (row.get("content") or "")[:60])

示意回應樣本

以下為人工撰寫的示意資料:帳號為 sample_user_n,ID 明顯為假值。欄位名稱取自 2026-11-21 實際的 API 回應,範例只列出部分欄位。

任務完成後的輪詢回應(示意資料)

{
  "id": "00000000-0000-4000-8000-000000000001",
  "status": "DONE",
  "post_url": "https://www.threads.com/@sample_user_1/post/00000000001",
  "total": 2,
  "completed": 2,
  "partial": false,
  "timed_out": false,
  "failed_articles": 0,
  "failed_pages": 0,
  "total_count": 3,
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000003",
      "post_id": "00000000001",
      "root_post_id": "00000000001",
      "url": "https://www.threads.com/@sample_user_1/post/00000000001",
      "author": "sample_user_1",
      "author_id": "0000000001",
      "content": "週末走了一條不太熱門的步道,沿途視野很開闊,建議早點出發避開人潮",
      "tm": 1781056800,
      "tm_crawler": 1781143200,
      "like_count": 34,
      "reaction_count": 34,
      "comment_count": 2,
      "share_count": 1,
      "is_reply": false,
      "is_quote": false,
      "reply_to_author": ""
    },
    {
      "id": "00000000-0000-4000-8000-000000000004",
      "comment_id": "00000000002",
      "post_id": "00000000-0000-4000-8000-000000000003",
      "post_url": "https://www.threads.com/@sample_user_1/post/00000000001",
      "root_post_id": "00000000001",
      "url": "https://www.threads.com/@sample_user_2/post/00000000002",
      "reply_level": 1,
      "reply_to_author": "sample_user_1",
      "author": "sample_user_2",
      "author_id": "0000000002",
      "content": "請問這條步道雨天好走嗎?下週想安排家人一起去",
      "tm": 1781060400,
      "tm_crawler": 1781143200,
      "like_count": 3,
      "reaction_count": 3,
      "comment_count": 1,
      "share_count": 0,
      "is_reply": true,
      "is_quote": false
    },
    {
      "id": "00000000-0000-4000-8000-000000000005",
      "comment_id": "00000000003",
      "post_id": "00000000-0000-4000-8000-000000000003",
      "post_url": "https://www.threads.com/@sample_user_1/post/00000000001",
      "root_post_id": "00000000001",
      "parent_id": "00000000002",
      "url": "https://www.threads.com/@sample_user_1/post/00000000003",
      "reply_level": 2,
      "reply_to_author": "sample_user_2",
      "author": "sample_user_1",
      "author_id": "0000000001",
      "content": "下雨後石階會比較滑,建議穿防滑的鞋子",
      "tm": 1781064000,
      "tm_crawler": 1781143200,
      "like_count": 1,
      "reaction_count": 1,
      "comment_count": 0,
      "share_count": 0,
      "is_reply": true,
      "is_quote": false
    }
  ]
}

限制與注意事項

  • data 會把建立任務的那則貼文列為一筆資料,與它的回覆一起回傳。
  • 輪詢回應以分頁回傳:在 GET 請求帶 page 與 per_page(per_page 預設與上限皆為 1000)。回應會標示 page、per_page 與 total_count(目前已蒐集的總筆數),依 total_count 繼續讀取後續頁面。
  • reply_level 標示層級:1 為直接回覆,2 為回覆的回覆。
  • max_scroll 必須是整數。
  • 每則貼文的筆數與更新頻率,依專案範圍確認。
蒐集方式:以網路爬蟲蒐集各平台公開發布的內容。是否適用於您的用途,依用途與法域由買方法務評估,我們可提供來源與蒐集方式說明。

更多 Threads API 頁面

申請試用

填寫下方申請表單時,請註明 Threads,並說明要搜尋的關鍵字或帳號、是否需要回覆與 reactions,以及是否需要遮蔽作者欄位。我們會確認範圍,並回覆試用與 API 金鑰的安排。

填寫表單申請試用,專人確認範圍後回覆試用與介接安排。

填寫申請表單

常見問題

post_url 要填哪一種網址?
Threads 貼文的網址,格式為 https://www.threads.com/@username/post/{id}。
回覆如何對回貼文,以及彼此如何關聯?
每一筆回覆都有 post_url 與 root_post_id,指向建立任務的那則貼文。第二層回覆另有 parent_id,等於被回覆那則回覆的 comment_id。
可以一次蒐集多則貼文的回覆嗎?
每個貼文網址建立一個回覆任務。貼文網址可從關鍵字搜尋或時間軸資料列的 url 欄位取得。
資料是怎麼蒐集的?這是 Threads 官方的 API 嗎?
資料以網路爬蟲蒐集 Threads 公開發布的內容。大數軟體與 Meta、Threads 沒有隸屬或合作關係,這也不是 Meta 提供的 Threads API。是否適用於您的用途,依用途與法域由買方法務評估,我們可提供來源與蒐集方式說明。