SuperAPI AI Directory

tiktok-subscribe

Frontend & websites

View repository

Updated 10-16 07:27

About this skill

TikTok Monitoring Subscription Push

1. Introduction

Subscribe to TikTok keywords, specified accounts, and topics;every day at 9:00 AM it automatically pulls new content within the nearly 24-hour time window of "yesterday 9:00 ~ today 9:00", generates an HTML daily report grouped by subscription item, and pushes it, with no need to manually scroll through feeds one by one. Three types of subscription items:

Subscription Item Tracked Content Data Source
Keyword Subscription New viral videos for keywords (pulled by like popularity for the most recent day) Keyword video search
Account Subscription New posts and engagement data for specified accounts User profile posts
Topic Subscription New posts and popularity changes for specified topics Topic post list

Target Users: Overseas brands / advertisers (tracking keyword popularity and competitor activity), MCNs / business agencies (batch tracking multiple creator accounts and topics), content creators / researchers (tracking topic popularity and viral patterns).


2. Features

Feature Module Capability Description
Three-Entry Subscription Three types of subscription items: keywords / accounts (secUserId) / topics (topic ID); a single command can subscribe to a mix of them
Daily Automatic Push The automation task includes all subscription items and automatically pulls yesterday's new content every day at 9:00
Time Window Filtering Filters by the "yesterday 9:00 ~ today 9:00" time window and intelligently paginates (keywords / topics support pagination)
HTML Daily Report TikTok platform style (black background logo + TikTok red/cyan color scheme), displays post tables grouped by subscription item, supports export to PDF / high-definition images
Engagement Data Views / likes / comments / shares / publish time; all subscription items are displayed in descending order by view count
AI Semantic Summary AI reads the post content and summarizes the "today's themes" (analyzing what the posts are saying, based on the actual number of posts) + the "themes/viewpoints" of each subscription item
No-Update Collapsing Subscription items with no updates yesterday / no updates in the past 7 days are automatically collapsed with a notice

3. Subscription Methods (Three Entries)

Silent Execution Principle: All intermediate steps (fetch verification, automation_update) must not output process prompts to the user; only the final result is shown.

When the user expresses an intent to subscribe but the method is unclear, first output guidance:

📬 订阅 TikTok 内容日报,三类订阅任选:
1️⃣ 关键词订阅 — 说「订阅关键词 nvidia 每日新视频」
2️⃣ 账号订阅 — 提供账号 secUserId 或 TikTok App 分享链接,如「订阅这个账号」
3️⃣ 话题订阅 — 提供话题 ID(ch_id),说「订阅话题 2525872 每日新作品」
已订阅后每天 9:00 自动推送昨日新内容日报,最多可订阅 100 个订阅项(三类合计)。

Entry One: Keyword Subscription

The user says "subscribe to keyword xxx" → the Agent verifies that the keyword can be pulled normally (silent execution):

python3 scripts/subscribe.py fetch --keywords "nvidia" --first --html

After verification passes, append it to the automation task's --keywords parameter (see "Account Management Rules").

Entry Two: Account Subscription

User provides secUserId or a share link → Agent extracts secUserId → verifies → appends to --accounts:

# 验证并首次展示(静默执行)
python3 scripts/subscribe.py fetch --accounts "MS4wLjAB..." --first --html

How to obtain secUserId(the complete long string starting with MS4w):

  1. On the mobile TikTok App, go to the target account's profile page → tap "Share" in the top right corner → "Copy link". The share link contains the sec_uid=MS4w... parameter. Provide the complete share link to this skill.
  2. Or press F12 to open the browser developer tools → paste and run in Console:JSON.parse(document.getElementById('__UNIVERSAL_DATA_FOR_REHYDRATION__').textContent).__DEFAULT_SCOPE__['webapp.user-detail'].userInfo.user.secUid

Entry 3: Topic subscription

User provides topic ID (ch_id, pure number) → verifies → appends to --topics:

# 验证并首次展示(静默执行)
python3 scripts/subscribe.py fetch --topics "2525872" --first --html

