获取抖音热榜数据和关键词搜索结果。
当用户用自然语言表达搜索意图时, 直接调用,无需用户手动指定命令。
用户说动作命令搜索一下海鲜视频搜索python3 scripts/scraper.py search --keyword "海鲜" --limit 10看看抖音热榜热榜python3 scripts/scraper.py hot --limit 20找一些关于小龙虾的视频搜索python3 scripts/scraper.py search --keyword "小龙虾" --limit 10抖音最近什么火热榜python3 scripts/scraper.py hot --limit 20帮我搜一下美食搜索python3 scripts/scraper.py search --keyword "美食" --limit 10
--limit;否则默认 10Playwright 和 Chromium 浏览器。首次使用前运行:
bash
pip install playwright && playwright install chromium
bash
# 基本搜索
python3 scripts/scraper.py search --keyword "海鲜" --limit 10
# 仅使用热榜 API(更快,无需浏览器)
python3 scripts/scraper.py search --keyword "海鲜" --method api --limit 10
# 搜索并保存结果
python3 scripts/scraper.py search --keyword "海鲜售卖" --limit 20 --output seafood.json
bash
# 获取热榜
python3 scripts/scraper.py hot --limit 20
# 保存热榜数据
python3 scripts/scraper.py hot --limit 50 --output hot.json
方式说明适用场景auto(默认)先尝试浏览器搜索,失败则回退热榜 API通用api仅使用热榜 API,按关键词过滤快速获取,无需浏览器browser仅使用 Playwright 浏览器需要精确搜索结果
⚠️ 抖音网页版搜索需要登录。如果未登录,
auto模式会自动回退到热榜 API。
json
[
{
"title": "视频标题",
"description": "视频描述",
"author": "作者昵称",
"play_count": 1000000,
"like_count": 50000,
"comment_count": 2000,
"share_count": 1000,
"url": "https://www.douyin.com/video/xxx",
"tags": ["标签1", "标签2"],
"publish_time": "2026-06-08",
"hot_value": 5000000
}
]
https://www.douyin.com/aweme/v1/web/hot/search/list/ — 公开接口,无需登录