视频搜索
按关键词搜索抖音视频,支持排序、发布时间、时长和分页筛选;后续页面需要上一页的搜索ID。用于支持内容发现和趋势研究。
参数
| 参数 | 必填 | 类型 | 说明 | 示例 | 可选值 |
|---|---|---|---|---|---|
keyword |
必填 | string | 搜索关键词。 | 咖啡 |
— |
sort_type |
可选 | string | 搜索结果排序标准。 可用值: - `_0`:综合 - `_1`:点赞最多 - `_2`:最新 | _0 |
_0_1_2 |
publish_time |
可选 | string | 按视频发布时间范围筛选。 可用值: - `_0`: 不限 - `_1`: 最近24小时 - `_7`: 最近7天 - `_180`: 最近6个月 | _0 |
_0_1_7_180 |
duration |
可选 | string | 按视频时长筛选。 可用值: - `_0`: 不限时长 - `_1`: 1分钟以内 - `_2`: 1-5分钟 - `_3`: 超过5分钟 | _0 |
_0_1_2_3 |
page |
可选 | integer | 页码(从1开始)。 | 1 |
— |
search_id |
可选 | string | 搜索ID;页面大于1时需要。使用前一次响应中的 data.business_config.next_page.search_id,当 data.business_config.has_more 为 0 时停止分页。 | — | — |
代码示例
curl -G "https://api.mofa-ai.com/v1/douyin/search_video_v4" \
-H "Authorization: Bearer $MOFA_API_KEY" \
--data-urlencode 'keyword=咖啡' \
--data-urlencode 'sort_type=_0' \
--data-urlencode 'publish_time=_0' \
--data-urlencode 'duration=_0' \
--data-urlencode 'page=1'
import os
import requests
resp = requests.get(
"https://api.mofa-ai.com/v1/douyin/search_video_v4",
headers={"Authorization": f"Bearer {os.environ['MOFA_API_KEY']}"},
params={
"keyword": "咖啡",
"sort_type": "_0",
"publish_time": "_0",
"duration": "_0",
"page": "1",
},
timeout=60,
)
body = resp.json()
if body["success"]:
print(body["cost_usd"], body["data"])
else:
print(body["error"], body["message"])
const url = new URL("https://api.mofa-ai.com/v1/douyin/search_video_v4");
url.search = new URLSearchParams({
keyword: "咖啡",
sort_type: "_0",
publish_time: "_0",
duration: "_0",
page: "1",
});
const resp = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.MOFA_API_KEY}` },
});
const body = await resp.json();
if (body.success) console.log(body.cost_usd, body.data);
else console.error(body.error, body.message);
在线试用
登录后可以在这里直接调用此接口,按价格从余额扣费,失败不收费。新账户赠送 $0.50 试用额度。
响应示例
采集于 2026-11-07,耗时 3938 ms · 请求参数 {"page": "1", "keyword": "咖啡", "duration": "_0", "sort_type": "_0", "publish_time": "_0"}
JSON
{
"success": true,
"code": 0,
"message": "success",
"request_id": "req_5f1c2a9be04d7c3a81f6e2d0",
"endpoint": "douyin.search_video_v4",
"cost_usd": 0.02,
"data": {
…
示例较长,此处截断显示。