# 抖音主播直播数据 API

> 按星图达人 ID 取这位抖音主播近 30 天或 90 天的直播数据：直播场次，以及平均每场的观看次数、观看人数、平均和最高同时在线、观众停留秒数、互动率和涨粉；带货的还有场均销售额和 GPM 区间、所卖商品的平均价格和商品数。可以只看带货、游戏或其他类型的场次。

网页版：https://okdata.online/zh/apis/douyin/live/streamers/metrics/

- **接口**：`GET /v1/douyin/live/streamers/metrics`
- **ID**：`douyin.live.streamers.metrics`
- **价格**：$0.04/次
- **返回**：一个 LiveStreamer 对象（`data.item`）
- **状态**：预览
- **适合**：找博主

## 价格

每次调用 $0.04，返回一个结果。查 1,000 次共 $40.00。请求到了数据源的查询，查不到或出错也照常计费；还没请求数据源就被拦下的不扣费。

## 参数

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| `id` | string | 是 |  | 星图达人 ID（一串数字）：douyin.live.streamers.trending 或星图达人搜索结果里的 id；不是抖音账号 ID。（例：`6835457055260672014`） |
| `window` | string: 30d / 90d | 否 | `30d` | 统计周期：近 30 天（默认）或近 90 天。 |
| `type` | string: all / ecommerce / gaming / other | 否 | `all` | 统计哪些场次：全部（默认）、带货、游戏或其他。 |
| `view` | string: brief / compact / standard / full | 否 | `standard` | 返回多少字段。brief：只给 ID、标题、正文前 100 字、链接、时间和主要数字，适合先扫一遍列表，再按 ID 取详情；compact 去掉空字段、长正文截到 500 字；full 会在 ext 里带上平台特有字段。 |
| `fields` | string[] | 否 |  | 只保留这些字段，按路径写（如 author.name），用来省 token。放在查询参数里时用逗号分隔。 |

