# 抖音星圖影片資料包告 API

> 按影片 ID 或連結取星圖對一條抖音影片的資料包告：播放、點贊、評論、分享和收藏，加上完播率、互動率、時長、作者粉絲數和作者的星圖達人 ID（可接著查達人資料）。只有星圖收錄的影片才有，多是星圖達人的影片。

網頁版：https://okdata.online/zh/apis/douyin/xingtu/videos/get/

- **介面**：`GET /v1/douyin/xingtu/videos/get`
- **ID**：`douyin.xingtu.videos.get`
- **價格**：$0.004/次
- **返回**：一個 Post 物件（`data.item`）
- **狀態**：穩定
- **適合**：競品監控、找博主

## 價格

每次呼叫 $0.004，返回一個結果。查 1,000 次共 $4.00。請求到了平台的查詢，查不到或出錯也照常計費；還沒請求到平台就被攔下的不扣費。

## 引數

| 引數名 | 型別 | 必填 | 預設值 | 說明 |
|---|---|---|---|---|
| `id` | string | 否 |  | 影片 ID（一串數字）。手裡只有連結時，填到 url。id 和 url 二選一。（例：`7704318118394367270`） |
| `url` | string | 否 |  | 分享連結或網頁地址，會從中解析出 ID。（例：`https://www.douyin.com/video/7704318118394367270`） |
| `view` | string: brief / compact / standard / full | 否 | `standard` | 返回多少欄位。brief：只給 ID、標題、正文前 100 字、連結、時間和主要數字，適合先掃一遍列表，再按 ID 取詳情；compact 去掉空欄位、長正文截到 500 字；full 會在 ext 裡帶上平台特有欄位。 |
| `fields` | string[] | 否 |  | 只保留這些欄位，按路徑寫（如 author.name），用來省 token。放在查詢引數裡時用逗號分隔。 |

