liangdabiao/tikhub_api_skill
Overview
This skill helps you search, discover, and call TikHub APIs to fetch social media data across multiple platforms. It supports TikTok, Douyin, Xiaohongshu, Instagram, YouTube, Twitter, Reddit and more, with English and Chinese query support. Use it to find relevant endpoints, prepare requests, and return formatted results quickly.
How this skill works
The skill lets you search the API catalog for keywords or tags, view detailed endpoint parameters, and run HTTP requests via the included client. It auto-selects the appropriate base URL (China or international), supports GET/POST calls, handles authentication via a token, and returns parsed, human-readable responses. Rate limits, timeouts, and retries are enforced to reduce common errors.
When to use it
- You need a user profile, post details, comments, or search results from TikTok, Douyin, or other platforms.
- You want to discover which TikHub endpoint supports a specific data need (e.g., trending videos, hashtags, or followers).
- You need a working example to call an endpoint with correct parameters and authentication.
- You want formatted API responses instead of raw JSON, or need guidance on required parameters.
- You need to switch between China and international API domains depending on network constraints.
Best practices
- Search with precise keywords or tags (e.g., "fetch user profile" or tag:TikTok-Web-API) to narrow results.
- Always set a valid TIKHUB_TOKEN environment variable for production requests; use default token only for development.
- Check endpoint details (detail:OPERATION_ID) for required parameters before making calls.
- Respect rate limits (max ~10 QPS per endpoint) and implement retries with backoff for transient errors.
- Use the China domain when operating inside mainland China to avoid connectivity issues.
Example use cases
- Fetch a TikTok user profile by running a search, selecting GET /api/v1/tiktok/web/fetch_user_profile, then calling the client with sec_user_id.
- Retrieve post details or comments for a given post_id to build analytics dashboards or moderation tools.
- Search videos or users by keyword to power discovery features in an app or report.
- List available endpoints for a platform tag (e.g., tag:Douyin-App-V3-API) to scope integration work.
- Perform a health check or simple GET to verify connectivity and authentication before bulk requests.
FAQ
Set TIKHUB_TOKEN as an environment variable or supply a Bearer token in the Authorization header. Replace the default development token for production.
Which base URL should I use?
Use https://api.tikhub.dev for China (bypasses GFW) and https://api.tikhub.io internationally. The client can auto-detect or you can override the domain parameter.