cursor、view、fields 的用法见 [请求说明](https://okdata.online/zh/docs/requests/)。

## 返回字段

每一条都是一个 [LiveStreamer](https://okdata.online/zh/docs/objects/live_streamer/)。

| 字段 | 类型 | 说明 |
|---|---|---|
| `id` | string | 主播在榜单来源里的 ID：抖音是星图达人 ID（douyin.live.streamers.metrics 用它），TikTok 是用户 ID。 |
| `url` | string \| null | 主播主页（有的话）。 |
| `username` | string \| null | 用户名（榜单给的话）。 |
| `name` | string \| null | 昵称；数据源不给时为 null（douyin.live.streamers.metrics）。 |
| `avatar_url` | string \| null | 头像图片地址。 |
| `followers` | integer \| null | 粉丝数。 |
| `rank` | integer \| null | 在榜单上的名次，从 1 开始；不是榜单时为 null。 |
| `score` | number \| null | 榜单分数：TikTok 是积分，星图是 0 到 1 之间的分。 |
| `category` | string \| null | 内容或商品类目，平台原文。 |
| `room_id` | string \| null | 主播此刻所在的直播间 ID（榜单给的话）。 |
| `days` | integer \| null | 数据覆盖的天数；榜单没说时为 null。 |
| `sessions` | integer \| null | 期间的直播场次。 |
| `avg_views` | integer \| null | 平均每场的观看次数。 |
| `avg_unique_viewers` | integer \| null | 平均每场的观看人数。 |
| `avg_viewers` | integer \| null | 平均同时在线人数。 |
| `peak_viewers` | integer \| null | 最高同时在线人数。 |
| `avg_watch_seconds` | integer \| null | 观众平均停留秒数。 |
| `new_followers` | integer \| null | 期间直播涨粉数。 |
| `engagement_rate` | Band \| null | 互动率（平台的算法），0 到 1，区间。 |
| `gmv` | Band \| null | 期间的直播销售额（元），区间。 |
| `avg_gmv` | Band \| null | 平均每场的销售额（元），区间。 |
| `gpm` | Band \| null | 千次观看成交额（GPM，元），区间。 |
| `avg_price` | Band \| null | 所卖商品的平均价格（元），区间。 |
| `products` | integer \| null | 期间直播带过的商品数。 |
| `ext` | object | 平台特有字段，只在 view=full 时返回。 |

## 请求示例

### cURL

```bash
curl -G "https://api.okdata.online/v1/douyin/live/streamers/metrics" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'id=6835457055260672014'
```

### Python

```python
import os
import requests

resp = requests.get(
    "https://api.okdata.online/v1/douyin/live/streamers/metrics",
    headers={"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"},
    params={"id": "6835457055260672014"},
    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["rank"], row["name"], row["followers"])
print("cost: $" + body["meta"]["billing"]["amount"])
```

### TypeScript

```ts
const url = new URL('https://api.okdata.online/v1/douyin/live/streamers/metrics');
url.searchParams.set('id', "6835457055260672014");

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.rank, row.name, row.followers);
console.log('cost: $' + body.meta.billing.amount);
```

### MCP

```json
{
  "name": "call",
  "arguments": {
    "capability": "douyin.live.streamers.metrics",
    "id": "6835457055260672014"
  }
}
```

或者对接好 MCP 的智能体直接说：

> 用「抖音主播直播数据」总结这位主播的直播表现：场次、场均观看和销售额区间。

## 返回示例

```json
{
  "code": "ok",
  "request_id": "0f6c2a8e-4b1d-4e0a-9a51-3c7d2b9e1f20",
  "data": {
    "item": {
      "id": "6835457055260672014",
      "url": "https://www.xingtu.cn/ad/creator/author-homepage/douyin-video/6835457055260672014",
      "username": null,
      "name": null,
      "avatar_url": null,
      "followers": null,
      "rank": null,
      "score": null,
      "category": null,
      "room_id": null,
      "days": 30,
      "sessions": 13,
      "avg_views": 552580,
      "avg_unique_viewers": 336895,
      "avg_viewers": 4318,
      "peak_viewers": 15743,
      "avg_watch_seconds": 172,
      "new_followers": null,
      "engagement_rate": {
        "min": 2000000,
        "max": 5000000
      },
      "gmv": null,
      "avg_gmv": {
        "min": 2000000,
        "max": 5000000
      },
      "gpm": {
        "min": 2000000,
        "max": 5000000
      },
      "avg_price": {
        "min": 2000000,
        "max": 5000000
      },
      "products": 359
    }
  },
  "warnings": [],
  "meta": {
    "capability": "douyin.live.streamers.metrics",
    "billing": {
      "amount": "0.04",
      "currency": "USD",
      "balance_after": "9.96"
    },
    "unavailable": {},
    "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.04。只有 settlement_unknown 的扣费结果要查询后才知道。完整列表：https://okdata.online/zh/docs/errors/

## 常见问题

### 抖音主播直播数据接口多少钱？

每次调用 $0.04，返回一个结果。查 1,000 次共 $40.00。请求到了数据源的查询，查不到或出错也照常计费；还没请求数据源就被拦下的不扣费。

### 需要抖音账号、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/xingtu/videos/get/)：$0.004/次
- [抖音用户视频（备用版）](https://okdata.online/zh/apis/douyin/backup/users/videos/list/)：$0.0025/次 · 每页约 20 条视频
- [抖音视频搜索（备用版）](https://okdata.online/zh/apis/douyin/backup/videos/search/)：$0.03/次 · 每页约 8 条视频
- [抖音直播间信息](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 条结果

## 概要

- **简称**：抖音主播直播数据
- **英文名**：Douyin streamer live figures API
- **也叫**：抖音主播场均数据、星图直播数据、抖音直播场均观看、主播带货能力
- **分类**：[达人](https://okdata.online/zh/categories/creator/)
- **状态**：预览。还可能调整，改动会提前公告。
- **价格**：$0.04（约 ¥0.28） / 次 · 参数错误不扣费
- **返回**：一个 LiveStreamer，放在 data.item 里
- **调用出错时**：照常计一次费。一个数据源出错就换下一个。请求到了数据源的调用，出错也按一次计费；参数错误不扣费。

## 什么时候收费

- 返回了数据：$0.04，每次调用收一次
- 参数不合法、余额不足、接口暂停：不收费

| 情况 | 收费 |
|---|---|
| 单次最高扣费 | $0.04 |
| 空结果 | $0.04 |
| 查无此项（平台上没有） | $0.04 |
| 数据源出错或超时 | $0.04 |
| 参数不合法、余额不足、接口暂停 | 不收费 |
| 24 小时内带同一个 Idempotency-Key 重发 | 直接返回保存的结果，不扣费 |

请求到了数据源的调用，返回为空、查不到或出错也照常计费，收 $0.04；参数错误这类还没请求数据源就被拦下的不扣费。

价格取自价目表版本 53dd8ce13c359590。 [这个平台的全部价格](https://okdata.online/zh/pricing/douyin/)

- 新账号送 $0.10 试用额度，不用绑卡：够调这个接口 2 次。
- 查 1,000 次共 $40.00。

## 各视图返回的字段

“视图”一列是字段最早出现的 `view`：`compact` 只返回 compact 字段，`standard` 再加上 standard 字段，`full` 返回全部。默认是 `standard`。

- `compact`：`id`, `url`, `username`, `name`, `followers`, `rank`, `category`, `days`, `sessions`, `avg_views`, `avg_viewers`, `new_followers`, `gmv`, `avg_gmv`, `products`
- `standard`：`avatar_url`, `score`, `room_id`, `avg_unique_viewers`, `peak_viewers`, `avg_watch_seconds`, `engagement_rate`, `gpm`, `avg_price`
- `full`：`ext`

## 这个接口的常见报错

| 状态码 | 代码 | 含义 | 是否扣费 | 能否重试 |
|---|---|---|---|---|
| 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 | `upstream_failed` | 这个接口的所有数据源这次都失败了。如果数据源对这次请求收了费，就按接口价格计一次费（charged 为 true，并给出 amount）；否则不计费。 | 请求到了数据源就扣一次 | 可以重试 |
| 503 | `capability_paused` | 这个接口暂时停用了，这次没有执行。 | 否 | 可以重试 |
| 504 | `timeout` | 数据没有及时返回。如果请求已经到了会收费的数据源，就按接口价格计一次费（charged 为 true，并给出 amount）；否则预扣退回。 | 请求到了数据源就扣一次 | 可以重试 |

[全部错误码](https://okdata.online/zh/docs/errors/)

## 在你的 AI 里用

> 先读 https://okdata.online/zh/apis/douyin/live/streamers/metrics.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、抖音星图视频数据报告 $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
