Answers
How do I track a competitor's Douyin account every day?
Short answer
Once a day, fetch the first page of each competitor's videos and their profile from okdata: new video IDs are new posts, and the same page refreshes likes and comments on the last 20 videos. That is $0.004 per account per day, so 10 competitors for 30 days cost $1.20.
A marketing lead wants a Monday-morning answer to three questions about ten rival brands on Douyin: what did they post, what took off, and are they gaining followers faster than us? Checking ten profiles by hand misses videos that were posted and deleted, and gives no numbers to compare week over week. A daily snapshot answers all three. Fetching each rival's latest videos and profile once a day is enough to build that snapshot.
The daily routine
- Account videos, first page only, for each competitor (the
idis their sec_uid). It returns the latest 20 videos with likes, comments, shares and saves. - Any video ID you have not stored before is a new post. Record when you first saw it.
- For videos already stored, the same page gives today's numbers. Storing one row per video per day gives you each video's first-week curve for free.
- Account profile once a day for followers, total likes and video count.
If one competitor posts more than 20 videos a day, fetch a second page for them; nobody else needs it.
Cost
| Setup | Calls per day | Per day | Per 30 days |
|---|---|---|---|
| 1 account | 2 | {{cost:douyin.users.get1+douyin.users.videos.list1}} | {{cost:douyin.users.get30+douyin.users.videos.list30}} |
| 10 accounts | 20 | {{cost:douyin.users.get10+douyin.users.videos.list10}} | {{cost:douyin.users.get300+douyin.users.videos.list300}} |
| plus 2 comment pages on each new hit (say 3 a week) | — | — | $0.048 |
Script
import os, json, requests, datetime as dt
API, HEAD = "https://api.okdata.online", {"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"}
rivals = {"BrandA": "MS4wLjABAAAA...", "BrandB": "MS4wLjABAAAA..."}
today = dt.date.today().isoformat()
with open("douyin_rivals.jsonl", "a", encoding="utf-8") as out:
for name, sec_uid in rivals.items():
prof = requests.get(API + "/v1/douyin/users/get", headers=HEAD, params={"id": sec_uid}, timeout=60).json()["data"]["item"]
vids = requests.get(API + "/v1/douyin/users/videos/list", headers=HEAD, params={"id": sec_uid}, timeout=60).json()["data"]["items"]
out.write(json.dumps({"date": today, "brand": name, "followers": prof["followers"],
"videos": [{"id": v["id"], "at": v["published_at"], **v["metrics"]} for v in vids]}, ensure_ascii=False) + "\n")
Load the JSONL into a sheet or a notebook and diff by date.
Things to keep in mind
- No play counts: Douyin does not publish views on other accounts' videos. Compare likes, comments, shares and saves.
- A video that vanishes from the list between two days was deleted or made private. Your snapshot is the only record left.
- Pinned videos may sit at the top of the list; use
published_at, not position, to decide what is new. - Follower history exists only from the day you start recording.
Alternatives
Paid Douyin analytics platforms track competitor accounts with dashboards and history going back further than your own recording, and suit teams that want a ready-made view. Doing it by hand weekly works for two or three accounts. For the full playbook across Douyin, Xiaohongshu and the rest, see competitor monitoring.
Updated