SuperAPI AI Directory

tikhub-api-helper

Coding & development

View repository

Updated 10-16 00:00

About this skill

TikHub API Helper

A Skill for retrieving data from various social media platforms via the TikHub API.

Core Workflow

  1. Use scripts/api_searcher.py to search for relevant APIs
  2. Use scripts/api_searcher.py detail:操作ID to confirm parameters (optional)
  3. Use scripts/api_client.py to call the API
  4. Organize the data and return it to the user

APIs for Each Platform

Xiaohongshu — App API

Search notes(also used to find users; extract user information from notes):

GET /api/v1/xiaohongshu/app/search_notes keyword=关键词 page=1

User fields in search results(⚠️ easy to get wrong):

  • userid = user's real ID (all lowercase, used for subsequent API calls)
  • red_id = Xiaohongshu ID (cannot be used for API calls)
  • nickname = nickname

Get user information:

GET /api/v1/xiaohongshu/app/get_user_info user_id=<userid字段值>

Get user notes(cursor pagination, not page):

# 第一页(不传 cursor)
GET /api/v1/xiaohongshu/app/get_user_notes user_id=<userid>

# 翻页(传上一页最后一条笔记的 cursor 字段)
GET /api/v1/xiaohongshu/app/get_user_notes user_id=<userid> cursor=<上一页最后笔记的cursor值>

Note data is in the data.notes array, with each entry having the following fields:

  • id = note ID
  • title / display_title = title
  • likes = like count
  • comments_count = comment count
  • type = type (normal=image/text, video=video)
  • cursor = pagination cursor

Note details / comments:

GET /api/v1/xiaohongshu/app/get_note_info note_id=<id字段值>
GET /api/v1/xiaohongshu/app/get_note_comments note_id=<id字段值>

Douyin — Search API + App V3

Search(⚠️ POST method, parameters in JSON body):

# 综合搜索
POST /api/v1/douyin/search/fetch_general_search_v1 '{"keyword":"关键词","count":10,"offset":0}'

# 视频搜索
POST /api/v1/douyin/search/fetch_video_search_v1 '{"keyword":"关键词","count":10,"offset":0}'

# 用户搜索
POST /api/v1/douyin/search/fetch_user_search '{"keyword":"关键词","count":10,"offset":0}'

# 多类型搜索
POST /api/v1/douyin/search/fetch_multi_search '{"keyword":"关键词","count":10}'

Search result fields: videos are in data.data[].aweme_info , including:

  • desc = video description
  • author.nickname = author nickname
  • author.follower_count = follower count
  • statistics.digg_count = like count
  • statistics.comment_count = comment count

Trending searches:

GET /api/v1/douyin/web/fetch_hot_search_result
GET /api/v1/douyin/app/v3/fetch_hot_search_list

Users:

GET /api/v1/douyin/app/v3/fetch_user_profile "sec_user_id=用户ID"
GET /api/v1/douyin/app/v3/fetch_user_post_videos "sec_user_id=用户ID" "max_cursor=0"

TikTok

# 热门内容
GET /api/v1/tiktok/web/fetch_trending_post
GET /api/v1/tiktok/web/fetch_trending_searchwords

# 探索
GET /api/v1/tiktok/web/fetch_explore_post

# 用户
GET /api/v1/tiktok/web/fetch_user_profile "sec_user_id=用户ID"
GET /api/v1/tiktok/web/fetch_user_post "sec_user_id=用户ID"

Bilibili

# 热搜
GET /api/v1/bilibili/web/fetch_hot_search "limit=10"

# 搜索视频(⚠️ order/page/page_size 为必填参数)
GET /api/v1/bilibili/web/fetch_general_search "keyword=关键词" "order=totalrank" "page=1" "page_size=10"

# 视频详情
GET /api/v1/bilibili/web/fetch_one_video "bvid=视频BV号"

Weibo

# 热搜
GET /api/v1/weibo/web_v2/fetch_hot_search

# 用户信息(⚠️ 参数名是 uid,不是 user_id)
GET /api/v1/weibo/web_v2/fetch_user_basic_info "uid=用户UID"

# 用户微博
GET /api/v1/weibo/web_v2/fetch_user_posts "uid=用户UID" "page=1"

# 微博详情(⚠️ 参数名是 id)
GET /api/v1/weibo/web_v2/fetch_post_detail "id=微博ID"

KOL/Blogger In-Depth Analysis Workflow

When the user asks to analyze a blogger/KOL (e.g., "Xiaohongshu blogger Yybricks top 20 posts"):

  1. Search for the user — use search_notes to search for the username keyword, find the target user from the notes, and extract the userid field
  2. Get user details — use get_user_info to get information such as follower count
  3. Get the list of works — use get_user_notes with cursor pagination to get all works
  4. Sort and filter — sort by the likes field and select the Top N
  5. Organize the output — list each note's title, like count, comment count, and type

Key: don't give up halfway!

  • If the user asks for 20 posts, you must retrieve 20 posts
  • If one page isn't enough, keep paginating with cursor
  • You need to retrieve more than N notes to sort out the true Top N

Cross-Platform Research Workflow

  1. First call the trending/search APIs of 2-3 platforms
  2. Summarize and compare, presenting in a table
  3. Call each platform's API only 1-2 times; do not search repeatedly

API Search Tips

api_searcher.py "小红书搜索"          # 中文搜索
api_searcher.py "抖音热搜"            # 中文搜索
api_searcher.py "xiaohongshu search"  # 英文搜索
api_searcher.py "tag:Xiaohongshu-App-API"  # 按标签列
api_searcher.py "detail:操作ID"       # 查看 API 参数详情
api_searcher.py "tags"                # 列出标签
api_searcher.py "popular"             # 常用 API

Call Format

# GET 请求(参数用 key=value 格式)
python api_client.py GET /api/v1/平台/路径 "参数名=参数值" "参数名2=参数值2"

# POST 请求(body 用 JSON 格式)
python api_client.py POST /api/v1/平台/路径 '{"key":"value"}'

Authentication

The API Token is configured via the environment variable TIKHUB_TOKEN , and api_client.py reads it automatically.

Error Handling

  • API returns "deprecated" / "Not Found" → use api_searcher.py to search for an alternative endpoint
  • Parameter error → use api_searcher.py detail:操作ID to view the parameter definitions
  • get_user_notes returned empty → check whether user_id is using the one from the search results, the userid field