# 抖音 搜索联想词 API (douyin.search_suggest)

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

抖音搜索联想词按 `keyword` 返回抖音搜索框给出的联想词，一次最多给 10 条，顺序与搜索框里一致。每行只有两列：`rank` 是联想词在搜索框里的先后，从 1 开始；`keyword` 是联想出来的词。它回答「用户输入这个词时，搜索框会接着补什么」，适合扩展关键词、挖掘长尾的搜索说法。

输入词就是搜索框里输入的词，例如人工智能或示例里的美食。拿到联想词后，可以逐个再作为 `keyword` 传回来继续往下扩，也可以拿去直播商品搜索那一页，看这些词下有哪些带直播标记的商品。这一页本身只返回词，不返回商品、作者和视频。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 搜索框里输入的词，例如 人工智能；返回抖音搜索框给出的联想词，按抖音给的顺序。 |
| limit | integer (1–10) | no | 10 | 这次调用最多返回的条数，整数，1–10；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| rank | 名次（从 1 开始）：trending 是热榜排名，xingtu_creator_rankings 是星图榜单里的名次，billboard_search_hot 是搜索热榜名次，search_suggest 是联想词在抖音搜索框里的顺序；billboard_rise_list、billboard_challenge_hot、billboard_topic_hot 是热点宝榜单名次（翻页接着往下数）。 |
| keyword | 关键词：trending 是热点词，billboard_search_hot 是上榜的搜索词，search_suggest 是抖音给出的联想搜索词。 |
| 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": "search_suggest",
  "params": {
    "keyword": "美食"
  }
}'
```

```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": "search_suggest",
        "params": {
            "keyword": "美食",
        },
    },
    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": "search_suggest",
  "results": [
    {
      "rank": …,
      "keyword": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 联想词的顺序怎么定？

按抖音搜索框给出的顺序，`rank` 从 1 开始，第 1 个就是搜索框里排最前的联想词。顺序由抖音决定，接口只照原样返回；存档时把 `rank` 一起存下，顺序信息只在这一列。

### 联想词能看出搜索量吗？

看不出。每行只有 `rank` 和 `keyword`，外加标识来源的 `platform`，没有搜索量或热度数字。排在前面只说明搜索框先给出它，不说明它比后面的词热多少。

### 联想词怎么接到商品搜索上？

把某个联想词作为 `keyword` 传给直播商品搜索那一页，它只返回采集时正挂在直播间里的商城商品，每次最多 3 条。联想词只说明搜索框会补什么，不说明这个词下一定有直播商品。

## 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
