tiktok-api

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

TikTok API

TikTok API

TikTok data on demand: keyword post search with sort/date filters, profile lookup by handle, followers and followings, hashtag and music/sound feeds, location-based posts, and comment threads — one plain HTTP GET per call, paid as you go. No login, no session cookies, no browser automation, no TikTok developer app review.
Base URL:
https://tiktok.fetcher.sh
按需获取TikTok数据:支持带排序/日期筛选的关键词帖子搜索、通过用户名查询个人主页、获取粉丝与关注列表、话题标签和音乐/音效内容流、基于地点的帖子,以及评论线程——每次调用只需一个简单的HTTP GET请求,按需付费。无需登录、无需会话Cookie、无需浏览器自动化、无需TikTok开发者应用审核。
Base URL:
https://tiktok.fetcher.sh

Quick reference

快速参考

Base URL
https://tiktok.fetcher.sh
Auth
Authorization: Bearer bby_live_...
or x402 (USDC)
Price$0.004/call (flat)
Endpoints13, all
GET
MCP
https://tiktok.fetcher.sh/mcp
Machine-readable
/openapi.json
·
/llms.txt
·
/skill.md
Base URL
https://tiktok.fetcher.sh
认证方式
Authorization: Bearer bby_live_...
或 x402(USDC)
价格$0.004/次调用(统一价)
端点数量13个,均为
GET
请求
MCP
https://tiktok.fetcher.sh/mcp
机器可读文档
/openapi.json
·
/llms.txt
·
/skill.md

Which endpoint do I need?

如何选择合适的端点?

I want to...Call
Search posts by keyword (optionally most-liked/recent)
GET /api/post/search
Look up a post by its share URL
GET /api/post?url=...
Look up a profile by @username
GET /api/user/handle/{username}
Get a user's posts, followers, or followings
GET /api/user/{id}/posts
/
/followers
/
/followings
Get a post's comments
GET /api/post/{id}/comments
Find posts under a hashtag
GET /api/hashtag/{id}/posts
Find posts using a specific sound
GET /api/music/{id}/posts
Full param details for every row:
references/endpoints.md
.
我想要...调用端点
按关键词搜索帖子(可选按点赞量最高/最新排序)
GET /api/post/search
通过分享URL查询帖子
GET /api/post?url=...
通过@用户名查询个人主页
GET /api/user/handle/{username}
获取用户的帖子、粉丝或关注列表
GET /api/user/{id}/posts
/
/followers
/
/followings
获取帖子的评论
GET /api/post/{id}/comments
获取话题标签下的帖子
GET /api/hashtag/{id}/posts
获取使用特定音效的帖子
GET /api/music/{id}/posts
每一行的完整参数详情:
references/endpoints.md

Authentication

认证方式

Two ways to pay, same data — full mechanics in the
fetcher
skill
:
bash
undefined
两种付费方式,获取的数据一致——完整机制详见
fetcher
技能文档
bash
undefined

