usernamestringобязательно
Username, which can be obtained from the user's homepage link, for example: https://www.tiktok.com/@tiktok, the username is tiktok.
https://api.sandbase.ai/v1/api/tiktok/app-v3/user-country-by-usernameReturns the registered country code, user IDs, and username modification timestamp for a specified TikTok profile using their username.
[
{
"data": {
"api_version": "v1",
"country": "US",
"sec_user_id": "MS4wLjABAAAAv7iSuuXDJGDvJkmH_vz1qkDZYo1apxgzaxdBSeIuPiM",
"user_id": 107955,
"username": "tiktok",
"username_modify_time": 1791290369
}
}
]Выберите пример, чтобы загрузить его входные данные и результат в playground.
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.
username into user_id and sec_user_id for later API calls.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.
| Name | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Username, which can be obtained from the user's homepage link, for example: https://www.tiktok.com/@tiktok, the username is tiktok. |
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
}
| Field | Meaning |
|---|---|
country | Two-letter country code for the account, such as US. |
user_id | Numeric ID of the TikTok user. |
sec_user_id | Secure user ID string for the same account. Other TikTok endpoints accept it in place of the username. |
username | The username that was looked up, returned as the account currently holds it. |
username_modify_time | Unix timestamp in seconds for the account's username modification. |
api_version | Version label of the response format, v1 in this response. |
username from the profile URL. In https://www.tiktok.com/@tiktok, the value is tiktok.$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Начните разработку
Конечная точка платформенного API с единообразной аутентификацией и учётом использования.
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"
}'Укажите свой ключ SandBase API в окружении сервера. Запросы используют аутентификацию Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Храните ключ на сервере. Не раскрывайте его в коде браузера.
usernamestringобязательноUsername, which can be obtained from the user's homepage link, for example: https://www.tiktok.com/@tiktok, the username is tiktok.
Сохранённый пример ответа для этого API; при просмотре живой запрос не выполняется.
[
{
"data": {
"api_version": "v1",
"country": "US",
"sec_user_id": "MS4wLjABAAAAv7iSuuXDJGDvJkmH_vz1qkDZYo1apxgzaxdBSeIuPiM",
"user_id": 107955,
"username": "tiktok",
"username_modify_time": 1791290369
}
}
]Посмотреть больше
| API | Цена | Ответ |
|---|---|---|
TikTok User Country by UsernameЭтот API TikTok | $0.001 за запрос | JSON |
TikTok | $0.001 за запрос | JSON |
TikTok | $0.01 за запрос | JSON |
TikTok | $0.001 за запрос | JSON |
TikTok | $0.001 за запрос | JSON |
TikTok | $0.001 за запрос | JSON |
Руководства:TikTok API pricing: official access vs per-call dataBest TikTok API in 2026: Pricing Compared
Вопросы
Отправьте POST-запрос на https://api.sandbase.ai/v1/api/tiktok/app-v3/user-country-by-username, указав ключ SandBase API в заголовке Authorization (Bearer), а параметры — в теле JSON. Вы также можете попробовать это в Playground на этой странице без написания кода.
$0.001 за вызов, списывается с баланса SandBase. Оплата взимается только за сделанные вызовы; подписка не требуется.
Обязательные: username (string). В таблице Parameters и в Playground на этой странице перечислены все поля.
JSON-ответ, возвращаемый в том же HTTP-запросе (синхронно). В README на этой странице приведен пример ответа.
Нет. TikTok User Country by Username работает через SandBase, поэтому один API key SandBase покрывает этот endpoint и все остальные API и модели в каталоге. Вам не нужно отдельно запрашивать доступ к API TikTok.