How to obtain topic ID: When the user only provides a topic name / topic link, first use the "TikTok Trending Search" skill to search for the topic to obtain the topic ID (thetopicId field), or extract it from the ch_id parameter in the TikTok topic link, then hand it to this skill for subscription.


4. Data rules

Time window

  • Daily update mode(default for automated tasks): fetch works within the recent 24-hour window "yesterday 9:00 ~ today 9:00" (local timezone)
  • First-time subscription mode(--first): directly fetch the latest content on the first page, without filtering by time window
  • The API does not support sorting by time; the Skill compares and filters by publish time item by item internally; keywords / topics support pagination (--max-pages adjustable, default 3 pages)

Subscription item status determination

Status Determination condition Report handling
updated Works within the time window are matched Display the works table normally
no_update_yesterday No works from yesterday (keyword subscription items do not perform a 7-day lookback, to avoid extra credit consumption) Collapsed notice "No updates yesterday"
no_update_7d Latest work of the account / topic is earlier than 7 days ago / no works Collapsed notice "No updates in the past 7 days"
error API request failed Collapsed notice with failure reason

5. One-click installation

Prerequisites

  • Python 3.8+ (uses only the standard library, no additional dependencies required)
  • RedFox Data API Key (go to RedFox hub to register and obtain)

Installation steps

  1. Place the skill folder into your Skills directory
  2. Configure the environment variable REDFOX_API_KEY(for configuration details, see references/core_workflow.md Step 0)
  3. No additional dependencies need to be installed; use directly

6. Workflow

The core execution flow (subscription item parsing, script invocation, time window filtering, table rendering rules, AI summary, empty results and error handling, etc.) is detailed in references/core_workflow.md. The Agent must follow all rules in that file when executing.


7. Usage guide

🔑 Authentication

First-time use requires configuring the environment variable REDFOX_API_KEY: go to RedFox hub to register an account and obtain the API Key. For configuration methods for the terminal and OpenClaw, see references/core_workflow.md Step 0。

Command quick reference

User intent Command
Fetch new content from subscription items from yesterday (daily update) fetch --keywords "k1,k2" --accounts "s1,s2" --topics "t1,t2" --html
First-time subscription verification / view latest activity fetch --keywords "k1" --first --html
Specify a historical date fetch --keywords "k1" --date 2026-10-12 --html
Single category of subscription items fetch --accounts "MS4wLjAB..." --markdown

fetch parameters

