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 failureimport 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
| Name | Type | Description |
|---|---|---|
handlepath · required | string | Handle, 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).
| Field | Type | Description |
|---|---|---|
uniqueId | string | |
region | string | null | The country most of the account’s recent videos were posted from (ISO 3166-1), or null. |
regions | object[] | |
basedOnVideos | number |
Status codes
| Status | Meaning |
|---|---|
200 | The account’s country. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The account, video, comment, hashtag or sound does not exist on TikTok, or was removed. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | TikTok 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.