# 抖音站内搜索

GET/v1/sites/douyin/search

按搜索词取一页抖音视频，看国内 AI 可能从哪些内容里找答案。

## 价格

- 价格: 每次 $0.02
- 没有结果: 没有结果时也收费
- 没取到数据: 不收费

每次调用先冻结这个价格，取到数据才收费，没取到就退回。这条规则只适用于数据接口：采集 AI 回答时，没有出现 AI 回答和 AI 拒绝回答也是结果，会收费。

## 参数

`query` 文字 必填

搜索词。最多 500 个字符。

`cursor` 文字

上一页返回的 next_cursor。不带就从第一页开始。最多 200 个字符。

## 请求头

`Authorization` 必填

Bearer 加你的 API Key。

`Idempotency-Key` 建议每次都带

自己定的编号，最多 255 个字符，不能有空格。网络出错时用同一个值重发，不会重复执行和收费；24 小时内有效。同一个值配不同的参数，会返回 idempotency_conflict。

`X-Max-Price` 可选

最多愿意花多少美元，例如 0.50。最高费用超过它就拒绝，不执行，也不收费。

`X-Source` 可选

自己的标记，例如来自哪个产品，最多 100 个字符。可以按它看用量。

`X-End-User` 可选

自己的标记：这次是给哪个最终用户用的，最多 100 个字符。不要放姓名、邮箱等个人信息。

## 返回

成功时返回 HTTP 200，数据在 `data.items`，列表里每一项是一个 `SitePost`。字段一直都在： `[]` 是这次没有， `null` 是平台不提供或看不出来。 一次返回一页， `page.next_cursor` 不是 null 就还有下一页。 这次收了多少在 `meta.billing`。

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `id` | `string` | 编号 |
| `type` | `"video" \| "image" \| "article" \| "answer" \| "post"` | 内容的类型：视频、图文、文章、回答或帖子 |
| `url` | `string \| null` | 网址 |
| `title` | `string \| null` | 标题 |
| `text` | `string \| null` | 正文 |
| `author` | `{ id: string \| null, name: string \| null }` | 作者的编号和名字 |
| `metrics` | `{ likes: integer \| null, comments: integer \| null, favorites: integer \| null, shares: integer \| null, views: integer \| null }` | 点赞、评论、收藏、转发和播放量。平台没给的是 null |
| `published_at` | `string \| null` | 发布时间。平台没给就是 null |

### 里面的对象

**page 4 个字段**

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `next_cursor` | `string \| null` | 取下一页用的游标。没有下一页是 null |
| `cursor_expires_at` | `string \| null` | 游标的失效时间。null 表示不会失效 |
| `has_more` | `boolean` | 还有没有下一页 |
| `returned` | `integer` | 这一页有几条 |

**meta 7 个字段**

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `capability` | `string` | 接口编号 |
| `result_status` | `"complete" \| "partial" \| "empty"` | complete 完整；partial 只拿到一部分；empty 没有结果 |
| `fetched_at` | `string` | 取到数据的时间 |
| `cached` | `boolean` | 是不是缓存的结果。现在一直是 false |
| `replayed` | `boolean` | 是不是用同一个 Idempotency-Key 取回的上一次结果 |
| `unavailable` | `string[]` | 这次给不了的字段 |
| `billing` | `{ amount: string, currency: "USD", balance_after: string \| null }` | 这次收了多少，收完后的余额 |

## 常见错误

返回错误就没有收费，只有 `settlement_unknown`：它表示暂时不知道有没有扣费，要用同一个 Idempotency-Key 再查。[查看每个错误码](https://www.askcrawl.com/zh/docs/errors/)。

| 错误 | HTTP | 意思 | 收费吗 |
| --- | --- | --- | --- |
| [`invalid_params`](https://www.askcrawl.com/zh/docs/errors/#invalid_params) | 400 | 参数不合法 | 没有收费 |
| [`max_price_exceeded`](https://www.askcrawl.com/zh/docs/errors/#max_price_exceeded) | 400 | 最高费用超过了你设的上限 | 没有收费 |
| [`insufficient_balance`](https://www.askcrawl.com/zh/docs/errors/#insufficient_balance) | 402 | 余额不足 | 没有收费 |
| [`key_budget_exceeded`](https://www.askcrawl.com/zh/docs/errors/#key_budget_exceeded) | 402 | 超出这把 Key 的金额上限 | 没有收费 |
| [`idempotency_conflict`](https://www.askcrawl.com/zh/docs/errors/#idempotency_conflict) | 409 | 这个 Idempotency-Key 已用于另一个请求 | 没有收费 |
| [`cursor_invalid`](https://www.askcrawl.com/zh/docs/errors/#cursor_invalid) | 400 | 游标不存在 | 没有收费 |
| [`cursor_mismatch`](https://www.askcrawl.com/zh/docs/errors/#cursor_mismatch) | 400 | 游标不是用这个接口和这组参数取得的 | 没有收费 |
| [`cursor_expired`](https://www.askcrawl.com/zh/docs/errors/#cursor_expired) | 410 | 游标已过期，请从第一页重新开始 | 没有收费 |
| [`upstream_failed`](https://www.askcrawl.com/zh/docs/errors/#upstream_failed) | 502 | 这次没有取到结果，没有扣费，可以稍后重试 | 没有收费 |
| [`timeout`](https://www.askcrawl.com/zh/docs/errors/#timeout) | 504 | 没有在时限内取到数据，没有扣费 | 没有收费 |
| [`upstream_busy`](https://www.askcrawl.com/zh/docs/errors/#upstream_busy) | 503 | 现在请求较多，请稍后重试 | 没有收费 |
| [`call_in_progress`](https://www.askcrawl.com/zh/docs/errors/#call_in_progress) | 409 | 这个 Idempotency-Key 的调用还在执行，稍后用同一个再取 | 没有收费 |
| [`settlement_unknown`](https://www.askcrawl.com/zh/docs/errors/#settlement_unknown) | 500 | 还不确定这次有没有扣费，请用同一个 Idempotency-Key 再查 | 暂时不知道 |
| [`unauthorized`](https://www.askcrawl.com/zh/docs/errors/#unauthorized) | 401 | 没有带凭证，或凭证无效、已停用、已过期 | 没有收费 |
| [`rate_limited`](https://www.askcrawl.com/zh/docs/errors/#rate_limited) | 429 | 请求过快，或同时进行的调用过多 | 没有收费 |

```
curl -G https://api.askcrawl.com/v1/sites/douyin/search \
  --data-urlencode <b>"query=咖啡机推荐"</b> \
  -H <b>"Authorization: Bearer $API_KEY"</b>
```

上一级

[接口参考](https://www.askcrawl.com/zh/docs/api/)

相近的页面

[小红书站内搜索](https://www.askcrawl.com/zh/docs/api/sites-xiaohongshu-search/)

[微信站内搜索](https://www.askcrawl.com/zh/docs/api/sites-wechat-search/)

[知乎站内搜索](https://www.askcrawl.com/zh/docs/api/sites-zhihu-search/)

[B 站站内搜索](https://www.askcrawl.com/zh/docs/api/sites-bilibili-search/)

依据

[错误和收费](https://www.askcrawl.com/zh/docs/errors/)

[费用、冻结和结算](https://www.askcrawl.com/zh/docs/billing/)

接着做

[快速开始](https://www.askcrawl.com/zh/docs/quickstart/)

[连接 AI 助手](https://www.askcrawl.com/zh/docs/mcp/)

> 网页：https://www.askcrawl.com/zh/docs/api/sites-douyin-search/ · 内容日期：2026-12-01
