In today's era dominated by short videos and graphic content, one of the biggest challenges facing creators and operation teams is: What to post today? How to post it? How to make it popular?
This article will guide you step-by-step in building an automatic content planning Agent based on the TikHub API and the Coze intelligent agent platform, helping you automatically complete:
- Popular content analysis
- Title template generation
- Daily topic suggestions
🧠 Project Background
Traditional content operations rely on manual searches, bursts of inspiration, or extensive research. However, by leveraging the content data interfaces provided by TikHub and the intelligent conversational capabilities of Coze, we can achieve true:
- Data-driven content selection
- Automatic cross-platform content template recommendations
- Structured script draft generation
🛠️ Technology Selection
| Technology | Purpose |
|---|---|
| TikHub API | Obtaining hot video data, tags, and comments from the Douyin platform |
| Coze Intelligent Agent | Carrying out the logical reasoning and language generation of the content planning Agent |
| n8n (Optional) | Workflow automation, used to trigger planning tasks daily |
🧩 Functional Goals (Automatic Content Planning Agent)
- Users input keywords (e.g., "skin care," "fitness breakfast")
- The Agent automatically calls the TikHub interface to obtain relevant popular videos
- Analyzes title styles, tag frequencies, and content structures
- Generates the following outputs:
- Title templates (e.g., "Methods Used by XX People for XXX")
- Popular tag suggestions
- 30s/60s content rhythm structure
- Draft script suggestions
🔗 Step 1: TikHub API Call
Example Interface (Obtaining videos related to keywords):
1GET https://api.tikhub.io/api/v1/tiktok/web/fetch_tag_post?challengeID={id}&count=30
2You can first obtain the challengeID corresponding to the keyword via /search_tag:
1GET https://api.tikhub.io/api/v1/tiktok/web/search_tag?keyword=健身早餐
2Then, use the challengeID to obtain related video content:
1import requests
2
3headers = {
4 "Authorization": "Bearer YOUR_API_KEY",
5 "accept": "application/json"
6}
7
8response = requests.get(
9 "https://api.tikhub.io/api/v1/tiktok/web/fetch_tag_post",
10 params={"challengeID": "7551", "count": 30},
11 headers=headers
12)
13
14data = response.json()
15Extract:
desc(title/copy)create_time(publication time)statistics.play_count,digg_count,comment_count
🧠 Step 2: Calling the Coze Intelligent Agent for Content Planning
You can create a "content planning Agent" via API or directly on the Coze platform, allowing it to accept the extracted hot video information and generate content templates.
Prompt Example:
1You are a professional new media content planner. I will provide you with the titles of popular videos on a certain topic on the Douyin platform. You need to summarize:
2
31. Common title templates (3)
42. Typical content structure (beginning-middle-end)
53. Popular tags (recommended for use when posting on Xiaohongshu/Douyin)
64. Generate a 60-second video script draft suitable for ordinary users to shoot with their mobile phones.
7
8The following is the input content:
9{Video title 1}
10{Video title 2}
11...
12You can use Webhook, n8n, or directly integrate to call the Coze API to input the extracted data from TikHub into the intelligent agent.
🧾 Step 3: Example Output
User input keyword "fitness breakfast," output as follows:
📌 Title Templates:
- 3 minutes to prepare a nutritious breakfast, even fitness instructors recommend it!
- Lazy high-protein breakfast, no cooking required!
- Eating breakfast this way, lose weight quickly and gain muscle?
⏱ Content Structure:
- Beginning (5 seconds): Show the finished product to attract attention
- Middle: Quickly explain the steps
- End: Show nutritional components + calories
🔖 Popular Tags:
#fitness breakfast #high-protein diet #weight loss food #healthy lifestyle #quick breakfast
📝 Script Draft:
Good morning everyone! Today I'm sharing a 3-minute high-protein breakfast! You only need three ingredients: eggs, avocado, and whole-wheat bread. First, boil the eggs, slice them, mash the avocado, spread it on the bread, put the eggs on top, and sprinkle some black pepper. Done! High protein, low calories, perfect for the weight loss period! Don't forget to like and follow!
⏰ Bonus: Implementing Daily Scheduled Recommendations with n8n
- Automatically retrieve new content related to keywords every morning at 9 am
- Call the Coze agent to output draft copy
- Finally, push the content to operation managers via webhook or enterprise WeChat
📦 Project Significance
This content planning Agent allows content teams to stop focusing on trending searches, inspiration, and experience, and truly achieves:
Data-driven content creation, AI-powered content production efficiency.
Suitable for:
- Small and medium-sized brand content operators
- Self-media entrepreneurs
- Advertising agencies' content planners
- AI product developers
📍 Conclusion
If you are also looking for a more efficient content production method, try the combination of TikHub + Coze. TikHub provides stable and programmable content data streams, and Coze handles content understanding and generation, making it a highly compatible AI agent technology combination.
🚀 感兴趣欢迎评论区交流,或者私信我拿一份完整的 demo 示例代码!