100 free credits. No credit card required. Get a key

TikTok profile country API

The country a TikTok account posts from, read from where its latest videos were posted.

GET /v1/tiktok/users/{handle}/region1 credit per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/tiktok/users/khaby.lame/region",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 1 credit
{
"uniqueId": "khaby.lame",
"region": "US",
"regions": [
{
"region": "US",
"videos": 1
}
],
"basedOnVideos": 1
}

Parameters

NameTypeDescription
handlepath · requiredstringHandle, with or without the @, or a profile URL. Example: nasa.
Response fields

200 with a TikTokRegionResponse, in TikTok’s own web JSON (itemStruct, userInfo, comments).

FieldTypeDescription
uniqueIdstring
regionstring | nullThe country most of the account’s recent videos were posted from (ISO 3166-1), or null.
regionsobject[]
basedOnVideosnumber
Status codes
StatusMeaning
200The account’s country.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The account, video, comment, hashtag or sound does not exist on TikTok, or was removed.
429Too many requests. Wait for Retry-After seconds.
503TikTok is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

Why is region null?

TikTok showed no posting country for the latest videos, or the account has none.

TikTok is a trademark of ByteDance Ltd. We are not affiliated with or endorsed by TikTok or ByteDance.