抖音帳號時間軸 API
依 2026-10-25 規格快照
快速解答
以 author_id、startDate 與 endDate(皆為必填,日期格式為 YYYY-MM-DD)呼叫 POST /douyin/users/task,會建立任務,蒐集抖音公開帳號在該區間內的貼文;max_items 預設 50、上限 1000,設為 0 代表不設則數上限。以 GET /douyin/users/task/{task_id} 輪詢;DONE 時回傳帳號 ID、profile 物件、timelines 與任務資訊。若次要時間軸服務暫時無法連線,任務仍會完成,回應以 error_message 說明。資料以網路爬蟲蒐集抖音公開發布的內容。
常見用途
- 追蹤品牌官方帳號或創作者在活動期間發布的內容。
- 為研究保存公開帳號的影片紀錄,每則附日期。
- 比較同一類別中多個帳號的發文活動。
端點一覽
Base URL 為 https://api.infominer.io/api/v2,每個請求以 auth-header 標頭帶 API 金鑰。
| 方法 | 路徑 | 說明 |
|---|---|---|
| POST | /douyin/users/task |
建立公開帳號的貼文時間軸任務,需帶帳號 ID 與起訖日期,可設 max_items。 |
| GET | /douyin/users/task/{task_id} |
輪詢時間軸任務;DONE 時回傳帳號資料與貼文時間軸。 |
請求參數
POST /douyin/users/task
| 參數 | 位置 | 型別 | 必填 | 預設值/可用值 | 說明 |
|---|---|---|---|---|---|
author_id |
body | string | 是 | 公開帳號的帳號 ID。 | |
endDate |
body | string | 是 | 結束日期(YYYY-MM-DD)。 | |
startDate |
body | string | 是 | 開始日期(YYYY-MM-DD)。 | |
max_items |
body | integer | 否 | 50(最多 1000) |
最多蒐集的貼文數;0 代表不設則數上限,只受爬取頁數上限限制。 |
GET /douyin/users/task/{task_id}
| 參數 | 位置 | 型別 | 必填 | 預設值/可用值 | 說明 |
|---|---|---|---|---|---|
task_id |
path | string | 是 | 建立任務時回傳的任務 ID。 |
回應欄位
| 資料 | 欄位 | 端點 |
|---|---|---|
| 公開帳號的貼文時間軸 | id, profile, timelines, task, error_message | GET /douyin/users/task/{task_id} |
程式碼範例
curl:建立任務
curl -X POST https://api.infominer.io/api/v2/douyin/users/task \
-H "auth-header: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"author_id": "0000000000000001", "startDate": "2026-06-01", "endDate": "2026-06-30", "max_items": 200}'
curl:以任務 ID 輪詢
curl "https://api.infominer.io/api/v2/douyin/users/task/$TASK_ID" \
-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}/douyin/users/task",
headers=HEADERS,
json={
"author_id": "0000000000000001",
"startDate": "2026-06-01",
"endDate": "2026-06-30",
"max_items": 200,
},
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}/douyin/users/task/{task['id']}",
headers=HEADERS,
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 profile and the timeline
print(result.get("profile"))
timelines = result.get("timelines")
rows = timelines.get("data", []) if isinstance(timelines, dict) else (timelines or [])
print(len(rows), "posts")
示意回應樣本
以下為人工撰寫的示意資料:帳號為 sample_user_n,ID 為明顯的假值。欄位依 2026-10-25 規格快照;樣本只呈現部分欄位,完整清單見上方表格。
建立任務的回應(示意資料)。快照沒有逐一列出 profile 與 timelines 內的欄位,請以試用資料確認。
{
"id": "00000000-0000-4000-8000-000000000001",
"author_id": "0000000000000001",
"startDate": "2026-06-01",
"endDate": "2026-06-30",
"status": "INIT",
"tm": 1780272000
}
限制與注意事項
- author_id、startDate 與 endDate 皆為必填。
- max_items 預設 50、上限 1000;設為 0 代表不設則數上限,只受爬取頁數上限限制。
- 若次要時間軸服務暫時無法連線,任務仍以完成狀態回傳,並附 error_message。
- 時間軸可回溯的期間與更新頻率,依專案範圍確認。
蒐集方式:以網路爬蟲蒐集各平台公開發布的內容。是否適用於您的用途,依用途與法域由買方法務評估,我們可提供來源與蒐集方式說明。
更多 抖音 API 頁面
申請試用
填寫下方申請表單時,請註明抖音,並說明要搜尋的關鍵字或帳號、每支影片需要的留言量,以及是否需要影片下載網址。我們會確認範圍,並回覆試用與 API 金鑰的安排。
填寫表單申請試用,專人確認範圍後回覆試用與介接安排。
填寫申請表單常見問題
- 一個時間軸任務可以蒐集多少則貼文?
- max_items 預設 50,上限 1000。設為 0 會取消則數上限,只受爬取頁數上限限制。
- 為什麼已完成的任務帶有 error_message?
- 因為次要時間軸服務暫時無法連線。任務仍以完成狀態回傳,error_message 會說明發生的情況。
- 可以蒐集非公開帳號的貼文嗎?
- 不行。只蒐集抖音公開發布的內容。
- 資料是怎麼蒐集的?這是抖音官方的 API 嗎?
- 資料以網路爬蟲蒐集抖音公開發布的內容。LargitData 與抖音沒有隸屬或合作關係,這也不是抖音自身提供的 API。是否適用於您的用途,依用途與法域由買方法務評估,我們可提供來源與蒐集方式說明。