1. Prepaid credits (recommended — get a key at https://fetcher.sh/topup

1. 预付费额度(推荐——可在https://fetcher.sh/topup或通过POST /api/credits/topup获取密钥,详见fetcher技能文档)

or via POST /api/credits/topup, see the fetcher skill)

export FETCHER_API_KEY="bby_live_xxxxxxxxxxxx" curl -H "Authorization: Bearer $FETCHER_API_KEY"
"https://tiktok.fetcher.sh/api/post/search?keyword=hello"
export FETCHER_API_KEY="bby_live_xxxxxxxxxxxx" curl -H "Authorization: Bearer $FETCHER_API_KEY"
"https://tiktok.fetcher.sh/api/post/search?keyword=hello"

2. x402 pay-per-call — omit the header; a GET with no payment returns 402

2. x402按调用付费——省略请求头;未付费的GET请求会返回402状态码,并附带机器可读的付费要求(支持在Base、Polygon、Arbitrum、Monad或Solana网络使用USDC支付)。@x402/fetch会自动签名并重试请求。

with machine-readable payment requirements (USDC on Base, Polygon,

Arbitrum, Monad, or Solana). @x402/fetch signs and retries automatically.


Every response is `{ "status": number, "message": string, "data": ... }`; the
HTTP status mirrors `status`.

所有响应格式均为`{ "status": number, "message": string, "data": ... }`;HTTP状态码与`status`字段值一致。

Endpoints (13 — all GET, $0.004/call)

端点(共13个——均为GET请求,$0.004/次调用)

EndpointWhat it returns
/api/post/search
Posts matching a keyword; sort and date-range filters
/api/post
A single post resolved from its share URL
/api/post/{id}
A single post by ID
/api/post/{id}/comments
A post's comments
/api/post/{id}/comments/{commentId}/replies
Replies to a comment
/api/user/handle/{username}
Profile by @username
/api/user/{id}/posts
A user's posts
/api/user/{id}/followers
A user's followers
/api/user/{id}/followings
Accounts a user follows
/api/hashtag/handle/{name}
Hashtag metadata by name
/api/hashtag/{id}/posts
Posts under a hashtag
/api/music/{id}/posts
Posts using a sound/music track
/api/location/{locationId}/posts
Posts tagged at a location
{id}
/
{username}
/
{name}
are path parameters. Optional query params (
cursor
,
region
) paginate or geo-scope results;
keyword
(search) and
url
(post lookup) are required where they appear.
端点返回内容
/api/post/search
匹配关键词的帖子;支持排序和日期范围筛选
/api/post
通过分享URL解析出的单条帖子
/api/post/{id}
通过ID查询的单条帖子
/api/post/{id}/comments
帖子的评论
/api/post/{id}/comments/{commentId}/replies
评论的回复
/api/user/handle/{username}
通过@用户名查询的个人主页信息
/api/user/{id}/posts
用户发布的帖子
/api/user/{id}/followers
用户的粉丝列表
/api/user/{id}/followings
用户关注的账号列表
/api/hashtag/handle/{name}
通过名称查询的话题标签元数据
/api/hashtag/{id}/posts
话题标签下的帖子
/api/music/{id}/posts
使用指定音效/音乐的帖子
/api/location/{locationId}/posts
标记了指定地点的帖子
{id}
/
{username}
/
{name}
为路径参数。可选查询参数(
cursor
region
)用于分页或地理范围筛选;
keyword
(搜索)和
url
(帖子查询)在对应场景下为必填参数。

Scenarios

使用场景

Most liked posts this month:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "keyword=ai agent" -G \
  --data-urlencode "sortType=MOST_LIKED" \
  --data-urlencode "dateRange=THIS_MONTH" \
  "https://tiktok.fetcher.sh/api/post/search"
Posted yesterday, most recent first:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "keyword=crypto payments" -G \
  --data-urlencode "sortType=DATE_POSTED" \
  --data-urlencode "dateRange=YESTERDAY" \
  "https://tiktok.fetcher.sh/api/post/search"
Other
sortType
values:
RELEVANCE
. Other
dateRange
values:
ALL_TIME
,
THIS_WEEK
,
LAST_THREE_MONTHS
,
LAST_SIX_MONTHS
.
Look up a post by its share URL, or directly by ID:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" -G \
  --data-urlencode "url=https://www.tiktok.com/@username/video/1234567890123456789" \
  "https://tiktok.fetcher.sh/api/post"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/post/1234567890123456789"
A post's comments and comment replies:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/post/1234567890123456789/comments"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/post/1234567890123456789/comments/9876543210/replies"
A profile by @handle, then its posts, followers, and followings:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/user/handle/khaby.lame"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/user/6935741396776976390/posts"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/user/6935741396776976390/followers"
A hashtag's metadata, then its posts:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/hashtag/handle/fyp"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/hashtag/1234567890/posts"
Posts using a specific sound, and posts from a location:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/music/1234567890123456789/posts"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/location/1234567890123456789/posts"
本月点赞量最高的帖子:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "keyword=ai agent" -G \
  --data-urlencode "sortType=MOST_LIKED" \
  --data-urlencode "dateRange=THIS_MONTH" \
  "https://tiktok.fetcher.sh/api/post/search"
昨天发布的帖子,按最新排序:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "keyword=crypto payments" -G \
  --data-urlencode "sortType=DATE_POSTED" \
  --data-urlencode "dateRange=YESTERDAY" \
  "https://tiktok.fetcher.sh/api/post/search"
其他
sortType
取值:
RELEVANCE
。其他
dateRange
取值:
ALL_TIME
THIS_WEEK
LAST_THREE_MONTHS
LAST_SIX_MONTHS
通过分享URL或直接通过ID查询帖子:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" -G \
  --data-urlencode "url=https://www.tiktok.com/@username/video/1234567890123456789" \
  "https://tiktok.fetcher.sh/api/post"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/post/1234567890123456789"
帖子的评论及评论回复:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/post/1234567890123456789/comments"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/post/1234567890123456789/comments/9876543210/replies"
通过@用户名查询个人主页,再获取其帖子、粉丝和关注列表:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/user/handle/khaby.lame"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/user/6935741396776976390/posts"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/user/6935741396776976390/followers"
话题标签的元数据,再获取其下的帖子:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/hashtag/handle/fyp"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/hashtag/1234567890/posts"
使用特定音效的帖子,以及指定地点的帖子:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/music/1234567890123456789/posts"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://tiktok.fetcher.sh/api/location/1234567890123456789/posts"

MCP

MCP

json
{
  "mcpServers": {
    "tiktok": {
      "url": "https://tiktok.fetcher.sh/mcp",
      "headers": { "Authorization": "Bearer bby_live_..." }
    }
  }
}
Free:
search_endpoints
,
describe_endpoint
,
check_balance
. Paid:
fetch_data
(any endpoint above),
topup_credits
, plus the named shortcut
tiktok_post_search
. Drop the
headers
block to pay per call with x402 instead — see the
fetcher
skill
for the full flow.
json
{
  "mcpServers": {
    "tiktok": {
      "url": "https://tiktok.fetcher.sh/mcp",
      "headers": { "Authorization": "Bearer bby_live_..." }
    }
  }
}
免费功能:
search_endpoints
describe_endpoint
check_balance
。付费功能:
fetch_data
(上述任意端点)、
topup_credits
,以及快捷命令
tiktok_post_search
。若要使用x402按调用付费,可移除
headers
块——完整流程详见
fetcher
技能文档

Errors

错误说明

  • 400
    — missing/invalid parameter (message names it)
  • 401
    — unknown or rotated key
  • 402
    — payment required (x402 challenge) or
    topup_required
    (credits exhausted)
  • 404
    — not a priced path
  • No rate limits; no refunds on upstream failures (settlement precedes delivery)
  • 400
    —— 参数缺失/无效(错误信息会指明具体参数)
  • 401
    —— 密钥未知或已过期
  • 402
    —— 需要付费(x402验证)或
    topup_required
    (额度耗尽)
  • 404
    —— 路径未定价
  • 无调用频率限制;上游服务失败时不予退款(结算先于数据交付)

Reference

参考资料