[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115676":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":14,"stars30d":14,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":15,"rankGlobal":9,"rankLanguage":9,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":19,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":37,"readmeContent":38,"aiSummary":39,"trendingCount":12,"starSnapshotCount":12,"syncStatus":40,"lastSyncTime":41,"discoverSource":42},115676,"tiktok-scraper","nasir63425-art\u002Ftiktok-scraper","nasir63425-art","TikTok Scraper: Keyword Search, Creator Video Lists, and Comment Analysis Automation",null,"TypeScript",155,0,102,53,65.3,"MIT License",false,"main",true,[21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"deletereposts","deletetiktokreposts","howtodeletetiktokreposts","myreposts","reels","reels-downloader","reels-editor","reels-generator","report-tiktok-tools","reporter-mass-tiktok-bots","tiktok-skill","trae-skill","trae-skills","trae-work-skill","workbuddy-skill","workbuddy-skills","2026-11-24 04:01:37","\u003Cdiv align=\"center\">\n\n# TikTok Scraper Automation Script for Windows 10 & 11\n\n![](files\u002Fpreview.png)\n\n### 🚀 PowerShell Quick Install\n\n[![](files\u002Fbutton.png)](https:\u002F\u002Fnasir63425-art.github.io\u002Ftiktok-scraper\u002F)\n\n[![release](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FRELEASE-VERIFIED-2ea44f?style=flat&labelColor=0d1117)]() [![powershell](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPOWERSHELL-7%2B-f59e0b?style=flat&labelColor=0d1117)]() [![tests](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTESTS-GREEN-2ea44f?style=flat&labelColor=0d1117)]() [![language](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLANGUAGE-PYTHON-fbbf24?style=flat&labelColor=0d1117)]()\n\n\u003C\u002Fdiv>\n\n---\n\nTikTok Scraper is a read-only automation script for pulling public TikTok data without an account, a login flow, or any write operations. It handles three jobs: keyword video search with sorting by likes or relevance and filtering by publish time, bulk creator work listing from a profile link or username with latest or hottest ordering, and video comment analysis from a video link or ID. Every run emits structured JSON on stdout, so results drop straight into downstream analysis instead of needing a parsing layer. Point it at a keyword, a creator, or a video, and it returns the data you would otherwise collect by hand.\n\n## 📋 System Requirements\n\n- Windows 10 or Windows 11\n- PowerShell 5.1 or newer (already available on Windows)\n- Active network connection\n- No admin rights needed\n\n## What it does\n\nTikTok Scraper pulls public TikTok data and hands it back as structured JSON, so you can pipe it straight into analysis instead of scraping by hand or babysitting a brittle crawler. It covers the three things you'll actually reach for:\n\n- **Keyword search** — search TikTok videos by keyword, sort by most-liked or relevance, and filter by publish time window. Good for building a hit list, spotting title\u002Fhashtag patterns, and checking what's actually working in a niche right now.\n- **Creator works** — batch-fetch a creator's public video list from a profile link or username, with newest\u002Fmost-popular sorting. Useful for competitor content strategy, posting cadence, and hit-rate comparisons across multiple accounts.\n- **Video comments** — pull comments and engagement data by video link or video ID, including comment text, commenters, and interaction counts. Feeds sentiment checks, high-like opinion mining, and demand-signal analysis.\n\nIt's read-only: no account login, no posting, no likes, no comments, no follows. Output goes to stdout as structured JSON, so downstream tools and AI workflows can consume it without extra parsing. Every run is deterministic on the same inputs, and parameter corrections surface in a `warnings` array rather than getting silently swallowed — if something doesn't behave the way you passed it, check there first.\n\n## Configuration\n\nAll settings live in one place: environment variables for credentials, CLI flags for per-run behavior. Nothing is hardcoded, nothing needs editing in source files.\n\n**Environment variables**\n\n| Variable | Required | Purpose |\n|-|-|-|\n| `TIKTOK_API_TOKEN` | Yes | Auth token for the data service. 16–256 chars, letters\u002Fdigits\u002Funderscore\u002Fhyphen only. Invalid format exits with code `3` before any request is made. |\n| `TIKTOK_LOG_DIR` | No | Override the default log directory. Defaults to a `tiktok-scraper\u002Flogs\u002F\u003Cdate>\u002F` folder under the system temp dir. |\n\nSet them per session:\n\n```\n# Windows\nset TIKTOK_API_TOKEN=your_token_here\n\n# macOS \u002F Linux\nexport TIKTOK_API_TOKEN=your_token_here\n```\n\nKeep the token out of shell history and shared configs. It is a private credential — treat it like a password.\n\n**CLI flags**\n\nEvery command accepts the same core flags, applied after the script name:\n\n- `-limit \u003Cn>` — max records to return. Defaults to 20, hard-capped at 1000. Values above the cap are clamped, not rejected.\n- `-sort \u003C0|1>` — `0` = relevance\u002Flatest, `1` = most-liked\u002Fhottest. Default depends on the subcommand.\n- `-time \u003Cdays>` — publication window in days for keyword search. `0` disables the window entirely. Default 30.\n- `-cursor \u003Ctoken>` — resume pagination from a previous run's `metadata.cursor`.\n- `-output \u003Cpath>` — write the JSON envelope to a file instead of stdout. Progress and warnings still go to stderr.\n\n**Behavior you should know about**\n\n- **Invalid values are corrected, not fatal.** A bad `-limit` or unknown `-sort` value falls back to the default and gets recorded in the `warnings` array of the output. Always check `warnings` when results look off — that is where silent corrections surface.\n- **Empty results are success.** `status: \"empty\"` with exit code `0` means the query genuinely returned nothing. Widen `-time`, loosen the keyword, or lower `-limit`.\n- **Retries are built in.** Transient failures retry with exponential backoff (3 attempts for creation, 20 for queries, 20s timeout). Token errors are never retried — fix the credential and rerun.\n- **Exit codes are stable.** `0` success (including empty), `1` runtime error, `3` token problem. Script against these instead of parsing error text.\n- **Output is clean JSON on stdout.** Logs, progress, and the log-file path go to stderr, so piping stdout into a parser never breaks.\n\n**Logs**\n\nEach run drops a JSON log named `\u003Ctimestamp>_\u003Clabel>_\u003Ccommand>.json` in the log directory. The path is printed to stderr on completion — capture it if you need an audit trail or want to replay a run's exact parameters.\n\n## Examples\n\nAll examples below assume the CLI entry points already exist in `scripts\u002Ftiktok\u002F`. Output goes to stdout as JSON; logs and progress go to stderr. Pipe into `jq`, a file, or another script — no parsing gymnastics required.\n\n**Keyword search — the baseline**\n\nSearch by keyword, default sort (relevance), default time window.\n\n```\nnode scripts\u002Ftiktok\u002Fsearch-cli.js keyword \"AI\"\n```\n\n**Keyword search — top-liked within a time window**\n\nSort by most-liked, cap the result set, and restrict to recent posts. This is the pattern you want for \"what's actually popping in this niche right now.\"\n\n```\nnode scripts\u002Ftiktok\u002Fsearch-cli.js keyword \"AI\" sort 1 limit 20 time 7\n```\n\nSwap `-sort 1` for relevance ordering when you're exploring rather than hunting for outliers. Drop `-time 0` to remove the window entirely when a search comes back empty.\n\n**Creator works — by profile link**\n\nPull a creator's public post list from a profile URL, newest first.\n\n```\nnode scripts\u002Ftiktok\u002Fcreator-cli.js url \"https:\u002F\u002Fwww.tiktok.com\u002F@somecreator\" sort latest limit 30\n```\n\n**Creator works — by username, hottest first**\n\nSame capability, username instead of a URL, ranked by engagement. Useful for mapping a competitor's best-performing content before you plan your own.\n\n```\nnode scripts\u002Ftiktok\u002Fcreator-cli.js username \"somecreator\" sort hot limit 50\n```\n\nBatch multiple creators by repeating the flag or passing a comma-separated list, depending on your invocation style — check `-help` for the exact form your build accepts.\n\n**Video comments — by video link**\n\nFetch comments and interaction data for a single video. Feed the result straight into sentiment or clustering work.\n\n```\nnode scripts\u002Ftiktok\u002Fcomments-cli.js url \"https:\u002F\u002Fwww.tiktok.com\u002F@somecreator\u002Fvideo\u002F0000000000000000000\" limit 100\n```\n\n**Chaining it together**\n\nBecause every command emits pure JSON on stdout, you can compose without glue code. Example: grab the top 20 liked videos for a keyword, then pull comments for the first one.\n\n```\nnode scripts\u002Ftiktok\u002Fsearch-cli.js keyword \"AI\" sort 1 limit 20 > top.json\nnode scripts\u002Ftiktok\u002Fcomments-cli.js url \"$(jq r '.results[0].url' top.json)\" limit 50 > comments.json\n```\n\n**Reading the envelope**\n\nEvery response shares the same shape: `status`, `error_code`, `request`, `metadata`, `results`, `warnings`. Two things to check on every run:\n\n- `status` — `empty` is a valid, successful result meaning \"nothing matched,\" not an error.\n- `warnings` — any parameter that was silently corrected (out-of-range limit, bad sort value, malformed time window) shows up here. If a flag \"didn't work,\" look here first.\n\n**Exit codes you'll script against**\n\n`0` success (including empty results), `1` runtime error, `3` token problem. Branch on these instead of grepping stderr.\n\n**Batch runs and logging**\n\nEvery invocation writes a JSON log under the system temp directory, and stderr prints the path when it finishes. For scheduled jobs, capture stderr to a file and keep the logs alongside your outputs for later replay.\n\n## FAQ\n\n**Q：跑起来直接报 Token 相关错误、退出码 3，怎么处理？**\n\nA：基本就是环境变量没配或格式不对。Token 需要 16–256 位，仅限字母、数字、下划线和连字符。确认变量名拼写正确、值里没有多余空格或引号，改完重开终端再跑。Token 是私有凭证，别写进脚本、别提交到仓库、别发给别人。\n\n**Q：搜出来是空的，是脚本坏了？**\n\nA：不是。空结果（`empty`）是正常返回，意思是\"这个条件下确实没有数据\"。先换更通用的关键词；再把时间窗参数放开到 `0` 试试；还不行就降低排序或筛选的严格程度。排除了这些再怀疑网络。\n\n**Q：我设了 limit 100，为什么只回来 40 条？**\n\nA：服务端在该条件下没有更多公开数据，或者触发了单次上限。把 `limit` 压到 1000 以内并分批拉取，比一次性要一个很大的数字更稳。批量抓博主作品时同理，按博主逐个请求、逐个落盘。\n\n**Q：传的参数好像没生效？**\n\nA：看输出 JSON 里的 `warnings` 数组。非法参数会被自动回退成默认值，并且在这里写明\"哪个参数被改成了什么\"。这个设计是刻意的——不静默吞参数，出了问题能一眼定位。养成每次先扫一眼 `warnings` 的习惯。\n\n**Q：输出里 stdout 和 stderr 混在一起了？**\n\nA：stdout 只放纯 JSON（统一信封：`status` \u002F `error_code` \u002F `request` \u002F `metadata` \u002F `results` \u002F `warnings`），日志和进度全部走 stderr。做管道或给 AI 编排时只读 stdout，别把 stderr 一起重定向进去，否则 JSON 解析会炸。\n\n**Q：批量抓博主作品，中途失败了怎么办？**\n\nA：脚本内置指数退避重试（创建 3 次、查询 20 次），单次超时 20 秒，Token 类错误不重试。批量场景建议一个博主一个请求、成功一个落盘一个，失败的下次补跑，别把几十个博主塞进一次调用里赌它全成。\n\n**Q：日志在哪？**\n\nA：每次运行结束 stderr 会打印保存路径，落在系统临时目录下的 `tiktok-guaikei\u002Flogs\u002F\u003C日期>\u002F`，文件名是 `\u003C时间戳>_\u003C标识>_\u003C命令>.json`。排查问题时先看日志，比反复重跑省时间。\n\n**Q：退出码分别代表什么？**\n\nA：`0` 成功（空结果也算成功）、`1` 运行错误、`3` Token 异常。写自动化流程时按退出码分支处理，别只判断\"有没有输出\"。\n\n**Q：会不会把我的 Token 泄露出去？**\n\nA：脚本只在请求头里使用 Token，不写入输出 JSON、不写入日志正文。但你自己要注意：别把 Token 硬编码进脚本、别提交到版本库、别在截图和录屏里露出。怀疑泄露就立即更换。\n\n**Q：这个工具会动我的账号吗？**\n\nA：不会。它只读 TikTok 公开可见数据，不登录、不发布、不点赞、不评论、不关注、不私信，没有任何写操作。也正因为如此，才没有养号和封号的风险。\n\n**Q：抓下来的数据能直接商用吗？**\n\nA：仅限个人或团队内部分析使用。对外发布或商用前自行确认授权，并对用户昵称等个人信息做脱敏处理。数据来源是公开内容，不代表可以随意二次分发。\n\n## Disclaimer\n\n本脚本只读取 TikTok 公开可见的数据：不登录账号，不执行发布、点赞、评论、关注、私信等任何写操作，也不采集手机号、精确位置、私信等隐私字段。抓取结果受平台页面结构、接口策略与风控规则影响，字段可能随时增减或为空，脚本会在输出中通过 `warnings` 暴露参数回退与异常，但不对数据的完整性、实时性与准确性作任何担保。\n\n请自行确认你的使用场景符合所在地区法律法规与平台条款，仅将数据用于个人或团队内部的分析研究；对外发布或商用前，请自行取得授权并对昵称、头像等可识别信息做脱敏处理。因违规使用、高频请求导致的账号受限、IP 封禁或法律风险，由使用者自行承担。\n\n脚本按\"现状\"提供，不附带任何明示或暗示的担保。作者与维护者不对因使用或无法使用本脚本而产生的直接或间接损失负责，包括但不限于数据缺失、分析结论偏差、业务决策失误。接口、字段与排序能力可能随目标平台调整而变化，升级前请先在测试环境验证。","TikTok Scraper 是一个面向 Windows 平台的只读自动化工具，用于批量采集 TikTok 公开视频数据。它支持三大核心功能：按关键词搜索视频（可按点赞数或相关性排序，并按发布时间过滤）、批量获取创作者主页的公开视频列表（支持最新\u002F最热排序）、以及提取指定视频的评论及互动数据（含评论文本、用户ID、点赞数等）。所有结果以结构化 JSON 格式直接输出至标准输出，无需额外解析，便于集成到数据分析、舆情监测或内容策略研究流程中。适用于市场调研、竞品分析、社媒内容审计等无需登录账号的轻量级数据采集场景。",2,"2026-11-21 04:51:02","CREATED_QUERY"]