Douyin Search
搜索抖音视频,自然语言直达。
What This Skill Does
- Natural language search: "搜索一下海鲜视频" → searches Douyin for videos
- Multi-strategy: tries browser automation first, falls back to web search
- Video listing: titles, authors, stats, and links from results
- Hot trends: access 抖音热榜 without login
Limitations (IMPORTANT)
Douyin aggressively blocks automated access. The skill works in these conditions:
| Strategy | Works When | Limitations |
|---|---|---|
| Browser (hot page) | Always | Only shows trending, not keyword search |
| Browser (search) | Mainland China IP + session cookies | May trigger captcha slider |
| Web search fallback | Always | Returns search page URLs, not video details |
| API | Requires a_bogus signature | Not currently implemented |
For best results: Use from a mainland China IP, or provide a logged-in browser session.
What This Skill Does NOT Do
- Download videos (use
douyin-downloader) - Analyze script quality (use
douyin) - Access private or login-required content
- Bypass Douyin's anti-bot protections reliably
Execution Protocol
Step 1: Parse the search intent
Extract the search keyword from natural language:
- "搜索一下海鲜视频" → keyword:
海鲜 - "帮我找抖音上关于猫咪的内容" → keyword:
猫咪 - "douyin search AI tools" → keyword:
AI tools - "抖音热榜" / "看看有什么热门的" → hot trends mode
Step 2: Determine strategy
- If user asks for hot/trending → go to Step 3 (hot trends)
- If user asks for keyword search → go to Step 4 (browser search)
Step 3: Hot trends (reliable)
agent-browser open "https://www.douyin.com/hot"
agent-browser wait --load networkidle
agent-browser wait 3000
agent-browser snapshot -i --json
Extract the trending list from the snapshot. Each trending item has:
- Topic name (heading)
- Hot score (热度)
- Link to topic page
Format:
🔥 抖音热榜
1. 话题名 — 1139.6K热度
2. 话题名 — 1133.3K热度
...
Step 4: Browser search (may be blocked)
# First establish session via hot page
agent-browser open "https://www.douyin.com/hot"
agent-browser wait --load networkidle
agent-browser wait 2000
# Then navigate to search
agent-browser open "https://www.douyin.com/search/KEYWORD"
agent-browser wait --load networkidle
agent-browser wait 5000
Check for captcha:
agent-browser snapshot -i --json
If the snapshot shows only an iframe (captcha), the search is blocked. Fall back to Step 5.
If results are visible, extract video cards:
- Title/description
- Author name
- Like count
- Video link
Step 5: Web search fallback
When browser search is blocked, use web search:
web_search: "site:douyin.com KEYWORD 视频"
Extract Douyin search page URLs from results. These are search pages on Douyin that the user can visit directly.
Format:
🔍 抖音搜索: "KEYWORD" (网页搜索结果)
⚠️ 直接搜索被抖音验证码拦截,以下是通过网页搜索找到的相关搜索页面:
1. [搜索标题] — 🔗 URL
2. [搜索标题] — 🔗 URL
...
💡 提示:在浏览器中打开以上链接可以直接查看抖音搜索结果
Step 6: Format results
When browser search works, format as:
🔍 抖音搜索结果: "KEYWORD"
1. 🎬 视频标题 — @作者
❤️ 点赞数 | 🔗 视频链接
2. 🎬 视频标题 — @作者
❤️ 点赞数 | 🔗 视频链接
...
Captcha Handling
If a captcha slider appears:
- The captcha is in a cross-origin iframe from
rmc.bytedance.com/verifycenter - It cannot be accessed via JavaScript due to CORS
- The slider requires a drag gesture from left to right
- Attempt to solve using mouse drag on the iframe's bounding box:
# Get iframe position
agent-browser get attr @e1 "src" --json # captcha iframe
# If using Playwright directly, can access the frame:
# const frame = page.frames().find(f => f.url().includes('verifycenter'));
# Then find slider and drag
- If captcha cannot be solved, fall back to web search (Step 5)
Playwright Script (Advanced)
For environments with Playwright available, use the included script:
NODE_PATH=<playwright-path> node scripts/search-v3.js "KEYWORD"
The script:
- Visits /hot first to establish session
- Navigates to search with anti-detection measures
- Attempts captcha solving
- Extracts results
Activation Rules
Use this skill when:
- User asks to search Douyin / 抖音
- User says "搜一下" in context of video content
- User wants to find videos on a topic
- User asks "抖音上有什么关于X的视频"
- User asks for 抖音热榜 / trending
Do NOT use this skill when:
- User wants to download a video (→
douyin-downloader) - User wants script analysis (→
douyin) - User asks about Douyin the company/platform in general
Boundaries
- This skill uses browser automation against the public Douyin website
- Results depend on Douyin's current page structure and availability
- No API keys needed — but no guarantees of stability either
- Mainland China IP significantly improves success rate
- Respect rate limits and don't hammer the site