Answers
How do I get all the videos from a Douyin account?
Short answer
Look the account up once from its profile link to get its sec_uid and video count, then page through the okdata Douyin account videos endpoint, about 20 videos per call at $0.002. An account with 400 videos takes 20 pages; with the profile lookup that is $0.042.
You want a competitor's entire Douyin catalog in a sheet: every video, when it went up, what it said and how it performed, to see what they double down on. Tools that read the profile page often return only the first screen, stop after one page, or miss the newest uploads. Two API calls do it: look the profile up once, then page through its video list.
Two calls
- Account profile with
url=set to the profile link (douyin.com/user/...or a v.douyin.com share link). You getid, the account's sec_uid, plus followers, total likes andposts, the number of videos. - Account videos with that
id. Each page holds about 20 videos, newest first, with ID, link, caption, publish time, likes, comments, shares, saves and hashtags. Passpage.next_cursorback untilpage.has_moreis false.
Cost per account
| Videos on the profile | Calls | Cost |
|---|---|---|
| 100 | 1 + 5 | {{cost:douyin.users.get1+douyin.users.videos.list5}} |
| 400 | 1 + 20 | {{cost:douyin.users.get1+douyin.users.videos.list20}} |
| 20 competitors, first page weekly for a year | 1,040 | $2.08 |
Script
import os, requests
API, HEAD = "https://api.okdata.online", {"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"}
prof = requests.get(API + "/v1/douyin/users/get", headers=HEAD,
params={"url": "https://www.douyin.com/user/MS4wLjABAAAA..."}, timeout=60).json()["data"]["item"]
videos, params = [], {"id": prof["id"]}
while True:
body = requests.get(API + "/v1/douyin/users/videos/list", headers=HEAD, params=params, timeout=60).json()
videos += body["data"]["items"]
if not body["page"]["has_more"]:
break
params["cursor"] = body["page"]["next_cursor"]
print(prof["name"], len(videos), "of", prof["posts"])
Gotchas
- The video list needs the sec_uid (
MS4wLjABAAAA...), not the short Douyin number shown in the app. The profile call converts a link into it. - Pinned videos may come first regardless of date; sort by
published_atif order matters. - Private, friends-only and deleted videos are not public, so the list can end below the
postscount. - Play counts are not published for other people's videos;
metrics.viewsis usually null.
Alternatives
TikTokDownloader and Douyin_TikTok_Download_API download the video files of an account with your own cookie and suit archiving. Douyin's open platform returns videos only for accounts that authorize your app, which works for your own accounts or clients. For watching several competitors on a schedule, see competitor monitoring.
Updated