---
title: "TikTok User Profile API (V1)"
description: "Retrieves a TikTok user profile by public username or secUid. Use it to look up a known account for creator research, profile review, or subsequent user-post retrieval."
aiUsagePrompt: true
---

# TikTok User Profile API \(V1\)

<ApiTester
  method="GET"
  :path='JSON.parse("\"/api/tiktok/get-user-detail/v1\"")'
  :summary='JSON.parse("\"User Profile (V1)\"")'
  openapiDefinitionUrl="https://docs.justoneapi.com/openapi/tiktok/user-profile-v1-en.json"
  openapiVersion="3.1.0"
  :parameters='JSON.parse("[{\"name\":\"token\",\"in\":\"query\",\"description\":\"Security token for API access.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"uniqueId\",\"in\":\"query\",\"description\":\"The public TikTok handle or username of the user.\",\"required\":false,\"schema\":{\"type\":\"string\",\"default\":\"\"}},{\"name\":\"secUid\",\"in\":\"query\",\"description\":\"The unique security ID of the user.\",\"required\":false,\"schema\":{\"type\":\"string\",\"default\":\"\"}}]")'
  :requestBody='JSON.parse("null")'
  :responses='JSON.parse("{\"200\":{\"description\":\"OK\",\"content\":{\"application/json\":{\"schema\":{\"if\":{\"properties\":{\"code\":{\"const\":0}},\"required\":[\"code\"]},\"then\":{\"properties\":{\"data\":{\"type\":\"object\",\"description\":\"TikTok profile lookup result. The response can contain only status information when a profile is unavailable.\",\"properties\":{\"statusCode\":{\"type\":\"integer\",\"description\":\"Status code reported by TikTok for the profile lookup. A nonzero code can accompany a response without userInfo.\"},\"statusMsg\":{\"type\":\"string\",\"description\":\"Status message reported by TikTok for the profile lookup.\"},\"userInfo\":{\"type\":\"object\",\"description\":\"Profile and reported account metrics, when available.\",\"properties\":{\"user\":{\"type\":\"object\",\"description\":\"Public user profile details.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"TikTok account ID returned as text.\"},\"shortId\":{\"type\":\"string\",\"description\":\"Short account identifier reported for the profile.\"},\"uniqueId\":{\"type\":\"string\",\"description\":\"Public TikTok username or handle.\"},\"nickname\":{\"type\":\"string\",\"description\":\"Profile display name.\"},\"secUid\":{\"type\":\"string\",\"description\":\"Opaque account identifier that can be used as secUid for a profile lookup.\"},\"avatarLarger\":{\"type\":\"string\",\"description\":\"URL for the large profile avatar variant.\"},\"avatarMedium\":{\"type\":\"string\",\"description\":\"URL for the medium profile avatar variant.\"},\"avatarThumb\":{\"type\":\"string\",\"description\":\"URL for the profile avatar thumbnail.\"},\"createTime\":{\"type\":\"integer\",\"description\":\"Account creation timestamp in seconds since the Unix epoch.\"},\"nickNameModifyTime\":{\"type\":\"integer\",\"description\":\"Reported timestamp of the last nickname change in Unix seconds. The value can be zero.\"},\"verified\":{\"type\":\"boolean\",\"description\":\"Whether TikTok marks the profile as verified.\"},\"privateAccount\":{\"type\":\"boolean\",\"description\":\"Whether TikTok marks the account as private.\"},\"language\":{\"type\":\"string\",\"description\":\"Language code reported for the profile.\"},\"roomId\":{\"type\":\"string\",\"description\":\"Live room identifier reported for the account, as text.\"},\"ttSeller\":{\"type\":\"boolean\",\"description\":\"Seller indicator reported by TikTok for the account.\"},\"commerceUserInfo\":{\"type\":\"object\",\"description\":\"Commerce information reported for the account.\",\"properties\":{\"commerceUser\":{\"type\":\"boolean\",\"description\":\"Commerce account indicator reported by TikTok.\"},\"category\":{\"type\":\"string\",\"description\":\"Commerce category reported for the account.\"}}},\"bioLink\":{\"type\":\"object\",\"description\":\"Link information from the public profile, when provided.\",\"properties\":{\"link\":{\"type\":\"string\",\"description\":\"URL associated with the public profile biography.\"},\"risk\":{\"type\":\"integer\",\"description\":\"Risk code reported for the profile link.\"}}},\"eventList\":{\"type\":\"array\",\"description\":\"Events listed on the public profile, when provided. The list can be empty.\",\"items\":{\"type\":\"object\",\"description\":\"One event listed on the profile.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Event ID returned as text.\"},\"title\":{\"type\":\"string\",\"description\":\"Event title.\"},\"desc\":{\"type\":\"string\",\"description\":\"Event description.\"},\"start_time\":{\"type\":\"string\",\"description\":\"Reported event start timestamp as text.\"},\"duration\":{\"type\":\"string\",\"description\":\"Reported event duration as text.\"},\"status\":{\"type\":\"integer\",\"description\":\"Reported event status code.\"},\"type\":{\"type\":\"integer\",\"description\":\"Reported event type code.\"},\"subscriber_count\":{\"type\":\"string\",\"description\":\"Reported number of event subscribers, as text.\"},\"is_paid_event\":{\"type\":\"boolean\",\"description\":\"Whether the event is marked as paid.\"},\"ticket_amount\":{\"type\":\"string\",\"description\":\"Reported ticket amount as text.\"}}}}}},\"stats\":{\"type\":\"object\",\"description\":\"Account metrics returned as integers.\",\"properties\":{\"followerCount\":{\"type\":\"integer\",\"description\":\"Reported number of followers of this account.\"},\"followingCount\":{\"type\":\"integer\",\"description\":\"Reported number of accounts followed by this account.\"},\"heart\":{\"type\":\"integer\",\"description\":\"Reported total likes received by the account.\"},\"heartCount\":{\"type\":\"integer\",\"description\":\"Reported received-like count for the account.\"},\"videoCount\":{\"type\":\"integer\",\"description\":\"Reported number of videos on the account.\"},\"diggCount\":{\"type\":\"integer\",\"description\":\"Reported number of posts liked by this account.\"},\"friendCount\":{\"type\":\"integer\",\"description\":\"Reported number of friends of this account.\"}}},\"statsV2\":{\"type\":\"object\",\"description\":\"Account metrics returned as decimal strings. Values can differ from the corresponding values in stats in the same response.\",\"properties\":{\"followerCount\":{\"type\":\"string\",\"description\":\"Reported number of followers of this account, as decimal text.\"},\"followingCount\":{\"type\":\"string\",\"description\":\"Reported number of accounts followed by this account, as decimal text.\"},\"heart\":{\"type\":\"string\",\"description\":\"Reported total likes received by the account, as decimal text.\"},\"heartCount\":{\"type\":\"string\",\"description\":\"Reported received-like count for the account, as decimal text.\"},\"videoCount\":{\"type\":\"string\",\"description\":\"Reported number of videos on the account, as decimal text.\"},\"diggCount\":{\"type\":\"string\",\"description\":\"Reported number of posts liked by this account, as decimal text.\"},\"friendCount\":{\"type\":\"string\",\"description\":\"Reported number of friends of this account, as decimal text.\"}}},\"itemList\":{\"type\":\"array\",\"description\":\"Items included with the profile, when provided. The list can be empty.\"}}},\"shareMeta\":{\"type\":\"object\",\"description\":\"Share preview information for the profile.\",\"properties\":{\"title\":{\"type\":\"string\",\"description\":\"Profile share preview title.\"},\"desc\":{\"type\":\"string\",\"description\":\"Profile share preview description.\"}}}}}}},\"allOf\":[{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}]}}}},\"400\":{\"description\":\"Invalid request parameters or body\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"401\":{\"description\":\"Invalid or inactive access token\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"403\":{\"description\":\"Permission denied\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"429\":{\"description\":\"Request rate or daily quota limit exceeded\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"500\":{\"description\":\"Internal server error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"503\":{\"description\":\"Service temporarily unavailable\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}}}")'
  :servers='JSON.parse("[{\"url\":\"https://api.justoneapi.com\",\"description\":\"Global production API (default)\"}]")'
  :security='JSON.parse("[]")'
  :securitySchemes='JSON.parse("{}")'
  :schemas='JSON.parse("{}")'
