/tikhub-plugin:tikhub-python-sdkfrom tikhub-plugin
Guides usage of the official TikHub Python SDK for building apps, scripts, or data pipelines against TikHub. Covers install, client init from TIKHUB_API_KEY, platform namespaces, sync/async, pagination, and error handling.
Ships in tikhub-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The official tikhub package wraps all TikHub endpoints with a namespaced client, retries with
backoff, and a structured error hierarchy.
[ -z "${TIKHUB_API_KEY:-}" ] && echo "Set TIKHUB_API_KEY first (see tikhub-onboarding)."
python3 -c "import tikhub" 2>/dev/null || echo "Install: pip install tikhub"
pip install tikhub
import os
from tikhub import TikHub
with TikHub(api_key=os.environ["TIKHUB_API_KEY"]) as client:
video = client.tiktok_app_v3.fetch_one_video(aweme_id="7372484719365098283")
print(video)
The client exposes ~54 resources, named {platform}_{api}. Common ones:
tiktok_app_v3, tiktok_ads, tiktok_creator, tiktok_analytics, tiktok_shop_webdouyin_app_v3, douyin_searchinstagram_v1, instagram_v2, instagram_v3youtube_web, youtube_web_v2twitter_web, threads_webxiaohongshu_web, xiaohongshu_appweibo_web, bilibili_web, reddit_app, linkedin_web, kuaishou_web, zhihu_web, wechat_channels, lemon8_apptikhub_user (usage, balance, pricing)If unsure which method/namespace serves a task, use tikhub-endpoint-discovery to find the
REST path, then map /{platform}/{api}/{action} → client.{platform}_{api}.{action}(...).
Pass the cursor/token from the previous response (pagination_token, continuation_token,
max_cursor, or cursor depending on platform) and loop until exhausted. Cap pages — each call
costs credits.
from tikhub import TikHub
# SDK raises structured exceptions (auth, rate-limit, insufficient-balance, API errors).
try:
with TikHub(api_key=os.environ["TIKHUB_API_KEY"]) as client:
data = client.instagram_v2.fetch_user_info(username="instagram")
except Exception as e:
# inspect e for status/code; back off on rate-limit, stop on auth/balance errors
print("TikHub call failed:", e)
os.environ["TIKHUB_API_KEY"].What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub tikhub/tikhub-plugin --plugin tikhub-plugin19 skills in this plugin
/bulk-data-exportFetch large lists from TikHub (posts, followers, search results, comments) with safe pagination, dedup, and export to CSV or JSON for downstream analysis. Use when the user wants "all posts", "export to CSV/JSON", "scrape N results", "a dataset of", or any large repeated-pull job./comments-analysisPull and analyze the comments on a post/video — sentiment breakdown, recurring themes/keywords, top comments, and notable questions or complaints. Use when the user says "analyze the comments", "what are people saying on this post", "comment sentiment", or pastes a post URL and wants the discussion summarized./competitor-analysisBenchmark multiple accounts/competitors side by side on one or more platforms — followers, engagement rate, posting cadence, top content, and growth signals. Use when the user says "compare these accounts", "us vs competitors", "benchmark @a @b @c", or wants a competitive landscape./creator-analyticsAnalyze a creator/account on any supported platform — profile stats, recent post performance, engagement rate, posting cadence, and top content. Use when the user says "analyze this creator/account/channel", "how is @handle doing", "engagement rate", or wants a performance summary for a profile./douyinWork with Douyin (抖音) data via TikHub — fetch videos, user profiles and post lists, video comments, and run video/user/general search via Douyin's dedicated search series. Use when the task targets Douyin. Covers App-V3 and the Douyin Search series./hashtag-researchResearch a hashtag or keyword — volume/popularity signals, top and recent content, and related hashtags — on TikTok, Douyin, Instagram, Xiaohongshu, and more. Use when the user asks "researchOther plugins' skills for the same job