# TikTok 话题内容 API (tiktok.hashtag)

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

TikTok 话题内容按 `hashtag` 取一个话题下的公开视频，一次返回一个列表：视频文案、作者、点赞、评论、分享、播放和收藏数、发布时间，以及视频用到的 `hashtags`、背景音乐 `music` 和 `is_ad`、`is_sponsored` 这类标记。它回答「这个话题下现在有哪些视频、是谁发的」，适合做话题选题、活动话题监测，或者找在某个话题里发片的创作者。

`hashtag` 只认话题名，带不带 # 都行。每条视频还带作者的粉丝数和是否 TikTok Shop 卖家，找创作者时可以先在结果里初筛。要按作者而不是按话题取视频，用用户视频那一页：它多了最低点赞数、排序和发布时间上界三个筛选参数。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| hashtag | not declared | yes | not declared | hashtag 的话题名，可带或不带 #，不等同于任意全文搜索词。 |
| limit | integer (1–30) | no | 10 | 这次调用最多返回的条数，整数，1–30；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| author_name | 评价人名字（shop_product_reviews），平台已打码，如 n**h。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| share_count | 分享/转发数。null 表示不公开，不等于 0。 |
| view_count | 浏览/播放数。null 表示不公开，不等于 0。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| collect_count | 收藏数。null 表示不公开，不等于 0。 |
| repost_count | 转发数。 |
| duration_sec | platform-native meaning |
| duration_seconds | 时长，单位秒。非视频/音频内容为 null。 |
| cover_image_url | 视频封面图链接（带签名，会过期）。 |
| language | 内容语言代码（如 zh、en），由平台判定，可能不准。 |
| country | 国家或地区。可能是全称也可能是 ISO 代码，取决于平台，未归一。 |
| hashtags | 正文里的话题标签数组，按出现顺序；没有时不出现这个字段。 |
| music | 背景音乐：id、title（曲名）、author、is_original（是否原声）、play_url（音频地址，会过期）、cover_url。 |
| is_ad | 是否广告视频。 |
| is_pinned | 是否在作者主页置顶。 |
| is_sponsored | 是否含赞助内容。 |
| is_slideshow | 是否图文轮播（不是视频）。 |
| has_shop_product | 视频是否挂了 TikTok Shop 商品；没有这个键表示无法判定。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_url | 作者在原平台的主页链接。 |
| author_avatar_url | 作者头像图片链接（多数平台带签名、会过期）。 |
| author_bio | platform-native meaning |
| author_is_verified | platform-native meaning |
| author_is_private | 作者是否私密账号。 |
| author_is_seller | 作者是否 TikTok Shop 卖家。 |
| author_follower_count | 作者粉丝数。null 表示不公开。 |
| author_following_count | platform-native meaning |
| author_like_count | platform-native meaning |
| author_video_count | platform-native meaning |
| 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": "tiktok",
  "action": "hashtag",
  "params": {
    "hashtag": "fyp"
  }
}'
```

```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": "tiktok",
        "action": "hashtag",
        "params": {
            "hashtag": "fyp",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

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

```text
{
  "id": "req_…",
  "platform": "tiktok",
  "action": "hashtag",
  "results": [
    {
      "id": "•••",
      "url": "https://www.tiktok.com/@•••/video/7370728454435769646",
      "text": "#fyp #foryou #foryoupage #funny #fypシ゚#tiktok #viral 💕💕",
      "author_name": "•••",
      "author_username": "•••",
      "like_count": 222,
      "comment_count": 20,
      "share_count": 22,
      "view_count": 35700,
      "posted_at": "2024-05-19T15:11:06+00:00",
      "platform": "tiktok"
    },
    {
      "id": "•••",
      "url": "https://www.tiktok.com/@•••/video/7372613163096853802",
      "text": "#fyp #foryou #foryoupage #funny #fypシ゚#tiktok #viral 💕💕",
      "author_name": "•••",
      "author_username": "•••",
      "like_count": 280,
      "comment_count": 1,
      "share_count": 246,
      "view_count": 9293,
      "posted_at": "2024-05-24T17:04:34+00:00",
      "platform": "tiktok"
    }
  ],
  "count": 10,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `hashtag` 要不要带 #？

带不带都行，示例填的是 fyp。这个参数只认话题名，不等同于任意全文搜索词，不要把一句话或普通关键词当搜索框填进去；想按关键词找视频，走关键词搜索。

### 一次最多能取多少条视频？

最多 30 条，`limit` 不传时返回 10 条。话题内容只有 `hashtag` 一个参数，没有翻页令牌。需要更大的样本，可以换几个相近的话题名分别取，或者改用用户视频按作者取，那边单次最多 50 条。

### 互动数是 null 说明没人互动吗？

不是。`like_count`、`comment_count`、`share_count`、`view_count` 和 `collect_count` 为 null，都表示该平台或接口不公开这项数据，不等于 0，统计时要和真正的 0 分开。`hashtags` 没有标签时整个字段不出现，`has_shop_product` 没有这个键表示无法判定。

## Also

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