tikhub-api-helper
Original:🇺🇸 English
Translated
2 scriptsChecked / no sensitive code detected
Search and query TikHub APIs for TikTok, Douyin, Xiaohongshu, Lemon8, Instagram, YouTube, Twitter, Reddit, and more. Use when user asks about needs to fetch data from social media platforms. Supports both English and Chinese queries.
20installs
Added on
NPX Install
npx skill4agent add liangdabiao/tikhub_api_skill tikhub-api-helperTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →TikHub API Helper
A skill to help users search, find, and call TikHub API endpoints for social media data.
Quick Start
When a user asks about TikHub API or wants to fetch social media data:
- Search for relevant APIs using the searcher script
- Show the user available options with parameters
- Call the API with appropriate parameters
- Return formatted results to the user
Available Scripts
API Searcher - api_searcher.py
api_searcher.pySearch and find relevant TikHub API endpoints.
bash
# Search by keyword
python api_searcher.py "user profile"
python api_searcher.py "视频评论"
python api_searcher.py "trending"
# List all APIs for a specific tag/category
python api_searcher.py tag:TikTok-Web-API
python api_searcher.py tag:Douyin-App-V3-API
# List popular/common APIs
python api_searcher.py popular
# List all available tags/categories
python api_searcher.py tags
# Get detailed info for a specific API
python api_searcher.py detail:tiktok_web_fetch_user_profile_getAPI Client - api_client.py
api_client.pyMake HTTP requests to TikHub API endpoints.
bash
# Health check (no authentication required)
python api_client.py GET /api/v1/health/check
# Get user profile
python api_client.py GET /api/v1/tiktok/web/fetch_user_profile "sec_user_id=MS4wLjABAAAA..."
# Search for videos
python api_client.py GET /api/v1/tiktok/web/fetch_search_video "keyword=gaming"
# POST request with JSON body
python api_client.py POST /api/v1/tiktok/web/generate_xgnarly '{"url": "https://..."}'Supported Platforms
| Platform | Tag Name | APIs Available |
|---|---|---|
| TikTok Web | | 58 endpoints |
| TikTok App | | 76 endpoints |
| Douyin Web | | 76 endpoints |
| Douyin App | | 45 endpoints |
| Douyin Search | | 20 endpoints |
| Douyin Billboard | | 31 endpoints |
| Xiaohongshu Web | | 26 endpoints |
| 26 endpoints | |
| YouTube | | 16 endpoints |
| 13 endpoints | |
| 23 endpoints | |
| Bilibili | | 24 endpoints |
| 33 endpoints | |
| Zhihu | | 32 endpoints |
Use to see all categories.
python api_searcher.py tagsCommon Use Cases
Get User Profile
bash
# TikTok user profile
python api_searcher.py "fetch user profile tiktok"
python api_client.py GET /api/v1/tiktok/web/fetch_user_profile "sec_user_id=USER_ID"Get Video Details
bash
# TikTok video details
python api_searcher.py "fetch post detail"
python api_client.py GET /api/v1/tiktok/web/fetch_post_detail "post_id=POST_ID"Search Content
bash
# Search for videos/users
python api_searcher.py "search video"
python api_client.py GET /api/v1/tiktok/web/fetch_search_video "keyword=YOUR_KEYWORD"Get Comments
bash
# Get video comments
python api_searcher.py "fetch comment"
python api_client.py GET /api/v1/tiktok/web/fetch_post_comment "post_id=POST_ID"Authentication
API requests use a default token for development. For production use, users should:
- Get their API token from TikHub User
- Set the environment variable
TIKHUB_TOKEN - Or modify in
DEFAULT_TOKENapi_client.py
Request format:
json
{
"Authorization": "Bearer YOUR_API_TOKEN"
}Base URLs
- China users: (bypasses GFW)
https://api.tikhub.dev - International:
https://api.tikhub.io
The API client auto-detects the appropriate URL. To override, modify the parameter in the client.
use_china_domainRate Limits
- QPS: 10 requests per second per endpoint
- Timeout: 30-60 seconds
- Retry: Max 3 retries on error
Instructions for Claude
When helping users with TikHub API:
- Understand the user's goal - What data do they want? From which platform?
- Search for relevant APIs - Use with appropriate keywords
api_searcher.py - Present options - Show matching APIs with brief descriptions
- Guide parameters - Check what parameters are required using
detail:OPERATION_ID - Make the request - Use with the user's parameters
api_client.py - Format results - Present the API response in a clear, readable format
Example Workflow
User: "I want to get a TikTok user's profile"
bash
# Step 1: Search for the relevant API
python api_searcher.py "tiktok user profile"
# Step 2: Show results and confirm endpoint
# Found: GET /api/v1/tiktok/web/fetch_user_profile
# Step 3: Get detailed parameter info
python api_searcher.py detail:tiktok_web_fetch_user_profile_get
# Step 4: Make the API call with user's parameters
python api_client.py GET /api/v1/tiktok/web/fetch_user_profile "sec_user_id=MS4wLjABAAAA..."
# Step 5: Format and present resultsError Handling
Common errors and solutions:
| Error | Solution |
|---|---|
| Check API token is valid |
| Rate limit exceeded, wait before retry |
| Check network, try China domain if in mainland China |
| Check API details for required parameters |
Reference
- Full API Documentation: TikHub API Docs
- Apifox Docs: docs.tikhub.io
- API Status: monitor.tikhub.io
- GitHub: github.com/TikHub