Threads 帳號時間軸 API

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

快速解答

POST /threads/users/task 帶 author_id(Threads 帳號名稱,開頭的 @ 可有可無),可加 start_date 與 end_date,會建立一個非同步任務,蒐集該公開帳號的貼文。輪詢 GET /threads/users/task/{task_id},貼文在 data 回傳,total_count 為筆數;每則貼文有網址、原生貼文 ID、內文、時間戳記、按讚、回覆與分享數,以及媒體網址。資料以網路爬蟲蒐集 Threads 公開發布的內容。

常見用途

  • 追蹤品牌、媒體或機構的官方帳號在一段期間內發布了什麼。
  • 為研究保存公開帳號帶日期的發文紀錄。
  • 在同一段日期區間內,比較多個帳號的發文頻率與互動。

端點一覽

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

方法路徑說明
POST /threads/users/task 建立公開帳號的貼文時間軸任務,可加日期區間。
GET /threads/users/task/{task_id} 輪詢時間軸任務:回傳狀態、計數,以及 data 內該帳號的貼文。

請求參數

POST /threads/users/task

參數位置型別必填預設值/可用值說明
author_id body string 是 公開帳號的 Threads 帳號名稱,開頭的 @ 可有可無。
end_date body string 否 日期區間迄日,含當日(YYYY-MM-DD)。沒有 start_date 時會被忽略。
mask_author body boolean 否 false 設為 true 時,該次回應會移除作者身分欄位。要遮蔽回傳的資料列,請在每次 GET 輪詢時帶上。
max_scroll body integer 否 爬取時的捲動上限,整數。
rerun body boolean 否 布林值;重新執行蒐集。
start_date body string 否 日期區間起日,含當日(YYYY-MM-DD)。

GET /threads/users/task/{task_id}

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

回應欄位

資料欄位端點
公開帳號的貼文 id, post_id, url, author, author_id, author_name, content, tm, tm_crawler, like_count, reaction_count, comment_count, share_count, is_reply, is_quote, metadata_img, metadata_videos, tag, source GET /threads/users/task/{task_id}

程式碼範例

curl:建立任務

curl -X POST https://api.infominer.io/api/v2/threads/users/task \
  -H "auth-header: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"author_id": "sample_user_1", "start_date": "2026-06-01", "end_date": "2026-06-30"}'

curl:以任務 ID 輪詢

curl "https://api.infominer.io/api/v2/threads/users/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/users/task",
    headers=HEADERS,
    json={
        "author_id": "sample_user_1",
        "start_date": "2026-06-01",
        "end_date": "2026-06-30",
    },
    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/users/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("url"), (row.get("content") or "")[:60])

示意回應樣本

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

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

{
  "id": "00000000-0000-4000-8000-000000000001",
  "status": "DONE",
  "author_id": "sample_user_1",
  "start_date": "2026-06-01",
  "end_date": "2026-06-30",
  "total": 2,
  "completed": 2,
  "partial": false,
  "timed_out": false,
  "failed_articles": 0,
  "failed_pages": 0,
  "total_count": 2,
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000003",
      "source": "threads",
      "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,
      "metadata_img": [],
      "metadata_videos": [],
      "tag": ""
    },
    {
      "id": "00000000-0000-4000-8000-000000000006",
      "source": "threads",
      "post_id": "00000000004",
      "url": "https://www.threads.com/@sample_user_1/post/00000000004",
      "author": "sample_user_1",
      "author_id": "0000000001",
      "content": "整理了這個月走過的三條步道,交通方式和所需時間都寫在清單裡",
      "tm": 1781229600,
      "tm_crawler": 1781316000,
      "like_count": 12,
      "reaction_count": 12,
      "comment_count": 0,
      "share_count": 2,
      "is_reply": false,
      "is_quote": false,
      "metadata_img": [],
      "metadata_videos": [],
      "tag": ""
    }
  ]
}

限制與注意事項

  • author_id 為必填;start_date 與 end_date 為選填,皆含當日。
  • 輪詢回應以分頁回傳:在 GET 請求帶 page 與 per_page(per_page 預設與上限皆為 1000)。回應會標示 page、per_page 與 total_count(目前已蒐集的總筆數),依 total_count 繼續讀取後續頁面。
  • 只給 end_date 而沒有 start_date 時,上游會忽略這個日期並套用預設區間。
  • 只蒐集 Threads 公開發布的內容。
  • 可回溯的期間與更新頻率,依專案範圍確認。
蒐集方式:以網路爬蟲蒐集各平台公開發布的內容。是否適用於您的用途,依用途與法域由買方法務評估,我們可提供來源與蒐集方式說明。

更多 Threads API 頁面

申請試用

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

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

填寫申請表單

常見問題

author_id 要填什麼?
該帳號的 Threads 帳號名稱,開頭的 @ 可有可無。
可以蒐集不公開帳號的貼文嗎?
不行。只蒐集 Threads 公開發布的內容。
時間軸會包含每則貼文的回覆嗎?
時間軸任務蒐集的是該帳號的貼文。要蒐集某則貼文的回覆,請用該貼文的網址建立回覆任務。
資料是怎麼蒐集的?這是 Threads 官方的 API 嗎?
資料以網路爬蟲蒐集 Threads 公開發布的內容。大數軟體與 Meta、Threads 沒有隸屬或合作關係,這也不是 Meta 提供的 Threads API。是否適用於您的用途,依用途與法域由買方法務評估,我們可提供來源與蒐集方式說明。