TikTok 视频 API
视频搜索、视频详情、评论与回复、用户搜索及广告详情查询
本模块提供 6 个 TikTok 数据接口,涵盖视频搜索、视频详情、评论、回复、用户搜索及广告详情查询。
搜索视频
根据关键词搜索相关视频,支持按发布时间、排序方式及地区进行筛选。
- 接口路径:
GET /tiktok/post/search
请求参数
| 参数名 | 位置 | 类型 | 是否必须 | 描述 |
|---|---|---|---|---|
keyword | Query | string | 是 | 搜索关键词。 |
count | Query | number | 否 | 每次返回的视频数量,默认为 10,最大值为 35。 |
cursor | Query | string | 否 | 分页游标,从上一次响应的 cursor 字段中获取。 |
publish_time | Query | number | 否 | 按发布时间筛选:0 全部(默认)、1 过去 24 小时、7 本周、30 本月、90 近 3 个月、180 近 6 个月。 |
sort_by | Query | number | 否 | 排序方式:0 相关性(默认)、1 点赞数、2 发布时间。 |
region | Query | string | 否 | 地区代码,例如 US、CN、JP。不传则返回全球结果。 |
请求示例
curl --request GET \
--url 'https://api.apimux.io/v1/tiktok/post/search?keyword=cat&count=10&publish_time=0&sort_by=0' \
--header 'Authorization: Bearer YOUR_API_KEY'响应示例
{
"code": 200,
"message": "success",
"data": {
"videos": [
{
"id": "7460937381265411370",
"title": "视频标题",
"region": "US",
"duration": 84,
"cover_url": "https://cdn.example.com/cover.jpg",
"play_url": "https://cdn.example.com/video.mp4",
"author": {
"id": "107955",
"username": "tiktok",
"nickname": "TikTok",
"avatar_url": "https://cdn.example.com/avatar.jpg"
},
"statistics": {
"likes": 15899443,
"comments": 377158,
"shares": 1315696,
"plays": 160897897
},
"create_time": 1737134867
}
],
"cursor": "1737134867000",
"has_more": true
}
}获取视频详情
根据视频完整 URL 获取该视频的详细信息,包括标题、封面、无水印播放地址、统计数据及作者信息。
- 接口路径:
GET /tiktok/post/detail
请求参数
| 参数名 | 位置 | 类型 | 是否必须 | 描述 |
|---|---|---|---|---|
url | Query | string | 是 | 目标 TikTok 视频的完整 URL,需进行 URL 编码。例如:https://www.tiktok.com/@tiktok/video/7460937381265411370。 |
请求示例
curl --request GET \
--url 'https://api.apimux.io/v1/tiktok/post/detail?url=https%3A%2F%2Fwww.tiktok.com%2F%40tiktok%2Fvideo%2F7460937381265411370' \
--header 'Authorization: Bearer YOUR_API_KEY'响应示例
{
"code": 200,
"message": "success",
"data": {
"id": "7460937381265411370",
"title": "Our response to the Supreme Court decision.",
"region": "US",
"duration": 84,
"cover_url": "https://cdn.example.com/cover.jpg",
"play_url": "https://cdn.example.com/video_nowatermark.mp4",
"hd_play_url": "https://cdn.example.com/video_hd.mp4",
"author": {
"id": "107955",
"username": "tiktok",
"nickname": "TikTok",
"avatar_url": "https://cdn.example.com/avatar.jpg"
},
"statistics": {
"likes": 15899443,
"comments": 377158,
"shares": 1315696,
"plays": 160897897,
"collects": 1100237
},
"music": {
"id": "7460937378165918510",
"title": "original sound - tiktok",
"author": "TikTok",
"play_url": "https://cdn.example.com/music.mp3",
"duration": 84
},
"create_time": 1737134867
}
}获取视频评论
获取指定视频下的评论列表,支持分页翻页。
- 接口路径:
GET /tiktok/post/comments
请求参数
| 参数名 | 位置 | 类型 | 是否必须 | 描述 |
|---|---|---|---|---|
url | Query | string | 是 | 目标 TikTok 视频的完整 URL,需进行 URL 编码。 |
count | Query | number | 否 | 每次返回的评论数量,最大值为 50。 |
cursor | Query | string | 否 | 分页游标,从上一次响应的 cursor 字段中获取。 |
请求示例
curl --request GET \
--url 'https://api.apimux.io/v1/tiktok/post/comments?url=https%3A%2F%2Fwww.tiktok.com%2F%40tiktok%2Fvideo%2F7460937381265411370&count=20' \
--header 'Authorization: Bearer YOUR_API_KEY'响应示例
{
"code": 200,
"message": "success",
"data": {
"comments": [
{
"comment_id": "7460951322251920150",
"text": "评论内容",
"likes": 1234,
"reply_count": 56,
"create_time": 1737140000,
"user": {
"id": "123456789",
"username": "user123",
"nickname": "用户昵称",
"avatar_url": "https://cdn.example.com/avatar.jpg"
}
}
],
"cursor": "1737140000000",
"has_more": true
}
}获取评论回复
获取指定评论下的回复列表,支持分页翻页。
- 接口路径:
GET /tiktok/post/comment_replies
请求参数
| 参数名 | 位置 | 类型 | 是否必须 | 描述 |
|---|---|---|---|---|
video_id | Query | string | 是 | 视频的唯一 ID(纯数字),可从视频 URL 或视频详情接口中获取。 |
comment_id | Query | string | 是 | 目标评论的唯一 ID,可从评论列表接口的响应中获取。 |
count | Query | number | 否 | 每次返回的回复数量,最大值为 50。 |
cursor | Query | string | 否 | 分页游标,从上一次响应的 cursor 字段中获取。 |
请求示例
curl --request GET \
--url 'https://api.apimux.io/v1/tiktok/post/comment_replies?video_id=7460937381265411370&comment_id=7460951322251920150&count=20' \
--header 'Authorization: Bearer YOUR_API_KEY'响应示例
{
"code": 200,
"message": "success",
"data": {
"replies": [
{
"reply_id": "7460960000000000001",
"text": "回复内容",
"likes": 89,
"create_time": 1737145000,
"user": {
"id": "987654321",
"username": "replier",
"nickname": "回复者昵称",
"avatar_url": "https://cdn.example.com/avatar2.jpg"
}
}
],
"cursor": "1737145000000",
"has_more": false
}
}搜索用户
根据关键词搜索 TikTok 用户,返回匹配的用户列表,支持分页。
- 接口路径:
GET /tiktok/user/search
请求参数
| 参数名 | 位置 | 类型 | 是否必须 | 描述 |
|---|---|---|---|---|
keyword | Query | string | 是 | 搜索关键词,可为用户名或昵称的部分内容。 |
count | Query | number | 否 | 每次返回的用户数量,默认为 10,最大值为 30。 |
cursor | Query | string | 否 | 分页游标,从上一次响应的 cursor 字段中获取。 |
请求示例
curl --request GET \
--url 'https://api.apimux.io/v1/tiktok/user/search?keyword=tiktok&count=10' \
--header 'Authorization: Bearer YOUR_API_KEY'响应示例
{
"code": 200,
"message": "success",
"data": {
"users": [
{
"id": "107955",
"username": "tiktok",
"nickname": "TikTok",
"avatar_url": "https://cdn.example.com/avatar.jpg",
"signature": "One TikTok can make a big impact",
"region": "US",
"verified": true,
"statistics": {
"followers": 91751744,
"following": 3,
"likes": 450108540,
"videos": 1362
}
}
],
"cursor": "10",
"has_more": true
}
}获取广告详情
根据 TikTok 广告创意中心的广告 URL,获取该广告的详细信息,包括视频内容、投放地区、行业分类及互动数据。
- 接口路径:
GET /tiktok/ads/detail
请求参数
| 参数名 | 位置 | 类型 | 是否必须 | 描述 |
|---|---|---|---|---|
url | Query | string | 是 | TikTok 广告创意中心的广告 URL,需进行 URL 编码。例如:https://ads.tiktok.com/business/creativecenter/topads/7221117041168252930/。 |
请求示例
curl --request GET \
--url 'https://api.apimux.io/v1/tiktok/ads/detail?url=https%3A%2F%2Fads.tiktok.com%2Fbusiness%2Fcreativecenter%2Ftopads%2F7221117041168252930%2F' \
--header 'Authorization: Bearer YOUR_API_KEY'响应示例
{
"code": 200,
"message": "success",
"data": {
"id": "7221117041168252930",
"brand_name": "Universidad de las Hespérides",
"title": "广告文案标题",
"landing_page": "https://example.com/landing",
"country_code": ["ES"],
"industry_key": "label_10102000000",
"objective_key": "campaign_objective_reach",
"duration": 15.039,
"statistics": {
"likes": 1297,
"comments": 2,
"shares": 3,
"ctr": 0.39,
"cost": 2
},
"video": {
"vid": "v10033g50000cgr8v3rc77uc24rq9kkg",
"cover_url": "https://cdn.example.com/ad_cover.jpg",
"play_url": "https://cdn.example.com/ad_video.mp4",
"width": 576,
"height": 1024,
"duration": 15.039
}
}
}
APIMUX文档