TikTok Post Details API (V1)
Retrieves details for a TikTok post identified by its post ID. Use it to look up a known TikTok video before content review, reporting, or related engagement analysis.
Parameters
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
token | query | string | Yes | - | Security token for API access. |
postId | query | string | Yes | - | The unique ID of the TikTok post. |
Code Samples
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/tiktok/get-post-detail/v1?token=YOUR_API_KEY&postId=VALUE'I want to use the "Post Details (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/tiktok/get-post-detail/v1?token=YOUR_API_KEY&postId=VALUE
API Endpoint: BASE_URL + /api/tiktok/get-post-detail/v1?token=YOUR_API_KEY&postId=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/tiktok/post-details-v1-en.json
Parameters:
- token (query): Security token for API access. (Required)
- postId (query): The unique ID of the TikTok post. (Required)
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.import requests
BASE_URL = "https://api.justoneapi.com" # Provided by OpenAPI servers
url = BASE_URL + "/api/tiktok/get-post-detail/v1?token=YOUR_API_KEY&postId=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")const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/tiktok/get-post-detail/v1?token=YOUR_API_KEY&postId=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`);
}
}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-post-detail/v1?token=YOUR_API_KEY&postId=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");
}
}
}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-post-detail/v1?token=YOUR_API_KEY&postId=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
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/tiktok/get-post-detail/v1?token=YOUR_API_KEY&postId=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 details6 fields
data.itemInfo.itemStruct
TikTok details for the requested post, when returned.
| Field | Type | Description |
|---|---|---|
id | string | TikTok post identifier. |
desc | string | Caption of the TikTok post. |
createTime | integer | Post creation time as Unix epoch seconds. |
textLanguage | string | Reported language code for the post text. |
textTranslatable | boolean | Whether TikTok marks the post text as translatable. |
playlistId | string | TikTok playlist identifier associated with the post, when returned. |
Lookup status and sharing7 fields
data
TikTok post detail and its reported status. A success response can have status fields without item details.
| Field | Type | Description |
|---|---|---|
statusCode | integer | TikTok post lookup status code. One status-only response reported a nonzero value. |
status_code | integer | Additional TikTok status field. It was 0 in a verified response with no item details. |
status_msg | string | Status message reported for the post lookup. It can be an empty string. |
itemInfo | object | Post information envelope, when present. |
shareMeta | object | Text metadata used when the post is shared. |
shareMeta.title | string | Display title used for sharing the post. |
shareMeta.desc | string | Display description used for sharing the post. |
Author10 fields
data.itemInfo.itemStruct
| Field | Type | Description |
|---|---|---|
author | object | TikTok account information for the post author. |
author.id | string | TikTok author ID. |
author.secUid | string | Secondary TikTok user identifier. |
author.uniqueId | string | Public username of the TikTok user. |
author.nickname | string | Display name of the TikTok user. |
author.verified | boolean | Whether the author is marked as verified. |
author.privateAccount | boolean | Whether TikTok marks the author account as private. |
author.avatarThumb | string | Thumbnail avatar URL for the author. |
author.avatarMedium | string | Medium-size avatar URL for the author. |
author.avatarLarger | string | Larger avatar URL for the author. |
Author metrics14 fields
data.itemInfo.itemStruct
| Field | Type | Description |
|---|---|---|
authorStats | object | Author metrics returned as integers. |
authorStats.followerCount | integer | Author follower count. |
authorStats.followingCount | integer | Author following count. |
authorStats.videoCount | integer | Author video count. |
authorStats.heartCount | integer | Reported total likes received by the author. |
authorStats.heart | integer | Additional author likes count reported in heart. |
authorStats.diggCount | integer | Author digg count reported by TikTok. |
authorStatsV2 | object | Author metrics returned as decimal strings. |
authorStatsV2.followerCount | string | Author follower count as decimal text. |
authorStatsV2.followingCount | string | Author following count as decimal text. |
authorStatsV2.videoCount | string | Author video count as decimal text. |
authorStatsV2.heartCount | string | Reported total likes received by the author as decimal text. |
authorStatsV2.heart | string | Additional author likes count reported in heart as decimal text. |
authorStatsV2.diggCount | string | Author digg count reported by TikTok as decimal text. |
Engagement13 fields
data.itemInfo.itemStruct
| Field | Type | Description |
|---|---|---|
stats | object | Post metrics returned as integers. |
stats.playCount | integer | Reported post play count. |
stats.diggCount | integer | Reported number of likes on the post. |
stats.commentCount | integer | Reported number of comments on the post. |
stats.shareCount | integer | Reported number of shares on the post. |
stats.collectCount | integer | Reported number of times the post was saved. |
statsV2 | object | Post metrics returned as decimal strings. |
statsV2.playCount | string | Reported post play count as decimal text. |
statsV2.diggCount | string | Reported number of likes on the post as decimal text. |
statsV2.commentCount | string | Reported number of comments on the post as decimal text. |
statsV2.shareCount | string | Reported number of shares on the post as decimal text. |
statsV2.collectCount | string | Reported number of times the post was saved as decimal text. |
statsV2.repostCount | string | Reported number of reposts of the post as decimal text. |
Caption and topics31 fields
data.itemInfo.itemStruct
| Field | Type | Description |
|---|---|---|
textExtra | array | Annotations for the main post caption. |
textExtra[] | object | One annotation attached to a portion of post text. |
textExtra[].start | integer | Starting offset in UTF-16 code units within the associated text. |
textExtra[].end | integer | Exclusive ending offset in UTF-16 code units within the associated text. |
textExtra[].hashtagId | string | TikTok identifier of the annotated hashtag. |
textExtra[].hashtagName | string | Display name of the annotated hashtag. |
textExtra[].type | integer | Numeric type reported for this text annotation. |
textExtra[].subType | integer | Numeric subtype reported for this text annotation. |
textExtra[].awemeId | string | TikTok post ID associated with this annotation, when supplied. |
textExtra[].isCommerce | boolean | Whether the text annotation is marked as commerce-related. |
contents | array | Structured content sections returned for the post. |
contents[] | object | One structured content section of the post. |
contents[].desc | string | Caption text supplied for this content section. |
contents[].textExtra | array | Annotations for the text of this content section. |
contents[].textExtra[] | object | One annotation attached to a portion of post text. |
contents[].textExtra[].start | integer | Starting offset in UTF-16 code units within the associated text. |
contents[].textExtra[].end | integer | Exclusive ending offset in UTF-16 code units within the associated text. |
contents[].textExtra[].hashtagId | string | TikTok identifier of the annotated hashtag. |
contents[].textExtra[].hashtagName | string | Display name of the annotated hashtag. |
contents[].textExtra[].type | integer | Numeric type reported for this text annotation. |
contents[].textExtra[].subType | integer | Numeric subtype reported for this text annotation. |
contents[].textExtra[].awemeId | string | TikTok post ID associated with this annotation, when supplied. |
contents[].textExtra[].isCommerce | boolean | Whether the text annotation is marked as commerce-related. |
challenges | array | Topics or challenges associated with the post. |
challenges[] | object | One TikTok topic or challenge attached to the post. |
challenges[].id | string | TikTok identifier of the topic. |
challenges[].title | string | Display title of the topic. |
challenges[].desc | string | Display description of the topic. |
challenges[].coverThumb | string | Thumbnail cover URL for this topic. |
challenges[].coverMedium | string | Medium-size cover URL for this topic. |
challenges[].coverLarger | string | Larger cover URL for this topic. |
Video and covers18 fields
data.itemInfo.itemStruct.video
Video media, covers, playback files, and captions for the post.
| Field | Type | Description |
|---|---|---|
id | string | Video identifier reported in the media object. |
videoID | string | Additional video identifier carried by the media object. |
duration | integer | Duration of the video in seconds. |
width | integer | Video frame width in pixels. |
height | integer | Video frame height in pixels. |
ratio | string | Video ratio or resolution label as returned by TikTok. |
definition | string | Display definition label for the video. |
format | string | File format reported for the video. |
codecType | string | Video codec label reported for the media. |
size | integer | Reported size of the video file. |
bitrate | integer | Reported video bitrate. |
cover | string | Video cover image URL. |
dynamicCover | string | Animated cover image URL, when available. |
originCover | string | Original cover image URL reported for the video. |
zoomCover | object | Resized cover images keyed by their reported size labels. |
zoomCover.{key} | string | Cover image URL for the selected size label. |
playAddr | string | Direct playback URL returned for the video. |
downloadAddr | string | Download URL reported for the video, when provided. |
Playback formats22 fields
data.itemInfo.itemStruct.video
| Field | Type | Description |
|---|---|---|
PlayAddrStruct | object | Playback file details and alternate URLs. |
PlayAddrStruct.Uri | string | Media reference for the playback file. |
PlayAddrStruct.Width | integer | Playback frame width in pixels. |
PlayAddrStruct.Height | integer | Playback frame height in pixels. |
PlayAddrStruct.DataSize | integer | Reported size of the playback file. |
PlayAddrStruct.UrlList | array | Available URLs for the playback file. |
PlayAddrStruct.UrlList[] | string | One available URL for the playback file. |
bitrateInfo | array | Available playback variants with bitrate and file information. |
bitrateInfo[] | object | One playback variant for this video. |
bitrateInfo[].Bitrate | integer | Bitrate reported for this variant. |
bitrateInfo[].BitrateFPS | integer | Frame rate reported for this playback variant. |
bitrateInfo[].CodecType | string | Codec label for this playback variant. |
bitrateInfo[].Format | string | File format of this playback variant. |
bitrateInfo[].GearName | string | Variant name reported for the playback option. |
bitrateInfo[].QualityType | integer | Numeric quality level reported for the variant. |
bitrateInfo[].PlayAddr | object | Playback file details and alternate URLs. |
bitrateInfo[].PlayAddr.Uri | string | Media reference for the playback file. |
bitrateInfo[].PlayAddr.Width | integer | Playback frame width in pixels. |
bitrateInfo[].PlayAddr.Height | integer | Playback frame height in pixels. |
bitrateInfo[].PlayAddr.DataSize | integer | Reported size of the playback file. |
bitrateInfo[].PlayAddr.UrlList | array | Available URLs for the playback file. |
bitrateInfo[].PlayAddr.UrlList[] | string | One available URL for the playback file. |
Subtitles29 fields
data.itemInfo.itemStruct.video
| Field | Type | Description |
|---|---|---|
claInfo | object | Detailed caption metadata for the video. |
claInfo.enableAutoCaption | boolean | Whether automatic captions are marked as enabled. |
claInfo.hasOriginalAudio | boolean | Whether original audio is indicated for the video. |
claInfo.noCaptionReason | integer | Numeric caption availability reason reported by TikTok. |
claInfo.originalLanguageInfo | object | Original language information for the video. |
claInfo.originalLanguageInfo.language | string | Display name of the original language. |
claInfo.originalLanguageInfo.languageCode | string | Language code reported for the original language. |
claInfo.originalLanguageInfo.languageID | string | Identifier reported for the original language. |
claInfo.captionInfos | array | Caption tracks in the detailed caption metadata. |
claInfo.captionInfos[] | object | One caption track in the detailed caption metadata. |
claInfo.captionInfos[].captionFormat | string | File format reported for the caption track. |
claInfo.captionInfos[].language | string | Display name of the caption language. |
claInfo.captionInfos[].languageCode | string | Language code reported for this caption track. |
claInfo.captionInfos[].languageID | string | Language identifier reported for this caption track. |
claInfo.captionInfos[].isAutoGen | boolean | Whether the caption track is marked as automatically generated. |
claInfo.captionInfos[].isOriginalCaption | boolean | Whether the track is marked as the original caption. |
claInfo.captionInfos[].expire | string | Expiration of caption URLs as Unix seconds encoded in a string. |
claInfo.captionInfos[].url | string | URL returned for this caption track. |
claInfo.captionInfos[].urlList | array | Available links for this caption track. |
claInfo.captionInfos[].urlList[] | string | One URL for the caption track. |
subtitleInfos | array | Subtitle tracks listed separately in the video metadata. |
subtitleInfos[] | object | One subtitle track listed for the video. |
subtitleInfos[].Format | string | File format reported for the subtitle track. |
subtitleInfos[].LanguageCodeName | string | Language code label of the subtitle track. |
subtitleInfos[].LanguageID | string | Language identifier reported for the subtitle track. |
subtitleInfos[].Size | integer | Reported size of the subtitle resource. |
subtitleInfos[].Source | string | Source label reported for the subtitle track. |
subtitleInfos[].Url | string | URL returned for the subtitle resource. |
subtitleInfos[].UrlExpire | integer | Expiration time of the subtitle URL as Unix seconds. |
Music12 fields
data.itemInfo.itemStruct
| Field | Type | Description |
|---|---|---|
music | object | Public audio track information shown with the post. |
music.id | string | TikTok identifier of the audio track. |
music.title | string | Displayed title of the audio track. |
music.authorName | string | Displayed contributor name of the audio track. |
music.original | boolean | Whether the track is marked as original audio. |
music.duration | integer | Reported duration of the audio track. |
music.isCopyrighted | boolean | Whether the track is marked as copyrighted. |
music.is_commerce_music | boolean | Whether the track is marked for commercial music use. |
music.coverThumb | string | Audio track thumbnail cover URL. |
music.coverMedium | string | Medium-size cover URL for the audio track. |
music.coverLarge | string | Large cover URL for the audio track. |
music.playUrl | string | Audio playback URL returned with the track. |