# 抖音 星图达人连接用户结构 API (douyin.xingtu_link_structure)

- Canonical page: https://everyinfra.com/douyin-api/xingtu_link_structure
- Endpoint: POST /api/v1/social with {"platform": "douyin", "action": "xingtu_link_structure", "params": {...}}
- Price: $0.016 per call ($16 per 1,000 requests); failed and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

星图达人连接用户结构按 `douyin_id` 返回一个达人的连接用户在四个档位上的分布。`levels` 按星图的档位编号 1 到 4 列出每档的人数、占总数的比例，以及同行业达人这一档人数的中位数，拿本人的人数和中位数对照，就能看出哪一档高于或低于同行。

`total_user_count` 等于四档人数之和；`total_rank_top_percent` 是这个总数在星图达人中的位置，取值 0 到 1，越小越靠前，0.0456 就是前 4.56%。`link_type` 是星图给达人的连接类型，中文原样返回，如 传播、种草。`creator_id` 是星图商业达人的稳定 ID，不是主页的 user_id，也不是抖音号。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=douyin&action=xingtu_link_structure

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| douyin_id | not declared | yes | not declared | 达人个人主页展示的抖音号（unique_id）；也可以直接填星图达人 ID（19 位数字，即 xingtu_creator_search 返回的 creator_id）。不是星图达人时返回空结果、不扣费。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| creator_id | 星图商业达人稳定 ID；不是公开主页 user_id 或抖音号。 |
| link_type | 星图给达人的连接类型（xingtu_link_structure），中文原样给，如 传播、种草。 |
| total_user_count | 星图连接用户总数（xingtu_link_structure），等于 levels 四档人数之和。 |
| total_rank_top_percent | 连接用户总数在星图达人中的排名位置（xingtu_link_structure），0–1，越小越靠前：0.0456 即前 4.56%。 |
| levels | 星图连接用户的四档（xingtu_link_structure），按星图的档位编号 1–4：[{level, user_count 人数, share 占总数比例（0–1）, industry_median_user_count 同行业达人这一档人数的中位数}]。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "douyin",
  "action": "xingtu_link_structure",
  "params": {
    "douyin_id": "XiaoZhenlla"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "douyin",
        "action": "xingtu_link_structure",
        "params": {
            "douyin_id": "XiaoZhenlla",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "douyin",
  "action": "xingtu_link_structure",
  "results": {
    "creator_id": …,
    "link_type": …,
    "total_user_count": …,
    "total_rank_top_percent": …,
    "levels": …,
    "platform": …
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `douyin_id` 填什么？查不到会扣费吗？

填达人个人主页上展示的抖音号，也可以填 19 位数字的星图达人 ID，即星图达人搜索返回的 `creator_id`。对方不是星图达人时返回空结果，不扣费。

### 连接用户结构和连接用户来源有什么区别？

结构给的是人数分档：四档人数、占比、同行业中位数和总数排名。来源给的是这批连接用户对应哪些内容类目，最多三层。想知道人数多少、在同行里靠不靠前，用结构这一页；想知道集中在哪些内容类目，用来源那一页。两页都只填 `douyin_id`，可以连着调。

### `total_rank_top_percent` 怎么读？

它是连接用户总数在星图达人中的排名位置，取值 0 到 1，越小越靠前：0.0456 表示前 4.56%。它只反映总数的排位，不分档；要逐档对照，看 `levels`，里面带着同行业达人这一档人数的中位数。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=douyin
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
