TikHub Social Media Data Query
Setup (Required)
Set your API key before using this skill:
CODEBLOCK0
Get your API key at: https://tikhub.io (register → dashboard → API Keys)
Optional proxy (if TikHub API is blocked in your network):
CODEBLOCK1
Authentication
- - Base URL: INLINECODE0
- Auth Header: INLINECODE1
- All responses: unified
ResponseModel → INLINECODE3 - Check balance: INLINECODE4
Helper Script
Use scripts/tikhub_query.py for all API calls:
CODEBLOCK2
Examples:
CODEBLOCK3
Platform Quick Reference
Endpoint Naming Convention
All endpoints follow:
/api/v1/{platform}/{source}/{action}
- -
platform: douyin, tiktok, xiaohongshu, instagram, youtube, twitter, weibo, kuaishou, bilibili, etc. - INLINECODE8 : web, app, app/v3, webv2, etc.
- INLINECODE9 : fetchuserprofile, fetchonevideo, fetchsearch, etc.
Core Actions (available on most platforms)
| Action Pattern | Purpose |
|---|
| INLINECODE10 / INLINECODE11 | Get user/account details |
| INLINECODE12 / INLINECODE13 |
Get user's posts/videos |
|
fetch_one_video /
fetch_post_detail | Get single post/video by ID |
|
fetch_search /
search | Keyword search |
|
fetch_post_comments /
fetch_comments | Get comments on a post |
|
fetch_user_fans /
fetch_user_followers | Follower list |
|
fetch_user_follow /
fetch_user_followings | Following list |
|
fetch_trending /
fetch_hot_search | Trending/hot topics |
Platform → Preferred API Version
| Platform | Preferred Prefix | Notes |
|---|
| 抖音 Douyin | INLINECODE26 or INLINECODE27 | Web for search, App V3 for details |
| 抖音搜索 |
/api/v1/douyin/search/ | Dedicated search APIs (latest) |
| 抖音创作者 |
/api/v1/douyin/creator_v2/ | Requires creator cookie |
| 抖音热榜 |
/api/v1/douyin/billboard/ | Hot lists, trending |
| 抖音星图 |
/api/v1/douyin/xingtu_v2/ | KOL marketplace data |
| TikTok |
/api/v1/tiktok/web/ or
/api/v1/tiktok/app/v3/ | Web for search, App V3 for details |
| 小红书 XHS |
/api/v1/xiaohongshu/app_v2/ | Most stable, recommended |
| Instagram |
/api/v1/instagram/v1/ | Prefer V1, V2/V3 as fallback |
| YouTube |
/api/v1/youtube/web/ | V2 for additional features |
| Twitter/X |
/api/v1/twitter/web/ | Search, user, posts, trending |
| Threads |
/api/v1/threads/web/ | User, posts, search |
| Reddit |
/api/v1/reddit/app/ | Full featured app API |
| LinkedIn |
/api/v1/linkedin/web/ | Profiles, posts, search |
| 微博 Weibo |
/api/v1/weibo/web_v2/ | V2 recommended |
| 快手 Kuaishou |
/api/v1/kuaishou/web/ or
/api/v1/kuaishou/app/ | |
| B站 Bilibili |
/api/v1/bilibili/web/ | |
| 微信公众号 |
/api/v1/wechat_mp/web/ | Article extraction |
| 微信视频号 |
/api/v1/wechat_channels/ | Requires special params |
| 知乎 Zhihu |
/api/v1/zhihu/web/ | Q&A, articles, search |
| 今日头条 |
/api/v1/toutiao/web/ or
/api/v1/toutiao/app/ | |
| Lemon8 |
/api/v1/lemon8/app/ | |
Pagination
Most list endpoints support cursor-based pagination:
- -
cursor / max_cursor / offset / after — pass from previous response - INLINECODE55 /
page_size — items per page (typically 10-30) - Response includes
has_more, cursor, next_cursor etc.
Hybrid Video Parser
Parse any video URL from supported platforms automatically:
GET /api/v1/hybrid/video_data?url=<any_video_url>
Supports: Douyin, TikTok, Xiaohongshu, Kuaishou, Bilibili, Weibo, etc.
Detailed Platform References
For full endpoint lists per platform, read the corresponding reference file:
- - references/douyin.md — Douyin (Web + App + Search + Billboard + Creator + Xingtu)
- references/tiktok.md — TikTok (Web + App + Creator + Analytics + Ads + Shop)
- references/xiaohongshu.md — Xiaohongshu (App V2 + Web V2)
- references/instagram.md — Instagram (V1 + V2 + V3)
- references/youtube.md — YouTube (Web + V2)
- references/twitter-threads.md — Twitter/X + Threads
- references/reddit-linkedin.md — Reddit + LinkedIn
- references/chinese-platforms.md — Weibo, Kuaishou, Bilibili, WeChat, Zhihu, Toutiao, etc.
Only read the relevant reference file when you need endpoint details for a specific platform.
Cost Awareness
- - Most endpoints: $0.001-$0.005 per call
- Some premium endpoints (Instagram, creator analytics): up to $0.01
- Always prefer cached results when
cache_url is returned - Batch operations where available (e.g., Reddit batch post details)
- Check balance before bulk operations: INLINECODE61
TikHub 社交媒体数据查询
设置(必需)
使用此技能前,请先设置您的API密钥:
bash
export TIKHUBAPIKEY=
获取API密钥:https://tikhub.io(注册 → 控制面板 → API密钥)
可选代理(如果您的网络环境无法访问TikHub API):
bash
export TIKHUB_PROXY=http://your-proxy:port
身份认证
- - 基础URL: https://api.tikhub.io
- 认证头: Authorization: Bearer APIKEY>
- 所有响应:统一的ResponseModel → {code, message, data, cacheurl, ...}
- 查询余额:GET /api/v1/tikhub/user/getuser_info
辅助脚本
所有API调用请使用 scripts/tikhub_query.py:
bash
python3 scripts/tikhubquery.py path> [param=value ...] [--method POST] [--body {}]
示例:
bash
搜索抖音视频
python3 scripts/tikhub
query.py /api/v1/douyin/web/fetchsearch keyword=宁德时代
获取TikTok用户资料
python3 scripts/tikhub
query.py /api/v1/tiktok/web/fetchuser_profile secUid=MS4wLjABAAAA...
搜索小红书笔记
python3 scripts/tikhub
query.py /api/v1/xiaohongshu/web/getnote
bykeyword keyword=CATL
获取Instagram用户信息
python3 scripts/tikhub
query.py /api/v1/instagram/v1/fetchuser_info username=cataborrecycling
搜索Twitter
python3 scripts/tikhub
query.py /api/v1/twitter/web/fetchsearch_timeline keyword=CATL battery
搜索YouTube
python3 scripts/tikhub
query.py /api/v1/youtube/web/searchvideos keyword=CATL solid state battery
获取微博热搜
python3 scripts/tikhub
query.py /api/v1/weibo/web/fetchhot_search
混合解析任意视频URL
python3 scripts/tikhub
query.py /api/v1/hybrid/videodata url=https://v.douyin.com/xxx
平台快速参考
端点命名规范
所有端点遵循:/api/v1/{platform}/{source}/{action}
- - platform: douyin, tiktok, xiaohongshu, instagram, youtube, twitter, weibo, kuaishou, bilibili等
- source: web, app, app/v3, webv2等
- action: fetchuserprofile, fetchonevideo, fetchsearch等
核心操作(适用于大多数平台)
| 操作模式 | 用途 |
|---|
| fetchuserprofile / fetchuserinfo | 获取用户/账号详情 |
| fetchuserpost / fetchuserposts |
获取用户帖子/视频 |
| fetch
onevideo / fetch
postdetail | 按ID获取单条帖子/视频 |
| fetch_search / search | 关键词搜索 |
| fetch
postcomments / fetch_comments | 获取帖子评论 |
| fetch
userfans / fetch
userfollowers | 粉丝列表 |
| fetch
userfollow / fetch
userfollowings | 关注列表 |
| fetch
trending / fetchhot_search | 热门/热搜话题 |
平台 → 推荐API版本
| 平台 | 推荐前缀 | 说明 |
|---|
| 抖音 Douyin | /api/v1/douyin/web/ 或 /api/v1/douyin/app/v3/ | Web用于搜索,App V3用于详情 |
| 抖音搜索 |
/api/v1/douyin/search/ | 专用搜索API(最新) |
| 抖音创作者 | /api/v1/douyin/creator_v2/ | 需要创作者cookie |
| 抖音热榜 | /api/v1/douyin/billboard/ | 热门榜单、趋势 |
| 抖音星图 | /api/v1/douyin/xingtu_v2/ | KOL营销平台数据 |
| TikTok | /api/v1/tiktok/web/ 或 /api/v1/tiktok/app/v3/ | Web用于搜索,App V3用于详情 |
| 小红书 XHS | /api/v1/xiaohongshu/app_v2/ | 最稳定,推荐使用 |
| Instagram | /api/v1/instagram/v1/ | 优先使用V1,V2/V3作为备选 |
| YouTube | /api/v1/youtube/web/ | V2提供额外功能 |
| Twitter/X | /api/v1/twitter/web/ | 搜索、用户、帖子、趋势 |
| Threads | /api/v1/threads/web/ | 用户、帖子、搜索 |
| Reddit | /api/v1/reddit/app/ | 功能完整的应用API |
| LinkedIn | /api/v1/linkedin/web/ | 个人资料、帖子、搜索 |
| 微博 Weibo | /api/v1/weibo/web_v2/ | 推荐使用V2 |
| 快手 Kuaishou | /api/v1/kuaishou/web/ 或 /api/v1/kuaishou/app/ | |
| B站 Bilibili | /api/v1/bilibili/web/ | |
| 微信公众号 | /api/v1/wechat_mp/web/ | 文章提取 |
| 微信视频号 | /api/v1/wechat_channels/ | 需要特殊参数 |
| 知乎 Zhihu | /api/v1/zhihu/web/ | 问答、文章、搜索 |
| 今日头条 | /api/v1/toutiao/web/ 或 /api/v1/toutiao/app/ | |
| Lemon8 | /api/v1/lemon8/app/ | |
分页
大多数列表端点支持基于游标的分页:
- - cursor / maxcursor / offset / after — 从上次响应中传入
- count / pagesize — 每页项目数(通常10-30)
- 响应包含 hasmore、cursor、nextcursor等
混合视频解析器
自动解析来自支持平台的任意视频URL:
GET /api/v1/hybrid/videodata?url=video_url>
支持:抖音、TikTok、小红书、快手、B站、微博等
详细平台参考
如需查看各平台的完整端点列表,请阅读对应的参考文件:
- - references/douyin.md — 抖音(Web + App + 搜索 + 榜单 + 创作者 + 星图)
- references/tiktok.md — TikTok(Web + App + 创作者 + 分析 + 广告 + 商店)
- references/xiaohongshu.md — 小红书(App V2 + Web V2)
- references/instagram.md — Instagram(V1 + V2 + V3)
- references/youtube.md — YouTube(Web + V2)
- references/twitter-threads.md — Twitter/X + Threads
- references/reddit-linkedin.md — Reddit + LinkedIn
- references/chinese-platforms.md — 微博、快手、B站、微信、知乎、头条等
仅在需要特定平台的端点详情时,才读取对应的参考文件。
费用说明
- - 大多数端点:每次调用$0.001-$0.005
- 部分高级端点(Instagram、创作者分析):最高$0.01
- 当返回cacheurl时,优先使用缓存结果
- 尽可能使用批量操作(如Reddit批量帖子详情)
- 批量操作前查询余额:GET /api/v1/tikhub/user/getuser_info