Answers
Douyin search keeps showing a captcha or returning nothing. How do I get results?
Short answer
Douyin shows captchas to sessions it suspects are automated, and scrapers often turn that into an empty result list. Instead of solving captchas, request search through okdata: your code sends an API key and gets JSON, with no Douyin session to challenge, at $0.02 per page of about 20 videos.
Your keyword collector ran fine yesterday. Today it returns empty lists, no error. You open Douyin in the same browser profile and find a nine-grid image puzzle or a slider waiting on the search page. Douyin flagged the session, and until a person solves the challenge, search returns nothing useful. Tools rarely tell you this; they just report zero results. The lasting fix is to stop holding a Douyin session yourself and request search through an API.
People then ask how to bypass the captcha. Captcha-solving services and puzzle automation exist, but they are an arms race you pay for twice: once for the solver, again when Douyin changes the puzzle.
Remove the session from your side
If what you need is public search results, there is no reason for your code to hold a Douyin session at all. With okdata, Douyin video search is a plain HTTPS call with an API key. You receive JSON or a clear error; never a puzzle.
| Daily job | Calls | Per day | Per 30 days |
|---|---|---|---|
| 5 keywords × 2 pages | 10 | $0.20 | $6.00 |
| 20 keywords × 3 pages | 60 | $1.20 | $36.00 |
Telling empty from failed
import os, requests
r = requests.get(
"https://api.okdata.online/v1/douyin/videos/search",
headers={"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"},
params={"query": "露营装备", "sort": "latest"},
timeout=60,
)
body = r.json()
if body["code"] != "ok":
print("failed, charged:", body["charged"], "retry:", body["retry"])
elif not body["data"]["items"]:
print("Douyin genuinely has no results for this query")
else:
print(len(body["data"]["items"]), "videos")
A failure is an error with charged: false and a retry hint, so your pipeline never mistakes a block for "no videos today". The full list is on the errors page.
Limits
- Public results only; nothing that requires being logged in.
- Douyin decides how deep a keyword's results go. Split broad topics into narrower keywords.
- Search results carry engagement but not plays (
metrics.viewsis usually null) and not the author's follower count.
If you keep your own collector
Slow down, keep one consistent browser profile per account, run during daytime hours and stop at the first captcha rather than retrying into a longer block. MediaCrawler's issue tracker discusses a manual-solve-and-resume flow for exactly this case. For a hands-off daily keyword job, see content research.
Updated