/>

<ApiHealthSection :api='JSON.parse("\"/api/tiktok/get-user-detail/v1\"")' />

<p>Retrieves a TikTok user profile by public username or secUid. Use it to look up a known account for creator research, profile review, or subsequent user-post retrieval.</p>

## Parameters

<div class="api-doc-table api-doc-table--params">

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| <code>token</code> | query | <code>string</code> | Yes | - | Security token for API access. |
| <code>uniqueId</code> | query | <code>string</code> | No | <code></code> | The public TikTok handle or username of the user. |
| <code>secUid</code> | query | <code>string</code> | No | <code></code> | The unique security ID of the user. |

</div>

## Code Samples

::: code-group

```bash [🐚 cURL]
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/tiktok/get-user-detail/v1?token=YOUR_API_KEY'
```

```text [🤖 AI Prompt]
I want to use the "User Profile (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/tiktok/get-user-detail/v1?token=YOUR_API_KEY
API Endpoint: BASE_URL + /api/tiktok/get-user-detail/v1?token=YOUR_API_KEY
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/tiktok/user-profile-v1-en.json

Parameters:
- token (query): Security token for API access. (Required)
- uniqueId (query): The public TikTok handle or username of the user.
- secUid (query): The unique security ID of the user.

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 [🐍 Python]
import requests

BASE_URL = "https://api.justoneapi.com"  # Provided by OpenAPI servers

url = BASE_URL + "/api/tiktok/get-user-detail/v1?token=YOUR_API_KEY"
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 [🌐 JavaScript]
const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/tiktok/get-user-detail/v1?token=YOUR_API_KEY";

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 [☕ 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-detail/v1?token=YOUR_API_KEY";

        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 [🐹 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-detail/v1?token=YOUR_API_KEY"
	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]
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/tiktok/get-user-detail/v1?token=YOUR_API_KEY';

$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;
}
```