Parameter Description
--keywords Subscription keyword list, comma-separated
--accounts Subscription account list, comma-separated (secUserId or a share link with sec_uid= parameter)
--topics Subscription topic ID list, comma-separated (ch_id numbers)
--date Time window end date YYYY-MM-DD(default: 24 hours before today's 9:00 boundary)
--first First subscription mode: fetch the latest content on the first page, not filtered by time window
--count Number of items per subscription item (1~50, default 20)
--max-pages Maximum number of pages to turn per keyword/topic item in daily update mode (1~10, default 3)
--region Keyword video search region (default US)
--markdown Output in Markdown table format (for the Agent to relay)
--html Generate an HTML daily report (automatically opens the browser)
--save-json Save results to disk as JSON (used by the HTML daily report)

Global parameters --api-key must be placed after the subcommand (e.g. subscribe.py fetch --api-key ak_xxx ...), by default read from the environment variable REDFOX_API_KEY。


8. Account management rules (the Agent must comply)

Core principle: all subscription status = the --keywords / --accounts / --topics parameter in the automation command. No local file storage.

Upper limit

  • A single automation task can have at most 50 subscription items(total of the three categories)
  • Total subscription limit of 100 subscription items(total of the three categories)

Process for subscribing to a new subscription item

  1. Query existing automation tasks: use automation_update mode=list to get all tasks related to "TikTok subscription", and read the subscription list in each task's --keywords / --accounts / --topics subscription list in

  2. Determine append / create new:

    Condition Action
    Existing subscription items + new subscription items ≤ 50 Append to the corresponding parameter of the existing task (concatenate after deduplication)
    Existing subscription items + new subscription items > 50 and the total ≤ 100 Create a new automation task and put the overflow into the new task
    The total will be > 100 Inform the user that the upper limit has been reached; please unsubscribe some subscription items before subscribing
    User requests to unsubscribe a certain subscription item Remove that item from the corresponding task parameter
  3. Update/create an automation task:

    • Append:automation_update mode=update modify the subscription parameter in the existing task prompt subscription parameters in
    • Create new:automation_update mode=create, execute daily at 9:00 (FREQ=DAILY;BYHOUR=9;BYMINUTE=0), add a sequence number to the name, e.g. "TikTok Subscription Monitoring Daily Report #2"
    • automation prompt example:拉取TikTok订阅监控昨日新内容并生成HTML日报推送给用户:python3 scripts/subscribe.py fetch --keywords "nvidia" --accounts "MS4wLjAB..." --topics "2525872" --html
  4. Fetch once immediately: whether appending or creating new, you must immediately execute fetch --first --html once to display the latest results

Unsubscribe

Simply remove that item from the corresponding task's parameters. If a task has 0 subscription items remaining after removal, delete that automation task.


9. Output format

Subscription results overview (must be output when subscribing/fetching)

📊 订阅结果
| 项目 | 值 |
|------|-----|
| 本次订阅 | 关键词 2 个、账号 1 个、话题 1 个(1 个已订阅跳过) |
| 当前总订阅 | 5 / 100 项 |
| 自动化任务 | 已更新 ✅ 每日 9:00 自动执行 |
| 首次拉取 | 以下展示各订阅项最新动态 |

Details table of works for each subscription item (Markdown)

### ▸ 关键词「nvidia」 昨日新内容(5 条)

| # | 作者 | 作品摘要 | 播放 | 点赞 | 评论 | 分享 | 发布时间 |
|---:|---|---|---:|---:|---:|---:|---|
| 1 | Raina / `rainaships` | [party ended immediately #Tech...](作品链接) | 85,207 | 18,254 | 315 | 1,251 | 10-12 11:50 |

Requirements:

  • One subheading + one complete Markdown table per subscription item; the account subscription item table has no "Author" column
  • Work summary uses content original text (truncate to first 60 characters if too long), rendered as a clickable hyperlink [摘要](作品链接)
  • Values use a readable format (thousands separator, e.g., 85,207)
  • Publish time truncated to MM-DD HH:mm(local timezone)
  • All subscription items sorted by play count in descending order
  • Collapsed notice for subscription items with no updates yesterday / no updates in the past 7 days, e.g.: "The following 2 subscription items had no updates yesterday and have been collapsed"

Summary statistics (must be appended after all tables)

By AI reads the work contentto generate a semantic summary, without connecting to an LLM endpoint and without word frequency counting. Write to the same directory as the data file tiktok_subscribe_ai_summary.json,generate_report.py automatically merged into the HTML at render time.

{
  "overall": [
    {"title": "主题/事件名", "summary": "这段在讲什么(1-2 句)", "items": ["nvidia"], "workCount": 8}
  ],
  "items": [
    {"key": "nvidia", "kind": "keyword", "theme": "该订阅项今日主要聊了什么主题", "viewpoint": "该订阅项内容表达的观点/立场"}
  ]
}

Requirements:

  • overall is the "Today's Topic Summary": analyze what the work is actually saying (events/topics),not simple high-frequency words; summarize as many as there are, do not force a fixed number, fabrication is prohibited
  • items is the single subscription item summary: one entry for each subscription item with updates, explaining the "main topic" and "viewpoint/stance"
  • The number of topics is summarized based on actual content; if there are none, write fewer, do not force it

Output completeness checklist

For each subscription/fetch, the conversation must include:

  • Subscription result overview table
  • Markdown work detail table for each subscription item with updates
  • Collapsed notice for subscription items with no updates (if any)
  • Summary statistics analysis (AI semantic summary: today's topics + single subscription item topics/viewpoints)
  • Only when there is work data: HTML daily report generated notice (with file path) + automatically open preview

10. Notes

  1. Data authenticity: All values come from the data service response and are displayed truthfully; estimation or fabrication is strictly prohibited
  2. Input accuracy: Account subscription requires secUserId (starting with MS4w) or a share link with the sec_uid= parameter; topic subscription requires a topic ID (ch_id number); when the input is invalid, provide an accurate prompt with the acquisition method, do not guess or substitute
  3. Credit protection: Each successful query may consume credits; keywords / topics each consume 1 call per page turn; account subscription items return all recent works at once with no additional page turns; HTML daily reports and AI summaries are generated locally offline and do not consume credits; unless explicitly specified by the user, do not proactively turn pages or perform batch queries
  4. Authentication: First-time use requires configuring the environment variable REDFOX_API_KEY, for API Key acquisition and configuration see references/core_workflow.md
  5. Link integrity: Links in the output remain complete and clickable; do not use URLs truncated by the terminal
  6. Analysis is speculation: AI summaries are written based on public data and must be clearly marked as speculation, no fabrication

11. Project architecture

tiktok-subscribe/
├── SKILL.md                          # 本文件
├── scripts/
│   ├── subscribe.py                  # 统一入口:fetch 子命令(关键词 / 账号 / 话题三类订阅项)
│   └── generate_report.py            # 生成 TikTok 风格 HTML 日报(导出 PDF/图片)
├── output/                           # JSON 数据与 HTML 日报输出目录(运行时自动创建)
└── references/
    └── core_workflow.md              # 3 个接口详细文档与完整执行规则(技术参考)

Core module description

  • subscribe.py:
    • fetch — Fetch subscription item works, supporting first-time mode (fetch the first page) and daily mode (filter by yesterday's time window + page turning); three types of subscription items are passed in together for a single fetch, outputting JSON + Markdown,--html calls report generation when
  • generate_report.py: Read the JSON output by fetch and the local AI summary JSON to generate a TikTok platform-style HTML daily report, displaying works in tables grouped by subscription item (including author, engagement data, and work links), with subscription items that have no updates collapsed, and built-in one-click download PDF / high-definition image buttons (export images with html2canvas, export PDF via browser printing), automatically opening the browser after generation. File name format TikTok订阅日报_{日期}.html(first-time mode is TikTok订阅首次拉取_{日期}.html)

Resource Index

File Purpose
scripts/subscribe.py Fetch works for subscription items / time window filtering / pagination
scripts/generate_report.py Generate HTML visual daily report
references/core_workflow.md Detailed documentation for 3 interfaces (technical reference)

12. FAQ

Q: What dependencies need to be installed? A: No third-party dependencies are required; it runs with the Python standard library.

Q: What is the maximum number of subscription items? A: The total limit is 100 (keywords + accounts + topics combined); a single automation task can have at most 50, and any excess automatically creates a new task.

Q: When is the daily report pushed? What time period of data is fetched? A: It runs automatically every day at 9:00 AM, fetching works published within the nearly 24-hour window from "yesterday 9:00 to today 9:00" (local time zone).

Q: The API does not support sorting by time, so how do you ensure only works within the time window are fetched? A: The Skill internally paginates and compares publication times one by one: if it hits the window and the current page has no works earlier than the window start, it continues paginating; once an earlier work appears, it stops, keeping only works within the window (see Section 4 for details).

Q: What time zone are work times in? A: The API returns second-level timestamps, and the Skill uniformly converts them tolocal time zonefor display and filtering.

Q: What if a subscription item had no new content yesterday? A: The report collapses and indicates "No updates yesterday"; for account / topic types, if there have been no updates in the past 7 days, it indicates "No updates in the past 7 days".

Q: How do I unsubscribe? A: Tell the Agent the subscription item you want to cancel, and the Agent removes that item from the parameters of the corresponding automation task.

Q: Why is there no 7-day lookback for keyword subscriptions? A: Keyword video search directly fetches by "the most recent day"; if there are no new additions yesterday, it can be determined that there are no updates. Doing a 7-day lookback requires additional credits, so by default no lookback is performed.