In cross-border short video e-commerce and content operation, real-time tracking of competitor or target user's Douyin content dynamics is becoming increasingly important. This article will introduce how to use TikHub API + Claude Code + n8n workflow to quickly build an automated Douyin video monitoring system, and achieve exception alerts and content update push through enterprise WeChat, WeChat robots, etc.
🧩 System Architecture Overview
The entire system is divided into three parts:
- Data Collection: Use the TikHub API to obtain user homepage video data;
- Logical Judgment: Use Claude Code (or other LLM like GPT-4o) to analyze data to see if it meets the push conditions;
- Workflow Control and Notification Sending: Use n8n to implement automated workflow control and WeChat push.
System Flowchart:
1[Scheduled Trigger] → [TikHub API Pull Video Data] → [Claude Code Judgment for Triggering Alert] → [WeChat Push Node]
2🛠 Step One: Obtaining Douyin Video Data - Using TikHub API
TikHub is a social media data API service platform for developers, supporting Douyin, Instagram, X, and other platforms.
We will use the following interface to obtain user homepage videos:
API Documentation:
1GET /api/v1/tiktok/app/v3/fetch_user_post_videos
2Request Parameters:
| Parameter Name | Description |
|---|---|
sec_user_id | User's sec_user_id, recommended |
max_cursor | Paging parameter, pass 0 for the first page |
count | Maximum number of videos per request, default 20 |
sort_type | Sorting method (0 Newest, 1 Trending) |
unique_id | User unique ID, backup parameter |
Python Request Example:
1import requests
2
3headers = {"Authorization": "Bearer YOUR_API_KEY"}
4params = {
5 "sec_user_id": "MS4wLjABAAA...",
6 "count": 10,
7 "sort_type": 0
8}
9
10res = requests.get("https://api.tikhub.io/api/v1/tiktok/app/v3/fetch_user_post_videos", headers=headers, params=params)
11data = res.json()
12videos = data["data"]["videos"]
13👉 快速接入 TikHub:https://api.tikhub.io
📚 官方文档:https://docs.tikhub.io
💬 用户中心:https://user.tikhub.io
🤖 Step Two: Using Claude Code to Determine if a Push Should Be Triggered
Next, we use Claude Code (or OpenAI Function Calling) for logical judgment of video content. For example, judging:
- Whether a video is trending (likes exceed expectations)
- Whether sensitive words appear
- Whether the number of videos increases dramatically
- Whether the user hasn't posted a video for three consecutive days
Example Code:
1def should_notify(video_list):
2 for v in video_list:
3 if v['digg_count'] > 100000:
4 return True, f"Trending Alert: {v['desc'][:20]}..."
5 return False, ""
6You can let the LLM automatically analyze, or make judgments locally. We recommend using Claude or GPT to analyze video content keywords, sentiment, tags, etc.
🔁 Step Three: Using n8n for Automated Workflow + WeChat Push
n8n is a powerful low-code workflow tool that can be deployed locally or on a server. We will configure the following nodes:
Node Flow:
- Cron Timer (triggered every hour)
- HTTP Request Node → Calls the TikHub interface
- Function Node → Calls Claude/OpenAI for judgment
- Conditional Judgment If → If a push is needed
- Webhook or Enterprise WeChat Robot Node → Sends notifications
WeChat Robot Push Example:
1POST https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx
2
3{
4 "msgtype": "markdown",
5 "markdown": {
6 "content": "🚨 <font color=\"warning\">Trending Video Alert</font>\nAccount:@xxx\nTitle:xxxx\nLikes:123456"
7 }
8}
9🌟 System Demonstration
The final system will have the following features:
- Automatically retrieves the latest videos from multiple Douyin accounts you specify;
- Detects trending, abnormal, or keyword-related content;
- Automatically sends WeChat messages when conditions are met;
- Fully automated operation, with logging and alerts.
🔗 Summary: Best Practices for Agile Social Monitoring System Building
By leveraging the reliable data retrieval capabilities of the TikHub API, combining the intelligent judgment of Claude Code, and using n8n's flexible orchestration, you can build an enterprise-level video monitoring and content alert system without writing extensive code from scratch.
📌 项目推荐组合:
| Tool/Service | Description |
|---|---|
| TikHub API | Quickly retrieves Douyin video data |
| Claude Code / GPT | Content analysis, triggering judgment |
| n8n | Automated workflow management |
| WeChat Robot | Notification channels |
If you'd like to try a similar project, visit 👉 TikHub Website to register and test, and we offer daily free usage for new users.
Any questions, please leave a message or discuss on the TikHub Discord Community!