id 和 url 給一個就行。 
cursor、view、fields 的用法見 [請求說明](https://okdata.online/zh/docs/requests/)。

## 返回欄位

每一條都是一個 [Post](https://okdata.online/zh/docs/objects/post/)。

| 欄位 | 型別 | 說明 |
|---|---|---|
| `id` | string | 內容在平台上的 ID。 |
| `url` | string | 內容連結。 |
| `type` | string | 內容型別。 |
| `title` | string \| null | 標題（影片、筆記、文章才有）。 |
| `text` | string | 文案、正文或簡介，純文本；文章為 Markdown。 |
| `lang` | string \| null | 語言程式碼，平台給出或檢測得到。 |
| `published_at` | string \| null | 釋出時間，ISO 8601，UTC；只有平台不給時間（wechat_mp.articles.metrics、wechat_channels.videos.metrics、youtube.channels.videos.list 取 Shorts 時）或某次回答裡缺了時間（youtube.videos.get 偶爾會）時為 null，並列在 meta.unavailable 裡。不會是空字串。 |
| `author` | AccountRef | 釋出者。 |
| `metrics` | Metrics | 抓取時的資料；平台不公開的為 null。 |
| `images` | string[] \| null | 圖文內容的圖片地址。 |
| `hashtags` | string[] \| null | 話題標籤，不帶 #。 |
| `ext` | object | 平台特有欄位，只在 view=full 時返回。 |

## 請求示例

### cURL

```bash
curl -G "https://api.okdata.online/v1/douyin/xingtu/videos/get" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'id=7704318118394367270'
```

### Python

```python
import os
import requests

resp = requests.get(
    "https://api.okdata.online/v1/douyin/xingtu/videos/get",
    headers={"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"},
    params={"id": "7704318118394367270"},
    timeout=60,
)
body = resp.json()
if body["code"] != "ok":
    raise RuntimeError(f"{body['code']}: {body['message']} (charged: {body['charged']})")

row = body["data"]["item"]
print(row["id"], row["metrics"]["likes"], row["text"][:60])
print("cost: $" + body["meta"]["billing"]["amount"])
```

### TypeScript

```ts
const url = new URL('https://api.okdata.online/v1/douyin/xingtu/videos/get');
url.searchParams.set('id', "7704318118394367270");

const res = await fetch(url, {
  headers: {
    Authorization: `Bearer ${process.env.OKDATA_API_KEY}`,
  },
});
const body = await res.json();
if (body.code !== 'ok') throw new Error(`${body.code}: ${body.message}`);

const row = body.data.item;
console.log(row.id, row.metrics.likes, row.text.slice(0, 60));
console.log('cost: $' + body.meta.billing.amount);
```

### MCP

```json
{
  "name": "call",
  "arguments": {
    "capability": "douyin.xingtu.videos.get",
    "id": "7704318118394367270"
  }
}
```

或者對接好 MCP 的智慧體直接說：

> 用「抖音星圖影片資料包告」找出點贊最多的五條內容，附連結。

## 返回示例

```json
{
  "code": "ok",
  "request_id": "0f6c2a8e-4b1d-4e0a-9a51-3c7d2b9e1f20",
  "data": {
    "item": {
      "id": "7436185237401447690",
      "url": "https://www.douyin.com/video/7436185237401447690",
      "type": "video",
      "title": null,
      "text": "兩晚山裡露營，裝備清單都在這了 #露營 #戶外裝備",
      "lang": "zh",
      "published_at": "2026-11-02T09:30:00Z",
      "author": {
        "id": "MS4wLjABAAAAq8Xw2mKpT0",
        "username": "qingzhuang_tubu",
        "name": "輕裝徒步",
        "avatar_url": "https://cdn.example.com/avatar/trailkit.jpg",
        "followers": 182300,
        "verified": true
      },
      "metrics": {
        "views": null,
        "likes": 48200,
        "comments": 1312,
        "shares": 2210,
        "favorites": 9650,
        "reposts": null
      },
      "images": null,
      "hashtags": [
        "露營",
        "戶外裝備"
      ]
    }
  },
  "warnings": [],
  "meta": {
    "capability": "douyin.xingtu.videos.get",
    "result_status": "complete",
    "billing": {
      "amount": "0.004",
      "currency": "USD",
      "balance_after": "9.996"
    },
    "unavailable": {
      "metrics.views": "platform",
      "metrics.reposts": "platform"
    },
    "cached": false,
    "replayed": false,
    "fetched_at": "2026-11-11T08:00:00Z"
  }
}
```

## 錯誤

所有錯誤同一種結構：code、request_id、message 和 message_zh（每個 code 一句固定的話）、charged、retry、retry_after_seconds、param 和 docs_url，具體問題寫在 problems 裡。請求到了平台的調用出錯（查不到、平台失敗或超時）時，按這個介面的價格計一次費，charged 為 true，並給出 amount；引數錯誤這類還沒請求到平台的錯誤不扣費；這個介面的 not_found 至少收 $0.004。只有 settlement_unknown 的扣費結果要查詢後才知道。完整列表：https://okdata.online/zh/docs/errors/

## 常見問題

### 抖音星圖影片資料包告介面多少錢？

每次呼叫 $0.004，返回一個結果。查 1,000 次共 $4.00。請求到了平台的查詢，查不到或出錯也照常計費；還沒請求到平台就被攔下的不扣費。

### 可以直接傳分享連結嗎？

可以。把連結放進 url 引數，okdata 會從中解析出 ID，短連結也行。

### 需要抖音帳號、Cookie 或掃碼登入嗎？

不需要。只要帶上 okdata 的 API key。返回的是抖音上的公開資料，不會用到你自己的抖音帳號。

### 呼叫失敗會扣費嗎？

請求到了平台就會扣一次：返回為空、查不到、平台出錯或超時，都按一次呼叫計費（按條計價的按 1 條），錯誤裡 charged 為 true，並給出 amount。引數錯誤、餘額不足這類還沒請求到平台就被攔下的不扣費。

### 抖音不展示某個欄位怎麼辦？

這個欄位會是 null，meta.unavailable 裡會列出它和原因：platform（平台本來就不展示）或 capability（我們暫時取不到）。

## 抖音的其他介面

- [抖音影片搜尋](https://okdata.online/zh/apis/douyin/videos/search/)：$0.02/次 · 每頁約 20 條影片
- [抖音影片詳情](https://okdata.online/zh/apis/douyin/videos/get/)：$0.002/次
- [抖音影片評論](https://okdata.online/zh/apis/douyin/videos/comments/list/)：$0.002/次 · 每頁約 20 條評論
- [抖音帳號資訊](https://okdata.online/zh/apis/douyin/users/get/)：$0.002/次
- [抖音帳號作品列表](https://okdata.online/zh/apis/douyin/users/videos/list/)：$0.002/次 · 每頁約 20 條影片
- [抖音熱搜榜](https://okdata.online/zh/apis/douyin/trends/list/)：$0.002/次 · 每頁約 50 條榜單
- [抖音星圖達人搜尋](https://okdata.online/zh/apis/douyin/xingtu/creators/search/)：$0.004/次 · 每頁約 20 位達人
- [抖音星圖達人報價](https://okdata.online/zh/apis/douyin/xingtu/creators/rates/get/)：$0.04/次
- [抖音評論回覆](https://okdata.online/zh/apis/douyin/comments/replies/list/)：$0.002/次 · 每頁約 20 條評論
- [抖音話題影片](https://okdata.online/zh/apis/douyin/hashtags/videos/list/)：$0.002/次 · 每頁約 10 條影片
- [抖音帳號搜尋](https://okdata.online/zh/apis/douyin/users/search/)：$0.002/次 · 每頁約 30 個帳號
- [抖音影片播放量](https://okdata.online/zh/apis/douyin/videos/metrics/)：$0.002/次
- [抖音相關影片](https://okdata.online/zh/apis/douyin/videos/related/)：$0.002/次 · 每頁約 10 條影片
- [抖音影片榜](https://okdata.online/zh/apis/douyin/videos/trending/)：$0.002/次 · 每頁約 9 條影片
- [抖音搜尋框聯想詞](https://okdata.online/zh/apis/douyin/keywords/related/)：$0.02/次 · 每頁約 10 條結果
- [抖音巨量算數品牌指數趨勢](https://okdata.online/zh/apis/douyin/index/brands/history/)：$0.002/次
- [抖音巨量算數品牌指數對比](https://okdata.online/zh/apis/douyin/index/brands/metrics/)：$0.002/次
- [抖音巨量算數達人熱門影片](https://okdata.online/zh/apis/douyin/index/creators/videos/list/)：$0.002/次 · 每頁約 20 條影片
- [抖音巨量算數達人粉絲畫像](https://okdata.online/zh/apis/douyin/index/creators/audience/get/)：$0.002/次
- [抖音巨量算數達人核心指標](https://okdata.online/zh/apis/douyin/index/creators/metrics/)：$0.002/次
- [抖音巨量算數關鍵詞人群畫像](https://okdata.online/zh/apis/douyin/index/keywords/audience/get/)：$0.002/次
- [抖音巨量算數關鍵詞熱度趨勢](https://okdata.online/zh/apis/douyin/index/keywords/history/)：$0.006/次 · 每頁約 1 條結果
- [抖音巨量算數關聯詞](https://okdata.online/zh/apis/douyin/index/keywords/related/)：$0.002/次 · 每頁約 170 條結果
- [抖音巨量算數即時熱點](https://okdata.online/zh/apis/douyin/index/trends/list/)：$0.002/次 · 每頁約 30 條榜單
- [抖音巨量算數關鍵詞熱門影片](https://okdata.online/zh/apis/douyin/index/videos/search/)：$0.002/次 · 每頁約 20 條影片
- [抖音達人互動與粉絲趨勢](https://okdata.online/zh/apis/douyin/users/history/)：$0.002/次
- [抖音星圖達人資料](https://okdata.online/zh/apis/douyin/xingtu/creators/get/)：$0.004/次
- [抖音星圖達人粉絲畫像](https://okdata.online/zh/apis/douyin/xingtu/creators/audience/get/)：$0.004/次
- [抖音星圖達人傳播資料](https://okdata.online/zh/apis/douyin/xingtu/creators/metrics/)：$0.004/次
- [抖音星圖達人作品表現](https://okdata.online/zh/apis/douyin/xingtu/creators/videos/list/)：$0.004/次 · 每頁約 20 條影片
- [抖音星圖達人內容熱詞](https://okdata.online/zh/apis/douyin/xingtu/creators/keywords/get/)：$0.002/次
- [抖音星圖達人星圖指數](https://okdata.online/zh/apis/douyin/xingtu/creators/scores/get/)：$0.008/次
- [抖音星圖達人內容分佈](https://okdata.online/zh/apis/douyin/xingtu/creators/content_mix/get/)：$0.004/次
- [抖音星圖達人轉化能力](https://okdata.online/zh/apis/douyin/xingtu/creators/conversion/get/)：$0.004/次
- [抖音星圖營銷活動日曆](https://okdata.online/zh/apis/douyin/xingtu/campaigns/list/)：$0.004/次 · 每頁約 40 條結果
- [抖音直播間資訊](https://okdata.online/zh/apis/douyin/live/rooms/get/)：$0.002/次
- [抖音帳號開播狀態](https://okdata.online/zh/apis/douyin/live/users/get/)：$0.004/次
- [抖音直播達人榜](https://okdata.online/zh/apis/douyin/live/streamers/trending/)：$0.006/次 · 每頁約 100 條結果
- [抖音主播直播資料](https://okdata.online/zh/apis/douyin/live/streamers/metrics/)：$0.04/次
- [抖音圖文搜尋](https://okdata.online/zh/apis/douyin/image_posts/search/)：$0.043/次 · 每頁約 10 條帖子
- [抖音直播搜尋](https://okdata.online/zh/apis/douyin/live/rooms/search/)：$0.043/次 · 每頁約 10 條結果
- [抖音影片轉文字](https://okdata.online/zh/apis/douyin/videos/transcript/get/)：$0.044/次
- [抖音圖文作品圖片取文字](https://okdata.online/zh/apis/douyin/notes/text/get/)：$0.007/次
- [抖音影片畫面文字](https://okdata.online/zh/apis/douyin/videos/screen_text/get/)：$0.011/次
- [抖音話題搜尋](https://okdata.online/zh/apis/douyin/hashtags/search/)：$0.02/次 · 每頁約 20 條結果
- [抖音音樂搜尋](https://okdata.online/zh/apis/douyin/music/search/)：$0.02/次 · 每頁約 10 條結果
- [抖音音樂詳情](https://okdata.online/zh/apis/douyin/music/get/)：$0.002/次
- [抖音影片/圖集檔案地址](https://okdata.online/zh/apis/douyin/videos/media/get/)：$0.002/次

## 概要

- **簡稱**：抖音星圖影片資料包告
- **英文名**：Douyin Xingtu video report API
- **也叫**：抖音影片完播率、抖音播放量查詢、星圖影片報告
- **分類**：[社交媒體](https://okdata.online/zh/categories/social/)
- **分組**：[抖音星圖 API](https://okdata.online/zh/apis/douyin/xingtu/)
- **資料型別**：[內容詳情介面](https://okdata.online/zh/roles/posts-get/)
- **狀態**：穩定。契約已定：引數和欄位不會突然改變。
- **價格**：$0.004（約 ¥0.028） / 次 · 引數錯誤不扣費
- **返回**：一個 Post，放在 data.item 裡
- **調用出錯時**：照常計一次費。出錯時我們這邊先自動重試。請求到了平台的呼叫，出錯也按一次計費；引數錯誤不扣費。

## 什麼時候收費

- 返回了資料：$0.004，每次呼叫收一次
- 引數不合法、餘額不足、介面暫停：不收費

| 情況 | 收費 |
|---|---|
| 單次最高扣費 | $0.004 |
| 空結果 | $0.004 |
| 查無此項（平台上沒有） | $0.004 |
| 平台出錯或超時 | $0.004 |
| 引數不合法、餘額不足、介面暫停 | 不收費 |
| 24 小時內帶同一個 Idempotency-Key 重發 | 直接返回儲存的結果，不扣費 |

請求到了平台的呼叫，返回為空、查不到或出錯也照常計費，收 $0.004；引數錯誤這類還沒請求平台就被攔下的不扣費。

價格取自價目表版本 fb99dc8a88674793。 [這個平台的全部價格](https://okdata.online/zh/pricing/douyin/)

- 新帳號送 $0.20 試用額度，不用綁卡：夠調這個介面 50 次。
- 查 1,000 次共 $4.00。

## 已知限制

- `id`、`url` 只給一個。

## 各檢視返回的欄位

“檢視”一列是欄位最早出現的 `view`：`compact` 只返回 compact 欄位，`standard` 再加上 standard 欄位，`full` 返回全部。預設是 `standard`。

- `compact`：`id`, `url`, `type`, `title`, `text`, `published_at`, `author`, `metrics`
- `standard`：`lang`, `images`, `hashtags`
- `full`：`ext`

## 這個介面給不了的

- `metrics.views`：平台不展示（為 null，列在 meta.unavailable 裡）
- `metrics.reposts`：平台不展示（為 null，列在 meta.unavailable 裡）

## 這個介面的常見報錯

| 狀態碼 | 程式碼 | 含義 | 是否扣費 | 能否重試 |
|---|---|---|---|---|
| 400 | `invalid_params` | 引數缺失、型別或取值不對，或者請求方法不對。problems 列出每一處問題，param 是第一個出錯的引數。 | 否 | 修正後重試 |
| 401 | `unauthorized` | Key 缺失、格式不對、已撤銷、已停用或已過期（知道原因時 reason 會寫明）。 | 否 | 不要重試 |
| 402 | `insufficient_balance` | 餘額（available）不夠這次呼叫的最高費用（required）。 | 否 | 修正後重試 |
| 404 | `not_found` | 內容、帳號或頁面不存在或不公開。這次查詢請求到了平台、且產生了費用，或者介面的 charge_when_not_found 大於 0 時，這個結果會計費：返回體裡 charged 為 true，並給出 amount。 | 請求到了平台就扣一次 | 不要重試 |
| 429 | `rate_limited` | 帳號這一分鐘請求太多（reason: rate），或同時進行的呼叫太多（reason: concurrency）。 | 否 | 可以重試 |
| 500 | `settlement_unknown` | 資料已返回，但沒能確認是否扣費。 | 查詢後才知道 | 用同一個 Idempotency-Key 重試 |
| 502 | `fetch_failed` | 我們這邊自動重試後，這次請求仍然失敗了。如果請求到了平台、且這次請求產生了費用，就按介面價格計一次費（charged 為 true，並給出 amount）；否則不計費。 | 請求到了平台就扣一次 | 可以重試 |
| 503 | `capability_paused` | 這個介面暫時停用了，這次沒有執行。 | 否 | 可以重試 |
| 504 | `timeout` | 資料沒有及時返回。如果請求到了平台、且這次請求產生了費用，就按介面價格計一次費（charged 為 true，並給出 amount）；否則預扣退回。 | 請求到了平台就扣一次 | 可以重試 |

[全部錯誤碼](https://okdata.online/zh/docs/errors/)

## 其他平台的同類資料

- [抖音影片詳情](https://okdata.online/zh/apis/douyin/videos/get/)：$0.002/次
- [小紅書筆記詳情](https://okdata.online/zh/apis/xiaohongshu/notes/get/)：$0.035/次
- [公眾號文章詳情](https://okdata.online/zh/apis/wechat_mp/articles/get/)：$0.02/次
- [B站影片詳情](https://okdata.online/zh/apis/bilibili/videos/get/)：$0.002/次
- [TikTok 影片詳情](https://okdata.online/zh/apis/tiktok/videos/get/)：$0.002/次
- [X 帖子詳情](https://okdata.online/zh/apis/x/posts/get/)：$0.0003/次
- [YouTube 影片詳情](https://okdata.online/zh/apis/youtube/videos/get/)：$0.002/次
- [Instagram 帖子詳情](https://okdata.online/zh/apis/instagram/posts/get/)：$0.004/次
- [Reddit 帖子詳情](https://okdata.online/zh/apis/reddit/posts/get/)：$0.002/次
- [快手作品詳情](https://okdata.online/zh/apis/kuaishou/videos/get/)：$0.002/次
- [知乎文章詳情](https://okdata.online/zh/apis/zhihu/articles/get/)：$0.002/次
- [影片號作品詳情](https://okdata.online/zh/apis/wechat_channels/videos/get/)：$0.02/次
- [小紅書影片筆記詳情（影片地址）](https://okdata.online/zh/apis/xiaohongshu/videos/get/)：$0.035/次
- [微博詳情](https://okdata.online/zh/apis/weibo/posts/get/)：$0.002/次
- [YouTube 帖子詳情](https://okdata.online/zh/apis/youtube/posts/get/)：$0.002/次
- [優酷影片詳情](https://okdata.online/zh/apis/youku/videos/get/)：$0.022/次
- [頭條文章詳情](https://okdata.online/zh/apis/toutiao/articles/get/)：$0.002/次
- [頭條影片詳情](https://okdata.online/zh/apis/toutiao/videos/get/)：$0.002/次
- [西瓜影片詳情](https://okdata.online/zh/apis/xigua/videos/get/)：$0.004/次
- [Bluesky 帖子詳情](https://okdata.online/zh/apis/bluesky/posts/get/)：$0.001/次
- [Lemon8 帖子詳情](https://okdata.online/zh/apis/lemon8/posts/get/)：$0.002/次
- [Threads 帖子詳情](https://okdata.online/zh/apis/threads/posts/get/)：$0.003/次
- [LinkedIn 帖子詳情](https://okdata.online/zh/apis/linkedin/posts/get/)：$0.012/次

[內容詳情介面](https://okdata.online/zh/roles/posts-get/)

## 在你的 AI 裡用

> 先讀 https://okdata.online/zh/apis/douyin/xingtu/videos/get.md，再用 okdata 幫我調這個介面，key 在環境變數 OKDATA_API_KEY 裡。用「抖音星圖影片資料包告」找出點贊最多的五條內容，附連結。

## 抖音的介面分組

- [抖音星圖 API](https://okdata.online/zh/apis/douyin/xingtu/)：抖音星圖達人搜尋 $0.004、抖音星圖達人報價 $0.04、抖音星圖達人資料 $0.004、抖音星圖達人粉絲畫像 $0.004、抖音星圖達人傳播資料 $0.004、抖音星圖達人作品表現 $0.004、抖音星圖達人內容熱詞 $0.002、抖音星圖達人星圖指數 $0.008、抖音星圖達人內容分佈 $0.004、抖音星圖達人轉化能力 $0.004、抖音星圖營銷活動日曆 $0.004
- [抖音巨量算數 API](https://okdata.online/zh/apis/douyin/index/)：抖音巨量算數品牌指數趨勢 $0.002、抖音巨量算數品牌指數對比 $0.002、抖音巨量算數達人熱門影片 $0.002、抖音巨量算數達人粉絲畫像 $0.002、抖音巨量算數達人核心指標 $0.002、抖音巨量算數關鍵詞人群畫像 $0.002、抖音巨量算數關鍵詞熱度趨勢 $0.006、抖音巨量算數關聯詞 $0.002、抖音巨量算數即時熱點 $0.002、抖音巨量算數關鍵詞熱門影片 $0.002
