TikTok User Published Posts API (V1)
API health status
Healthy Available Limited Mostly unavailable No data
Loading health status...
Retrieves posts published by a TikTok user identified by secUid, with cursor pagination and latest or popular sorting. Use it to browse a creator's posting history or continue through their public post feed.
Parameters
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
token | query | string | Yes | - | Security token for API access. |
secUid | query | string | Yes | - | The opaque security ID returned for the TikTok user. |
cursor | query | string | No | 0 | Pagination cursor. Use '0' for the first page, then use the max_cursor value returned in the previous response. |
sort | query | string | No | LATEST | Sorting criteria for the user's posts. Available Values: - LATEST: Newest posts first (default)- MOST_POPULAR: Most popular posts first |
Code Samples
bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/tiktok/get-user-post/v1?token=YOUR_API_KEY&secUid=VALUE'text
I want to use the "User Published Posts (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/tiktok/get-user-post/v1?token=YOUR_API_KEY&secUid=VALUE
API Endpoint: BASE_URL + /api/tiktok/get-user-post/v1?token=YOUR_API_KEY&secUid=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/tiktok/user-published-posts-v1-en.json
Parameters:
- token (query): Security token for API access. (Required)
- secUid (query): The opaque security ID returned for the TikTok user. (Required)
- cursor (query): Pagination cursor. Use '0' for the first page, then use the max_cursor value returned in the previous response.
- sort (query): Sorting criteria for the user's posts.
Available Values:
- `LATEST`: Newest posts first (default)
- `MOST_POPULAR`: Most popular posts first
Return format: safely handle JSON or text according to the actual Content-Type.
Response Handling & Error Codes:
1. Business results should be determined by the "code" field in the response body (code 0 means success).
2. Timeout Recommendation: Set the request timeout to 120 seconds. If 120 seconds is too long for your use case, use at least 60 seconds, but a small number of requests may time out before receiving a result.
3. Business Code Reference:
- 0: Success
- 100: Invalid or Inactive Token
- 301: Collection Failed. Please Retry.
- 302: Rate Limit Exceeded
- 303: Daily Quota Exceeded
- 400: Invalid Parameters
- 500: Internal Server Error
- 600: Permission Denied
- 601: Insufficient Balance
- 602: Token Budget Exceeded
4. Code 601 means the shared account balance is insufficient. Code 602 means the current API token's own cumulative budget limit has been reached. Token budget limits do not transfer funds out of the shared account balance.
Please help me write a script in my preferred programming language to call this API and handle the response.python
import requests
BASE_URL = "https://api.justoneapi.com" # Provided by OpenAPI servers
url = BASE_URL + "/api/tiktok/get-user-post/v1?token=YOUR_API_KEY&secUid=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
content_type = response.headers.get("content-type", "").lower()
if "json" in content_type:
try:
print(response.json())
except ValueError:
print(response.text)
elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
print(response.text)
else:
with open("response.bin", "wb") as output:
output.write(response.content)
print(f"Saved {len(response.content)} bytes to response.bin")js
const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/tiktok/get-user-post/v1?token=YOUR_API_KEY&secUid=VALUE";
const response = await fetch(url, {
method: "GET",
signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
const contentType = (response.headers.get("content-type") || "").toLowerCase();
const mediaType = contentType.split(";", 1)[0].trim();
const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
if (textual) {
const responseText = new TextDecoder().decode(responseBytes);
let data = responseText;
if (contentType.includes("json")) {
try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
}
console.log(data);
} else {
console.log(`Received ${responseBytes.byteLength} binary bytes`);
}
}java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
public class Main {
public static void main(String[] args) throws Exception {
final String BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
final String url = BASE_URL + "/api/tiktok/get-user-post/v1?token=YOUR_API_KEY&secUid=VALUE";
HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
HttpRequest.Builder builder = HttpRequest.newBuilder()
.uri(URI.create(url))
.timeout(Duration.ofSeconds(120))
.method("GET", HttpRequest.BodyPublishers.noBody());
HttpRequest request = builder.build();
HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
System.out.println(response.statusCode());
String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
String mediaType = contentType.split(";", 2)[0].trim();
if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
System.out.println(new String(response.body(), StandardCharsets.UTF_8));
} else {
Files.write(Path.of("response.bin"), response.body());
System.out.println("Saved " + response.body().length + " bytes to response.bin");
}
}
}go
package main
import (
"fmt"
"io"
"os"
"strings"
"net/http"
"time"
)
const BASE_URL = "https://api.justoneapi.com" // Provided by OpenAPI servers
func main() {
client := &http.Client{Timeout: 120 * time.Second}
url := BASE_URL + "/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()
fmt.Println(resp.StatusCode)
bodyBytes, _ := io.ReadAll(resp.Body)
contentType := strings.ToLower(resp.Header.Get("Content-Type"))
mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
fmt.Println(string(bodyBytes))
} else {
os.WriteFile("response.bin", bodyBytes, 0600)
fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
}
}php
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/tiktok/get-user-post/v1?token=YOUR_API_KEY&secUid=VALUE';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
echo $response;
} else {
file_put_contents('response.bin', $response);
echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}Response Fields
Key fields in a successful response (code = 0).
Post overview7 fields
data.aweme_list[]
Posts returned for this page. The same posts can appear under LATEST and MOST_POPULAR.
| Field | Type | Description |
|---|---|---|
aweme_id | string | TikTok post ID returned as text. |
desc | string | Caption text attached to the post. |
create_time | integer | Post creation time as a Unix timestamp in seconds. |
desc_language | string | Language label reported for the caption. |
aweme_type | integer | Numeric post type reported by TikTok. |
is_top | integer | Numeric pin flag reported for the post, where 1 indicates a pinned post. |
is_ads | boolean | Whether TikTok flags the post as an advertisement. |
Author and collaborators18 fields
data.aweme_list[]
| Field | Type | Description |
|---|---|---|
author_user_id | integer | Author ID returned as an integer. It can exceed the JavaScript safe integer limit. Use the text in author.uid for an exact ID. |
author | object | Public profile summary of the post author. |
author.uid | string | TikTok author ID as text. Use this field to preserve the exact ID in JavaScript. |
author.nickname | string | Profile display name of the post author. |
author.unique_id | string | Public TikTok username of the post author. |
author.follower_count | integer | Follower count reported for the post author. |
author.following_count | integer | Number of accounts the author follows, as reported by TikTok. |
author.aweme_count | integer | Number of posts reported for the author account. |
author.total_favorited | integer | Total likes received by the author as reported in the profile summary. |
author.custom_verify | string | Profile verification text returned for the author when present. |
author.enterprise_verify_reason | string | Enterprise verification text returned for the author when present. |
collab_info | object | Collaboration information when returned. |
collab_info.collaborators | array | Collaborator profiles listed for the post. |
collab_info.collaborators[] | object | One collaborator record. |
collab_info.collaborators[].user_info | object | Public profile summary of this collaborator. |
collab_info.collaborators[].user_info.uid | string | TikTok collaborator ID as text. |
collab_info.collaborators[].user_info.nickname | string | Display name of the collaborator. |
collab_info.collaborators[].user_info.unique_id | string | Public TikTok username of the collaborator. |
Engagement and availability16 fields
data.aweme_list[]
| Field | Type | Description |
|---|---|---|
prevent_download | boolean | Whether TikTok flags downloading the post as restricted. |
statistics | object | Engagement counts reported for this post. |
statistics.aweme_id | string | Post ID associated with this statistics object. |
statistics.play_count | integer | Reported play count for the post. |
statistics.digg_count | integer | Reported like count for the post. |
statistics.comment_count | integer | Reported comment count for the post. |
statistics.share_count | integer | Reported share count for the post. |
statistics.collect_count | integer | Reported bookmark count for the post. |
statistics.download_count | integer | Reported download count for the post. |
statistics.repost_count | integer | Reported TikTok repost count for the post. |
statistics.whatsapp_share_count | integer | Reported count of shares through WhatsApp. |
status | object | Availability flags reported for this post. |
status.aweme_id | string | Post ID associated with these status fields. |
status.allow_share | boolean | Whether the post status indicates sharing is allowed. |
status.allow_comment | boolean | Whether the post status indicates commenting is allowed. |
status.is_delete | boolean | Whether TikTok marks the post as deleted. |
Video15 fields
data.aweme_list[]
| Field | Type | Description |
|---|---|---|
video | object | Video metadata. Image posts can also carry this object. |
video.duration | integer | Video duration in milliseconds. Image posts can carry a video placeholder with duration 0. |
video.width | integer | Video width in pixels. |
video.height | integer | Video height in pixels. |
video.ratio | string | Video resolution label reported by TikTok. |
video.play_addr | object | Playback asset metadata. |
video.play_addr.data_size | integer | Reported playback asset size in bytes. |
video.bit_rate | array | Available video renditions. The array can be empty. |
video.bit_rate[] | object | One reported video rendition. |
video.bit_rate[].gear_name | string | Rendition label reported by TikTok. |
video.bit_rate[].quality_type | integer | Numeric quality code of the rendition. |
video.bit_rate[].bit_rate | integer | Bitrate in bits per second for this rendition. |
video.bit_rate[].fps | integer | Frame rate in frames per second for this rendition. |
video.bit_rate[].play_addr | object | Playback asset metadata. |
video.bit_rate[].play_addr.data_size | integer | Reported playback asset size in bytes. |
Image posts29 fields
data.aweme_list[]
| Field | Type | Description |
|---|---|---|
image_post_info | object | Image-post metadata when returned. A populated images gallery identifies an image post. |
image_post_info.title | string | Title of the image post. |
image_post_info.images | array | Images included in the post gallery. |
image_post_info.images[] | object | One image in the gallery. |
image_post_info.images[].display_image | object | Display rendition dimensions. |
image_post_info.images[].display_image.width | integer | Image width in pixels. |
image_post_info.images[].display_image.height | integer | Image height in pixels. |
image_post_info.images[].thumbnail | object | Thumbnail rendition dimensions. |
image_post_info.images[].thumbnail.width | integer | Image width in pixels. |
image_post_info.images[].thumbnail.height | integer | Image height in pixels. |
image_post_info.images[].owner_watermark_image | object | Dimensions of the creator-watermarked rendition. |
image_post_info.images[].owner_watermark_image.width | integer | Image width in pixels. |
image_post_info.images[].owner_watermark_image.height | integer | Image height in pixels. |
image_post_info.images[].user_watermark_image | object | Dimensions of the user-watermarked rendition. |
image_post_info.images[].user_watermark_image.width | integer | Image width in pixels. |
image_post_info.images[].user_watermark_image.height | integer | Image height in pixels. |
image_post_info.image_post_cover | object | Image-post cover and its rendition dimensions. |
image_post_info.image_post_cover.display_image | object | Display rendition dimensions. |
image_post_info.image_post_cover.display_image.width | integer | Image width in pixels. |
image_post_info.image_post_cover.display_image.height | integer | Image height in pixels. |
image_post_info.image_post_cover.thumbnail | object | Thumbnail rendition dimensions. |
image_post_info.image_post_cover.thumbnail.width | integer | Image width in pixels. |
image_post_info.image_post_cover.thumbnail.height | integer | Image height in pixels. |
image_post_info.image_post_cover.owner_watermark_image | object | Dimensions of the creator-watermarked rendition. |
image_post_info.image_post_cover.owner_watermark_image.width | integer | Image width in pixels. |
image_post_info.image_post_cover.owner_watermark_image.height | integer | Image height in pixels. |
image_post_info.image_post_cover.user_watermark_image | object | Dimensions of the user-watermarked rendition. |
image_post_info.image_post_cover.user_watermark_image.width | integer | Image width in pixels. |
image_post_info.image_post_cover.user_watermark_image.height | integer | Image height in pixels. |
Sounds10 fields
data.aweme_list[]
| Field | Type | Description |
|---|---|---|
music | object | Sound metadata when included with the post. |
music.id_str | string | TikTok sound ID as text. |
music.title | string | Name of the attached sound. |
music.author | string | Artist or creator credit displayed for the sound. |
music.album | string | Album label displayed for the sound when available. |
music.duration | integer | Duration value reported by TikTok for the sound. |
music.is_original_sound | boolean | Whether TikTok labels the sound as original audio. |
music.is_commerce_music | boolean | Commercial-music flag for the sound as reported by TikTok. |
music_begin_time_in_ms | integer | Start offset reported for the sound used in the post, in milliseconds. |
music_end_time_in_ms | integer | End offset reported for the sound used in the post, in milliseconds. |
Hashtags and caption annotations14 fields
data.aweme_list[]
| Field | Type | Description |
|---|---|---|
cha_list | array | null | Hashtags and challenges associated with the post when available. The value can be null. |
cha_list[] | object | One reported hashtag or challenge. |
cha_list[].cid | string | TikTok hashtag or challenge ID. |
cha_list[].cha_name | string | Display name of the hashtag or challenge. |
cha_list[].desc | string | Description returned for the hashtag or challenge. |
cha_list[].view_count | integer | Reported view count for the hashtag or challenge. |
cha_list[].use_count | integer | Reported usage count for the hashtag or challenge. |
text_extra | array | Annotations attached to the post caption. |
text_extra[] | object | One caption annotation. |
text_extra[].start | integer | Start offset of the annotation reported for the caption. Observed hashtag offsets use UTF-16 code units. |
text_extra[].end | integer | End offset of the annotation reported for the caption. Observed hashtag offsets use UTF-16 code units. |
text_extra[].type | integer | Numeric annotation type reported by TikTok. |
text_extra[].hashtag_name | string | Hashtag name when this annotation identifies a hashtag. |
text_extra[].hashtag_id | string | Hashtag ID when this annotation identifies a hashtag. |
Pagination and status5 fields
data
| Field | Type | Description |
|---|---|---|
status_code | integer | TikTok status code for this result. The outer code is the JustOneAPI business code. |
status_msg | string | Status message returned by TikTok. |
min_cursor | integer | Additional page boundary cursor reported by TikTok. |
max_cursor | integer | Cursor for the next page. When has_more is 1, pass this exact value as decimal text to cursor for the same user and sort. |
has_more | integer | Pagination flag reported by TikTok. Value 1 indicates another page and 0 indicates the end. |
Response Example
Loading the response example...