# 抖音 话题搜索 API (douyin.hashtag_search)

- Canonical page: [https://everyinfra.com/douyin-api/hashtag_search](https://everyinfra.com/douyin-api/hashtag_search?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "douyin", "action": "hashtag_search", "params": {...}}
- Price: $0.01556 per call ($15.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 20, max 200 per call
- Mode: sync; add "mode": "async" for slow tasks

话题搜索按 `keyword` 找名字里含这个词的抖音话题，例如 美食，每个话题带最近 7 天的热度 `heat_index`、作品数 `period_video_count`、点赞数 `period_like_count` 和播放量 `period_view_count`。统计时段固定是到中国时间昨天为止的 7 天，起止日期在 `period_start` 和 `period_end`。

`search_rank` 是话题在这次搜索结果里的名次。`heat_index` 是抖音自有指标，只在同一次结果里比较，两次搜索的数不能直接比。要看某个话题从创建起的累计播放量和参与用户数，把 `hashtag_id` 交给话题详情。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 话题关键词，例如 美食；返回名字里含这个词的抖音话题，带最近 7 天（到中国时间昨天为止）的热度、作品数、点赞和播放。 |
| limit | integer (1–200) | no | 20 | 这次调用最多返回的条数，整数，1–200；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| hashtag_id | 话题 ID（纯数字字符串）；作为 hashtag_detail 的 hashtag_id 传回可读这个话题的累计数据。 |
| hashtag_name | 话题名，不带 #。 |
| search_rank | 在这次关键词搜索结果里的名次（从 1 开始）：product_search 行是商品，search 行是作品，hashtag_search 行是话题。 |
| heat_index | 话题在统计时段里的热度指数（hashtag_search），抖音自有指标，只在同一次结果里比较。 |
| period_video_count | 统计时段里这个话题下的作品数（hashtag_search）。 |
| period_like_count | 统计时段里这个话题下作品获得的点赞数（hashtag_search）。 |
| period_view_count | 统计时段里这个话题下作品的播放量（hashtag_search），是平台给的话题统计。 |
| period_start | 统计时段第一天，YYYY-MM-DD（hashtag_search）；固定是到中国时间昨天为止的最近 7 天。 |
| period_end | 统计时段最后一天，YYYY-MM-DD（hashtag_search），即中国时间的昨天。 |
| 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": "hashtag_search",
  "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": "hashtag_search",
        "params": {
            "keyword": "美食",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-11-07T14:47:42Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 20. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "douyin",
  "action": "hashtag_search",
  "results": [
    {
      "hashtag_id": "1767586897793101",
      "hashtag_name": "美食",
      "search_rank": 1,
      "heat_index": 58567572,
      "period_video_count": 393945,
      "period_like_count": 68080130,
      "period_view_count": 5177091488,
      "period_start": "2026-10-31",
      "period_end": "2026-11-06",
      "platform": "douyin"
    },
    {
      "hashtag_id": "1581688162541582",
      "hashtag_name": "美食教程",
      "search_rank": 2,
      "heat_index": 18339337,
      "period_video_count": 50914,
      "period_like_count": 23681506,
      "period_view_count": 1957784078,
      "period_start": "2026-10-31",
      "period_end": "2026-11-06",
      "platform": "douyin"
    }
  ],
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 统计的是哪 7 天？

固定是到中国时间昨天为止的最近 7 天：`period_start` 是第一天，`period_end` 是中国时间的昨天，格式都是 YYYY-MM-DD。这个接口没有改时间段的参数，所以今天的数据不在里面。

### `heat_index` 能和别的搜索结果比吗？

不能直接比。它是抖音自有的热度指标，只在同一次结果里比较，换一个 `keyword` 重新搜，两次的 `heat_index` 不能放在一起排。跨关键词比较时，回到作品数、点赞数和播放量这些具体的统计。

### 一次最多能拿多少个话题？

默认 20 个，用 `limit` 最多 200 个。这个接口没有翻页参数，想覆盖更多话题，就换不同的关键词分几次搜。结果按 `search_rank` 排好了名次。

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