🎵 Douyin User Post Videos | An account's posts, with the counters Douyin actually gives Give it a sec_uid, profile URL or short_id and get every post as a row: description, likes, comments, shares, collects, duration, music, publish time and link — plus a per-account summary with median likes, the…
One run-wide request budget instead of one per account. Previously every
account had its own 10-page allowance, so 20 accounts x 10 pages allowed 200
upstream requests in a single run. Because both the account count and the page
count are caller-controlled, the work multiplied: a handful of wide runs could
dominate a whole day's upstream usage. A run is now capped at 40 requests on
a paid plan / 12 on the free plan, counted across every account, every page
and every short_id lookup. A single account can still walk all 10 pages; only
many-account runs are compressed.
Accounts are de-duplicated after being normalised to sec_uids, so a
repeated account — or a profile URL paired with its bare sec_uid — is
fetched once instead of once per occurrence.
Exhausting the budget is a business result, not a failure: the run still ends
SUCCEEDED, pushes a type: "notice" row naming the limit that applied, and
records appliedLimits.maxRequestsPerRun, requests and budgetExhausted
in SUMMARY. The old "Free plan caps applied" wording was wrong for paid runs
that can now hit a budget too, so cap messages are tier-neutral.
run() accepts optional injected dependencies (input, upstream client,
dataset, KV store, logger, sleep, tier) so both billing tiers can be
exercised offline.
Tests
test/request-budget.js drives both tiers with a fake upstream client that
never stops on its own, and asserts exactly 40 / 12 requests, an exhausted
budget and a notice row. npm test now runs it as well: free-tier-only tests
previously missed a paid-branch ReferenceError that made every paid run fail.
[0.6] - 2026-11-09
The Billing section claimed the Actor charges "pay per result". It does not: the
only charge event registered on the platform is apify-actor-start, collected once
when the run begins, so a run returning 300 rows costs the same as one returning 3.
The section now describes that, and stops promising something the invoice contradicts.
Free-plan runs are capped at 5 accounts x 3 pages x 60 posts. Every page, seed and enrichment is one upstream
request, so this is where the real cost sits. The cap is written to the dataset as a
notice row and to SUMMARY.appliedLimits.capped, and a capped run still ends
SUCCEEDED - exceeding a plan quota is never a failed run.
[0.5] - 2026-11-09
Free-plan callers now get a capped slice of a run: 5 accounts x 3 pages x 60
posts, down from the full 20 x 10 x 200. Pricing is unchanged — still the
platform's $0.10 actor-start event — but at full width one run could spend
200 upstream requests ($0.001/page, so $0.20) against a charge that goes to
Apify rather than to us. The cap bounds a free run at 20 requests ($0.02).
The cap is reported, never silent: a type: "notice" row is pushed to the
dataset and SUMMARY.appliedLimits carries capped: true. A capped run still
ends SUCCEEDED and still delivers every row it fetched.
Paid-plan runs are byte-for-byte unchanged: same 20 accounts, 10 pages, 200
posts, same request count.
Removed dead code that the counter retirement left behind: the usage-gate
key-value store open (one guaranteed 403 + warning per run), the unused
resolveBillingTier and userTag helpers, and the noopKeyValueStore /
openKeyValueStoreOrNoop wrappers that no longer had a caller.
README: "Pay per result" replaced with what the platform actually bills. The
pricing defines only apify-actor-start, so the old claim was false.
[0.4] - 2026-10-12
The run can no longer be killed by the key-value store. Under
LIMITED_PERMISSIONS — how Apify's automated QA and every API-triggered run
starts an Actor — opening the store is refused with HTTP 403
(KeyValueStoreCollectionClient.getOrCreate, path /v2/key-value-stores).
That call sat in a || fallback chain and was never inside a try/catch of
ours, so the throw ended the run with exit code 91 and a reported FAILED run
with zero items. Every store open now goes through a wrapper that returns a
no-op store instead of throwing, so the free-run counter and the run SUMMARY
degrade and the actual work proceeds.
The gate store's name-to-id lookup no longer depends on the store still being
on the first page. There is no GET-by-name endpoint, so the lookup pages
through /v2/key-value-stores; it used a fixed limit=50, which silently
stopped containing gate stores once the account passed 50 of them — and the
account creates a new default store on every run, so that list grows on its
own. The lookup now pages (100 per page, up to 20 pages).
Medians on an even-sized sample returned the upper-middle element, not the
median. arr[Math.floor(arr.length / 2)] yields the larger of the two middle
values, which biases the number upward — the exact bias a median exists to
remove. It now averages the two middle values.
[0.3] - 2026-10-09
Changed
README: added three sections before Quick start - what you can use it for, who it fits, and who it does not fit. The last section now names the Actor's real limits (what it cannot reach, which field is unavailable, which reading of a metric is wrong), so a buyer can tell whether it is the wrong tool before paying.
[0.2] - 2026-10-08
KV writes and status messages can no longer hang the run. Under
LIMITED_PERMISSIONS these calls do not merely fail — they can return a
promise that never resolves. Measured on a live run of a sibling Actor:
results were fetched successfully, then the following setValue never
returned and the run sat for 49 minutes before being aborted with an empty
dataset and a paid bill, and not one error in the log. try/catch cannot
help there — it catches a rejection, not a promise that never settles. Every
bookkeeping write now races a 15s timeout and reports the failure as
non-fatal, so a stuck store costs one summary field instead of the whole run.
0.1 (2026-10-05)
Initial release. One dataset row per Douyin post: description with a caption-less flag, digg/comment/share/collect counts, the For-You recommend count, duration converted from milliseconds, video-vs-image detection, ad-post flag, music title, publish time and a working link, with the source account attached.
The summary reports, per account: posts collected, the account's own post total and coverage when the lookup provides them, median and total likes, median comments and recommends, video/image split, ad-post count, posts-without-caption count, the five most-liked posts, and a viewsNote.
Input accepts sec_uids, douyin.com/user/<sec_uid> profile URLs and numeric short_ids (resolved through the provider's profile lookup first, with the resolved nickname carried onto every row), up to 20 accounts and 200 posts each; newest or popular order.
Measured quirks handled: all engagement lives in statistics (never at the top level) and statistics.play_count is always 0 — Douyin does not expose views, so viewCount is null with viewsAvailable: false rather than a false zero; has_more is 0/1; paging uses the millisecond max_cursor and stops when it does not advance; collect_stat sits outside statistics; and the short_id profile lookup returns only a minimal 7-field profile (no follower count, signature or post total), which is reported as null with profileFieldsAvailable naming what the lookup actually carried.
Free tier: 5 runs/day (counter persisted in a cross-run named KV store).