Answers
My Douyin scraper stopped working after a signature change. Should I fix it or switch to an API?
Short answer
Fix it if someone on your team enjoys reverse-engineering Douyin's web signatures and your volume is very large; switch if you need the data working this week. On okdata the same jobs need no signature or cookie: Douyin search is $0.02 a call, a video by share link $0.002, and comments $0.002 a page of about 20.
Douyin's web endpoints expect signed requests and a set of cookies, and both change when Douyin ships new JavaScript. Open-source projects then break together. One downloader's users asked whether it was no longer maintained, since even fresh cookies did not help; another tool found a Douyin stats endpoint had simply been retired. The fix is rarely one line, and the next break is a matter of time.
Fixing: what it really takes
- Someone who can read obfuscated JavaScript and rebuild the signer, often for days.
- Fresh cookies and, for heavy use, accounts and proxies that are not yet flagged.
- Repeating that each time Douyin changes, with no warning of when.
That is reasonable for a team that collects at very large scale or treats it as core engineering. For a marketing report due Friday, it is the expensive option.
Switching: what the same jobs cost
| Job | Endpoint | Price |
|---|---|---|
| Keyword search | Douyin video search | $0.02 per page of about 20 |
| One video from a share link | Douyin video detail | $0.002 |
| Comments | Douyin video comments | $0.002 per page of about 20 |
| An account's videos | Douyin account videos | $0.002 per page of about 20 |
A weekly report of 20 searches, 100 video lookups and 200 comment pages costs {{cost:douyin.videos.search20+douyin.videos.get100+douyin.videos.comments.list*200}}.
# A v.douyin.com share link goes straight in; no a_bogus, msToken or ttwid on your side
curl -G "https://api.okdata.online/v1/douyin/videos/get" \
-H "Authorization: Bearer $OKDATA_API_KEY" \
--data-urlencode 'url=https://v.douyin.com/xxxxxx/'
Before you switch
- Public data only. Anything your scraper read through a logged-in session, such as your own account's analytics, is not available here.
- When Douyin does not show a number publicly, it comes back null and
meta.unavailablesays so. The call is still a normal billed result. - When the upstream source has trouble, you get
upstream_failedorupstream_busy, which are never charged, and you can retry later. The breakage becomes someone else's job to fix.
The official route
Douyin's open platform works through OAuth scopes the account owner grants. If you only need data about accounts that will authorise your app, such as your own brand accounts, use it. For public data about other accounts, see how teams use these endpoints for competitor monitoring.
Updated