:::

<div style="text-align: right; margin-top: -20px; margin-bottom: 20px;">
<a href="/openapi/tiktok/user-profile-v1-en.json" target="_blank" style="font-size: 12px; color: var(--vp-c-text-3); text-decoration: none; opacity: 0.8;">[OpenAPI Definition (JSON)]</a>
</div>

## Response Fields

Key fields in a successful response (`code = 0`).

<div class="api-doc-table api-doc-table--response">

| Field path | Type | Description |
| --- | --- | --- |
| <code>data</code> | <code>object</code> | TikTok profile lookup result. The response can contain only status information when a profile is unavailable. |
| <code>data.statusCode</code> | <code>integer</code> | Status code reported by TikTok for the profile lookup. A nonzero code can accompany a response without userInfo. |
| <code>data.statusMsg</code> | <code>string</code> | Status message reported by TikTok for the profile lookup. |
| <code>data.userInfo</code> | <code>object</code> | Profile and reported account metrics, when available. |
| <code>data.userInfo.user</code> | <code>object</code> | Public user profile details. |
| <code>data.userInfo.user.id</code> | <code>string</code> | TikTok account ID returned as text. |
| <code>data.userInfo.user.shortId</code> | <code>string</code> | Short account identifier reported for the profile. |
| <code>data.userInfo.user.uniqueId</code> | <code>string</code> | Public TikTok username or handle. |
| <code>data.userInfo.user.nickname</code> | <code>string</code> | Profile display name. |
| <code>data.userInfo.user.secUid</code> | <code>string</code> | Opaque account identifier that can be used as secUid for a profile lookup. |
| <code>data.userInfo.user.avatarLarger</code> | <code>string</code> | URL for the large profile avatar variant. |
| <code>data.userInfo.user.avatarMedium</code> | <code>string</code> | URL for the medium profile avatar variant. |
| <code>data.userInfo.user.avatarThumb</code> | <code>string</code> | URL for the profile avatar thumbnail. |
| <code>data.userInfo.user.createTime</code> | <code>integer</code> | Account creation timestamp in seconds since the Unix epoch. |
| <code>data.userInfo.user.nickNameModifyTime</code> | <code>integer</code> | Reported timestamp of the last nickname change in Unix seconds. The value can be zero. |
| <code>data.userInfo.user.verified</code> | <code>boolean</code> | Whether TikTok marks the profile as verified. |
| <code>data.userInfo.user.privateAccount</code> | <code>boolean</code> | Whether TikTok marks the account as private. |
| <code>data.userInfo.user.language</code> | <code>string</code> | Language code reported for the profile. |
| <code>data.userInfo.user.roomId</code> | <code>string</code> | Live room identifier reported for the account, as text. |
| <code>data.userInfo.user.ttSeller</code> | <code>boolean</code> | Seller indicator reported by TikTok for the account. |
| <code>data.userInfo.user.commerceUserInfo</code> | <code>object</code> | Commerce information reported for the account. |
| <code>data.userInfo.user.commerceUserInfo.commerceUser</code> | <code>boolean</code> | Commerce account indicator reported by TikTok. |
| <code>data.userInfo.user.commerceUserInfo.category</code> | <code>string</code> | Commerce category reported for the account. |
| <code>data.userInfo.user.bioLink</code> | <code>object</code> | Link information from the public profile, when provided. |
| <code>data.userInfo.user.bioLink.link</code> | <code>string</code> | URL associated with the public profile biography. |
| <code>data.userInfo.user.bioLink.risk</code> | <code>integer</code> | Risk code reported for the profile link. |
| <code>data.userInfo.user.eventList</code> | <code>array</code> | Events listed on the public profile, when provided. The list can be empty. |
| <code>data.userInfo.user.eventList[]</code> | <code>object</code> | One event listed on the profile. |
| <code>data.userInfo.user.eventList[].id</code> | <code>string</code> | Event ID returned as text. |
| <code>data.userInfo.user.eventList[].title</code> | <code>string</code> | Event title. |
| <code>data.userInfo.user.eventList[].desc</code> | <code>string</code> | Event description. |
| <code>data.userInfo.user.eventList[].start_time</code> | <code>string</code> | Reported event start timestamp as text. |
| <code>data.userInfo.user.eventList[].duration</code> | <code>string</code> | Reported event duration as text. |
| <code>data.userInfo.user.eventList[].status</code> | <code>integer</code> | Reported event status code. |
| <code>data.userInfo.user.eventList[].type</code> | <code>integer</code> | Reported event type code. |
| <code>data.userInfo.user.eventList[].subscriber_count</code> | <code>string</code> | Reported number of event subscribers, as text. |
| <code>data.userInfo.user.eventList[].is_paid_event</code> | <code>boolean</code> | Whether the event is marked as paid. |
| <code>data.userInfo.user.eventList[].ticket_amount</code> | <code>string</code> | Reported ticket amount as text. |
| <code>data.userInfo.stats</code> | <code>object</code> | Account metrics returned as integers. |
| <code>data.userInfo.stats.followerCount</code> | <code>integer</code> | Reported number of followers of this account. |
| <code>data.userInfo.stats.followingCount</code> | <code>integer</code> | Reported number of accounts followed by this account. |
| <code>data.userInfo.stats.heart</code> | <code>integer</code> | Reported total likes received by the account. |
| <code>data.userInfo.stats.heartCount</code> | <code>integer</code> | Reported received-like count for the account. |
| <code>data.userInfo.stats.videoCount</code> | <code>integer</code> | Reported number of videos on the account. |
| <code>data.userInfo.stats.diggCount</code> | <code>integer</code> | Reported number of posts liked by this account. |
| <code>data.userInfo.stats.friendCount</code> | <code>integer</code> | Reported number of friends of this account. |
| <code>data.userInfo.statsV2</code> | <code>object</code> | Account metrics returned as decimal strings. Values can differ from the corresponding values in stats in the same response. |
| <code>data.userInfo.statsV2.followerCount</code> | <code>string</code> | Reported number of followers of this account, as decimal text. |
| <code>data.userInfo.statsV2.followingCount</code> | <code>string</code> | Reported number of accounts followed by this account, as decimal text. |
| <code>data.userInfo.statsV2.heart</code> | <code>string</code> | Reported total likes received by the account, as decimal text. |
| <code>data.userInfo.statsV2.heartCount</code> | <code>string</code> | Reported received-like count for the account, as decimal text. |
| <code>data.userInfo.statsV2.videoCount</code> | <code>string</code> | Reported number of videos on the account, as decimal text. |
| <code>data.userInfo.statsV2.diggCount</code> | <code>string</code> | Reported number of posts liked by this account, as decimal text. |
| <code>data.userInfo.statsV2.friendCount</code> | <code>string</code> | Reported number of friends of this account, as decimal text. |
| <code>data.userInfo.itemList</code> | <code>array</code> | Items included with the profile, when provided. The list can be empty. |
| <code>data.shareMeta</code> | <code>object</code> | Share preview information for the profile. |
| <code>data.shareMeta.title</code> | <code>string</code> | Profile share preview title. |
| <code>data.shareMeta.desc</code> | <code>string</code> | Profile share preview description. |

</div>

## Response Example

<ApiExampleSection :api='JSON.parse("\"/api/tiktok/get-user-detail/v1\"")' />

