TikTok API - 用户已发布帖子 (V1)
获取指定 TikTok 用户发布的帖子列表。 该接口返回每个帖子的详细信息,包括视频 ID、描述、发布时间、 统计数据(点赞、评论、分享、观看次数)以及可用的视频下载 URL。
典型使用场景:
- 用户活动分析和发帖频率追踪。
- 网红表现评估。
- 特定创作者的内容趋势监控。
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
token | query | string | 是 | 用于API访问的安全令牌。 |
secUid | query | string | 是 | TikTok用户的唯一安全ID(例如:MS4wLjABAAAAonP2...)。 |
cursor | query | string | 否 | 分页游标。首次请求使用 '0',后续请求使用前一次响应返回的 'cursor' 值。 |
sort | query | string | 否 | 用户帖子的排序标准。 可用值: - _0:默认(混合)- _1:最高点赞数- _2:最新发布 |
代码示例
💡 环境说明
默认示例使用 https://api.justoneapi.com (prod-global)。中国大陆地区建议替换为 http://47.117.133.51:30015 (prod-cn) 以获得更好的访问体验。详见 环境选择。
bash
# 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
curl -X GET "https://api.justoneapi.com/api/tiktok/get-user-post/v1?token=YOUR_API_KEY&secUid=VALUE"text
我想使用 Just One API 提供的“用户已发布帖子 (V1)”接口。
接口地址: https://api.justoneapi.com/api/tiktok/get-user-post/v1
HTTP 方法: GET
身份验证: 在 URL 后添加查询参数“?token=您的API密钥”。
OpenAPI 定义: https://docs.justoneapi.com/openapi/tiktok-apis/user-published-posts-v1-zh.json
请求参数说明:
- token (query): 用于API访问的安全令牌。 (必填)
- secUid (query): TikTok用户的唯一安全ID(例如:MS4wLjABAAAAonP2...)。 (必填)
- cursor (query): 分页游标。首次请求使用 '0',后续请求使用前一次响应返回的 'cursor' 值。
- sort (query): 用户帖子的排序标准。
可用值:
- `_0`:默认(混合)
- `_1`:最高点赞数
- `_2`:最新发布
返回格式: JSON
响应处理与错误码:
1. 需通过返回体中的 "code" 字段判断业务结果(code 为 0 表示成功)。
2. 超时建议:建议将请求超时时间设置为至少 60 秒。
3. 业务码说明:
- 0: 成功
- 100: Token 无效或已失效
- 301: 采集失败,请重试
- 302: 超出速率限制
- 303: 超出每日配额
- 400: 参数错误
- 500: 内部服务器错误
- 600: 权限不足
- 601: 余额不足
请帮我用我擅长的编程语言写一个脚本来调用这个接口,并处理返回结果。python
# 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
import requests
url = "https://api.justoneapi.com/api/tiktok/get-user-post/v1?token=YOUR_API_KEY&secUid=VALUE"
response = requests.get(url)
print(response.json())js
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
const response = await fetch("https://api.justoneapi.com/api/tiktok/get-user-post/v1?token=YOUR_API_KEY&secUid=VALUE", {
method: "GET"
});
const data = await response.json();
console.log(data);java
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.justoneapi.com/api/tiktok/get-user-post/v1?token=YOUR_API_KEY&secUid=VALUE"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}go
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
client := &http.Client{}
url := "https://api.justoneapi.com/api/tiktok/get-user-post/v1?token=YOUR_API_KEY&secUid=VALUE"
req, _ := http.NewRequest("GET", url, nil)
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}php
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.justoneapi.com/api/tiktok/get-user-post/v1?token=YOUR_API_KEY&secUid=VALUE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
curl_close($ch);
echo $response;响应结果
json
{
"code": 0,
"data": {
"cursor": "1771536804564",
"extra": {
"fatal_item_ids": [],
"logid": "202603091400022B6EC42B2525EFA09EAD",
"now": 1773064802000
},
"hasMore": true,
"itemList": [
{
"AIGCDescription": "",
"CategoryType": 101,
"IsHDBitrate": false,
"author": {
"UserStoryStatus": 0,
"avatarLarger": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/ba67b11de451691939223e9d978e613a~tp...",
"avatarMedium": "https://p16-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/ba67b11de451691939223e9d978e613a~tp...",
"avatarThumb": "https://p16-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/ba67b11de451691939223e9d978e613a~tp...",
"commentSetting": 0,
"downloadSetting": 0,
"duetSetting": 0,
"ftc": false,
"id": "107955",
"isADVirtual": false,
"isEmbedBanned": false,
"nickname": "TikTok",
"openFavorite": false,
"privateAccount": false,
"relation": 0,
"secUid": "MS4wLjABAAAAv7iSuuXDJGDvJkmH_vz1qkDZYo1apxgzaxdBSeIuPiM",
"secret": false,
"signature": "One TikTok can make a big impact",
"stitchSetting": 0,
"uniqueId": "tiktok",
"verified": true
},
"authorStats": {
"diggCount": 3549,
"followerCount": 93200000,
"followingCount": 3,
"friendCount": 0,
"heart": 455100000,
"heartCount": 455100000,
"videoCount": 1412
},
"authorStatsV2": {
"diggCount": "3549",
"followerCount": "93200000",
"followingCount": "3",
"friendCount": "0",
"heart": "455100000",
"heartCount": "455100000",
"videoCount": "1412"
},
"backendSourceEventTracking": "",
"challenges": [
{
"coverLarger": "https://p16-common-sign.tiktokcdn-us.com/tiktok-obj/1c879ff9cc10ea2d4a0e5d5445038a4d.png~tplv-tiktok...",
"coverMedium": "https://p16-common-sign.tiktokcdn-us.com/tiktok-obj/1c879ff9cc10ea2d4a0e5d5445038a4d.png~tplv-tiktok...",
"coverThumb": "https://p16-common-sign.tiktokcdn-us.com/tiktok-obj/1c879ff9cc10ea2d4a0e5d5445038a4d.png~tplv-tiktok...",
"desc": "Celebrate the world of cinema with TikTok.",
"id": "1639367069624326",
"profileLarger": "https://p16-common-sign.tiktokcdn-us.com/tiktok-obj/c3b1288cc72c5db38930421dbef58901.png~tplv-tiktok...",
"profileMedium": "https://p16-common-sign.tiktokcdn-us.com/tiktok-obj/c3b1288cc72c5db38930421dbef58901.png~tplv-tiktok...",
"profileThumb": "https://p16-common-sign.tiktokcdn-us.com/tiktok-obj/c3b1288cc72c5db38930421dbef58901.png~tplv-tiktok...",
"title": "filmtok"
}
],
"collected": false,
"contents": [
{
"desc": "#filmtok LOCK IN, we caught up with your faves at the Actor Awards 🎞️ ✨ @Cinema.Joe @The Actor Award...",
"textExtra": [
{
"awemeId": "",
"end": 8,
"hashtagName": "filmtok",
"isCommerce": false,
"start": 0,
"subType": 0,
"type": 1
}
]
}
],
"createTime": 1772841228,
"creatorAIComment": {
"eligibleVideo": false,
"hasAITopic": false,
"notEligibleReason": 101
},
"desc": "#filmtok LOCK IN, we caught up with your faves at the Actor Awards 🎞️ ✨ @Cinema.Joe @The Actor Award...",
"digged": false,
"diversificationId": 10049,
"duetDisplay": 0,
"duetEnabled": true,
"event": {
"event_id": "7613931554804334648",
"event_start_time": 1773277200,
"has_subscribed": false,
"title": "In The Mix, Stephen Sanchez"
},
"forFriend": false,
"id": "7614295022346784030",
"isAd": false,
"isReviewing": false,
"itemCommentStatus": 0,
"item_control": {
"can_repost": true
},
"music": {
"authorName": "TikTok",
"coverLarge": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/ba67b11de451691939223e9d978e613a~tp...",
"coverMedium": "https://p16-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/ba67b11de451691939223e9d978e613a~tp...",
"coverThumb": "https://p16-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/ba67b11de451691939223e9d978e613a~tp...",
"duration": 88,
"id": "7614294986238020383",
"isCopyrighted": false,
"is_commerce_music": true,
"is_unlimited_music": false,
"original": true,
"playUrl": "https://v16m.tiktokcdn-us.com/897820b8d6897ce6d9c65887dbef5a59/69af271a/video/tos/useast8/tos-useast...",
"private": false,
"shoot_duration": 88,
"title": "original sound",
"tt2dsp": {}
},
"officalItem": false,
"originalItem": false,
"privateItem": false,
"secret": false,
"shareEnabled": true,
"stats": {
"collectCount": 590,
"commentCount": 4108,
"diggCount": 5037,
"playCount": 229000,
"shareCount": 632
},
"statsV2": {
"collectCount": "590",
"commentCount": "4108",
"diggCount": "5037",
"playCount": "229000",
"repostCount": "0",
"shareCount": "632"
},
"stitchDisplay": 0,
"stitchEnabled": true,
"textExtra": [
{
"awemeId": "",
"end": 8,
"hashtagName": "filmtok",
"isCommerce": false,
"start": 0,
"subType": 0,
"type": 1
}
],
"textLanguage": "en",
"textTranslatable": true,
"video": {
"PlayAddrStruct": {
"DataSize": 15043441,
"FileCs": "c:0-74172-0daf",
"FileHash": "383f9f494b519c01a18f6716820149a6",
"Height": 1280,
"Uri": "v15044gf0000d6lmgvfog65hiupqen0g",
"UrlKey": "v15044gf0000d6lmgvfog65hiupqen0g_h264_720p_1356272",
"UrlList": [
"https://v16-webapp-prime.us.tiktok.com/video/tos/useast8/tos-useast8-pve-0068-tx2/o8aEJiBBAXOBOhnifW..."
],
"Width": 720
},
"VQScore": "73.67",
"bitrate": 1356272,
"bitrateInfo": [
{
"Bitrate": 1356272,
"BitrateFPS": 30,
"CodecType": "h264",
"Format": "mp4",
"GearName": "normal_720_0",
"MVMAF": "{\"v2.0\": {\"srv1\": {\"v1080\": 84.516, \"v960\": 88.089, \"v864\": 89.131, \"v720\": 92.807}, \"ori\": {\"v1080\"...",
"PlayAddr": {
"DataSize": 15043441,
"FileCs": "c:0-74172-0daf",
"FileHash": "383f9f494b519c01a18f6716820149a6",
"Height": 1280,
"Uri": "v15044gf0000d6lmgvfog65hiupqen0g",
"UrlKey": "v15044gf0000d6lmgvfog65hiupqen0g_h264_720p_1356272",
"UrlList": [
"https://v16-webapp-prime.us.tiktok.com/video/tos/useast8/tos-useast8-pve-0068-tx2/o8aEJiBBAXOBOhnifW..."
],
"Width": 720
},
"QualityType": 10,
"VideoExtra": "{\"PktOffsetMap\":\"[{\\\"time\\\": 1, \\\"offset\\\": 292579}, {\\\"time\\\": 2, \\\"offset\\\": 480372}, {\\\"time\\\": 3..."
}
],
"claInfo": {
"enableAutoCaption": true,
"hasOriginalAudio": true,
"noCaptionReason": 1
},
"codecType": "h264",
"cover": "https://p16-common-sign.tiktokcdn-us.com/tos-useast8-p-0068-tx2/o8YrF1A1fAEu7SCGABI08QBZaiiKiCAgGbAI...",
"definition": "720p",
"downloadAddr": "https://v16-webapp-prime.us.tiktok.com/video/tos/useast8/tos-useast8-ve-0068c003-tx2/oYII5RBpPqrahin...",
"duration": 88,
"dynamicCover": "https://p16-common-sign.tiktokcdn-us.com/tos-useast8-p-0068-tx2/o8YrF1A1fAEu7SCGABI08QBZaiiKiCAgGbAI...",
"encodeUserTag": "",
"encodedType": "normal",
"format": "mp4",
"height": 1280,
"id": "7614295022346784030",
"originCover": "https://p16-common-sign.tiktokcdn-us.com/tos-useast8-p-0068-tx2/owUOQCFn72V9buRrECDAQhqjRLpAaBeES2Ed...",
"playAddr": "https://v16-webapp-prime.us.tiktok.com/video/tos/useast8/tos-useast8-pve-0068-tx2/o8aEJiBBAXOBOhnifW...",
"ratio": "720p",
"size": 15043441,
"subtitleInfos": [
{
"Format": "webvtt",
"LanguageCodeName": "ben-BD",
"LanguageID": "12",
"Size": 6494,
"Source": "MT",
"Url": "https://v16m-webapp.tiktokcdn-us.com/51be5ae2fe59c98ced62a25d97206268/69b175ba/video/tos/useast8/tos...",
"UrlExpire": 1773237690,
"Version": "4"
}
],
"videoID": "v15044gf0000d6lmgvfog65hiupqen0g",
"videoQuality": "normal",
"volumeInfo": {
"Loudness": -24.9,
"Peak": 0.51286
},
"width": 720,
"zoomCover": {
"240": "https://p16-common-sign.tiktokcdn-us.com/tos-useast8-p-0068-tx2/o8YrF1A1fAEu7SCGABI08QBZaiiKiCAgGbAI...",
"480": "https://p19-common-sign.tiktokcdn-us.com/tos-useast8-p-0068-tx2/o8YrF1A1fAEu7SCGABI08QBZaiiKiCAgGbAI...",
"720": "https://p16-common-sign.tiktokcdn-us.com/tos-useast8-p-0068-tx2/o8YrF1A1fAEu7SCGABI08QBZaiiKiCAgGbAI...",
"960": "https://p16-common-sign.tiktokcdn-us.com/tos-useast8-p-0068-tx2/o8YrF1A1fAEu7SCGABI08QBZaiiKiCAgGbAI..."
}
}
}
],
"log_pb": {
"impr_id": "202603091400022B6EC42B2525EFA09EAD"
},
"statusCode": 0,
"status_code": 0,
"status_msg": "",
"tt_chain_token": "PXsf54jqn0QwRtD61TMjFw==",
"cookie": "tt_chain_token=PXsf54jqn0QwRtD61TMjFw==;"
}
}💡 提示:为简化展示,列表类数据样例仅保留 1-2 条记录,实际返回条数以接口响应为准。
