tiktok-video-search
Installation
SKILL.md
TikTok Video Search
Find public TikTok videos by keyword, hashtag, or username through Frevana's asynchronous video API. Requires Bash and Python 3.9+; no browser extension, daemon, Apify SDK, or provider token is needed.
Workflow
- Choose exactly one source type per task:
--query/--keywordfor keyword video searches,--hashtagfor topic videos (without#), or--usernamefor videos from specific creators (without@, not profile URLs). Repeat the chosen flag for 1–5 values. Resolve{baseDir}to this skill's folder and preferscripts/tiktok_video_search.sh. Keyword mode sendssearch_querieswithsearch_section=/video; hashtag mode sendshashtags; username mode sendsprofilesand uses the Server's original-video feed with latest-first sorting. Exact post collection, Top/user search, and ads are separate workflows. - Authenticate with
FREVANA_TOKENorFREVANA_API_KEY, or a one-time--token/--api-key. Explicit credentials override environment credentials; otherwise the token takes precedence. Never print credentials. - Use
runto submit and wait, orcreateto return immediately. Keep the printedclient_task_idand returnedtask_id. Downloads are enabled by the Server by default and incur extra cost. For metadata-only requests, pass--should-download-videos false. Leave other paid enrichment off unless requested; see references/api.md for parameters and cost semantics. - Follow
next_poll_after_ms. Fetch results only whenstatus=READYandresult_available=true. Stop onFAILED,REVIEW_REQUIRED,RESULT_EXPIRED, or a zero polling interval without available results. Resume timeouts withwait --task-id; never automatically submit another paid task. If creation is uncertain, retry only with the sameclient_task_idand identical options. Changed inputs under that ID return HTTP 409. - Preserve the JSON file and summarize relevant videos unless the user asks for raw JSON. Useful fields include
id,text,webVideoUrl,authorMeta,playCount,diggCount, andvideo_url. Keep IDs as strings, missing metrics as unknown, and individualerrorCoderecords visible. A ready task does not guarantee every item has a downloaded video.