Sand AISand AI MAGI-2MAGI-2 現已登上 SandBase:支援原生音訊的 1080p 影片立即試用

TikTok User Country by Username

API 文件
https://api.sandbase.ai/v1/api/tiktok/app-v3/user-country-by-username

Returns the registered country code, user IDs, and username modification timestamp for a specified TikTok profile using their username.

價格
$0.001美元/次呼叫
方法
POST
回應
JSON
參數
1 個必填 · 0 個選填

Playground

輸入
Username, which can be obtained from the user's homepage link, for example: https://www.tiktok.com/@tiktok, the username is tiktok.
輸出範例
回應outputs · 255 B · 12 行
[
  {
    "data": {
      "api_version": "v1",
      "country": "US",
      "sec_user_id": "MS4wLjABAAAAv7iSuuXDJGDvJkmH_vz1qkDZYo1apxgzaxdBSeIuPiM",
      "user_id": 107955,
      "username": "tiktok",
      "username_modify_time": 1791290369
    }
  }
]

範例

選擇一個範例,將其輸入與結果載入 playground。

API README

TikTok User Country by Username API

Returns the registered country code, the numeric and secure user IDs, and a username modification timestamp for a TikTok account. It needs one input: the account username, without the @ sign.

Use cases

  • Check which country a creator account is registered in before you plan a regional campaign.
  • Filter a list of TikTok handles by registered country.
  • Convert a username into user_id and sec_user_id for later API calls.
  • Check when an account last changed its username.

Request

curl -X POST "https://api.sandbase.ai/v1/api/tiktok/app-v3/user-country-by-username" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"username": "tiktok"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
usernamestringYesUsername, which can be obtained from the user's homepage link, for example: https://www.tiktok.com/@tiktok, the username is tiktok.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "api_version": "v1",
  "country": "US",
  "sec_user_id": "MS4wLjABAAAAv7iSuuXDJGDvJkmH_vz1qkDZYo1apxgzaxdBSeIuPiM",
  "user_id": 107955,
  "username": "tiktok",
  "username_modify_time": 1793691840
}

Response fields

FieldMeaning
countryTwo-letter country code for the account, such as US.
user_idNumeric ID of the TikTok user.
sec_user_idSecure user ID string for the same account. Other TikTok endpoints accept it in place of the username.
usernameThe username that was looked up, returned as the account currently holds it.
username_modify_timeUnix timestamp in seconds for the account's username modification.
api_versionVersion label of the response format, v1 in this response.

Notes

Pricing

$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

探索更多

相關 APIs

所有 APIs
API價格回應
TikTok每次呼叫 $0.001JSON
TikTok每次呼叫 $0.001JSON
TikTok每次呼叫 $0.01JSON
TikTok每次呼叫 $0.001JSON
TikTok每次呼叫 $0.001JSON
TikTok每次呼叫 $0.001JSON

指南:TikTok API pricing: official access vs per-call dataBest TikTok API in 2026: Pricing Compared

問題

常見問題

我要如何使用 TikTok User Country by Username API?

使用 POST 請求將您的 SandBase API 金鑰放在 Authorization 標頭(Bearer)中,並以 JSON 主體傳入參數,即可呼叫 https://api.sandbase.ai/v1/api/tiktok/app-v3/user-country-by-username。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。

TikTok User Country by Username API 的費用是多少?

每次 $0.001,並從您的 SandBase 餘額中扣款。您只會為實際發出的呼叫付費;沒有訂閱方案。

TikTok User Country by Username API 接受哪些參數?

必要:username (string)。 本頁的 Parameters 表格與 Playground 會列出每個欄位。

TikTok User Country by Username API 會回傳什麼?

在同一個 HTTP 請求中回傳的 JSON 回應(同步)。 本頁的 README 包含範例回應。

我需要 TikTok 開發者帳號或 API 金鑰嗎?

不需要。TikTok User Country by Username 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 TikTok API 存取權。