You need to programmatically get a TikTok user’s profile and follower stats by username, and you need it working this week. By the end of this guide, you’ll retrieve user detail (ID, nickname, verification, follower counts, and more) using a single HTTP GET, and you’ll know how to chain that into video retrieval and item detail lookups.
Why this API and what it returns
The Tiktok Public Media API on Zyla API Hub exposes read-only endpoints to pull public TikTok data. With it, you can:
- Resolve a TikTok username to a full profile (ID, secUid, nickname, avatar URLs, verification status, and follower statistics).
- Fetch a user’s posted videos via their secUid.
- Get detailed information for a specific TikTok video or photo by URL or ID.
This is useful for social dashboards, CRM enrichment, creator analytics, content monitoring, and server-side automations that need reproducible access to public TikTok metadata.
Zyla API Hub centralizes thousands of APIs under one key and one subscription model. You can explore more than 10,000 public APIs at zylalabs.com and subscribe without managing multiple vendors.
Getting started on Zyla API Hub
To try these endpoints, open the Tiktok Public Media API listing and start a trial. You’ll receive an API key to place in the Authorization header.
- Go to the listing: Start 7-day trial on Tiktok Public Media API.
- Click Subscribe or Start Free Trial (when available) to obtain your key.
- Use Authorization: Bearer YOUR_API_KEY on every request.
Billing is subscription + quota (not pay-per-call). For current access options and pricing, always check the API page. You can also browse other categories on Zyla API Hub with the same account and key.
Endpoints you’ll use
1) Get User Detail — resolve a username to profile and stats
Method: GET
URL: https://zylalabs.com/api/12389/tiktok-public-media-api/23413/get-user-detail
Description: Retrieve detailed profile information of a TikTok user using their username. Returns user metadata such as follower count, following count, and profile details.
Required param: username (string)
Example with username = _ttqueen:
curl -s -X GET "https://zylalabs.com/api/12389/tiktok-public-media-api/23413/get-user-detail?username=_ttqueen" \
-H "Authorization: Bearer YOUR_API_KEY"
Official response sample:
{
"data": {
"id": "6644110999556227073",
"nickname": "Quynh Truong",
"signature": "Thấy mình đáng iu thì fl mình nhé hehee\n💬For work: 097.136.3242",
"hdAvatarUrlList": [
"https://p16-common-sign.tiktokcdn-eu.com/tos-alisg-avt-0068/dcb917fff48aacab462620b08f13b4e0~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=10399&refresh_token=c1870c0f&x-expires=1790154000&x-signature=nO62jhA4bUQvXuz5YAr8WEwl6ns%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=no1a"
],
"uniqueId": "_ttqueen",
"secUid": "MS4wLjABAAAA6e26Ok_w7ReVcKXUIZoygasHXTl9ZPPvhmuTQz1GGRaMU5RLQk6-yftHzzfIfr9L",
"isVerified": false,
"statistics": {
"followerCount": 3100000,
"followingCount": 139,
"friendCount": 84,
"heartCount": 117100000,
"videoCount": 559,
"diggCount": 0
}
}
}
Key fields you’ll actually use:
data.id: internal user ID you can store as a stable key.data.uniqueIdanddata.nickname: handle and display name for UI.data.hdAvatarUrlList: high-quality avatar URLs.data.isVerified: verification indicator.data.statistics: follower/following/heart/video counts for KPIs.data.secUid: required to retrieve a user’s videos with the next endpoint.
2) Get video list — list videos by secUid
Method: GET
URL: https://zylalabs.com/api/12389/tiktok-public-media-api/23414/get-video-list
Description: Retrieve a list of videos posted by a TikTok user using their secUid. Returns video metadata including IDs, descriptions, and statistics.
Required param: secUid (string)
You obtain secUid from the Get User Detail response. Supply it to this endpoint to enumerate the creator’s posts.
Example request URL shape (do not forget the Authorization header):
https://zylalabs.com/api/12389/tiktok-public-media-api/23414/get-video-list?secUid=MS4wLjABAAAA6e26Ok_w7ReVcKXUIZoygasHXTl9ZPPvhmuTQz1GGRaMU5RLQk6-yftHzzfIfr9L
3) Get Video Or Photo Details — inspect a specific post
Method: GET
URL: https://zylalabs.com/api/12389/tiktok-public-media-api/23415/get-video-or-photo-details
Description: Retrieve TikTok video details by ID or URL including description statistics author info and media URLs.
Required param: idOrUrl (string)
Supply a TikTok item URL or its ID to receive detailed metadata for that single post. Example parameter value:
https://www.tiktok.com/@khaby.lame/video/7661681676719869214?lang=en
Workflow: from username to user detail (and beyond)
- Call Get User Detail with the target username to resolve:
- User identity and avatar: display on your profile page or CRM record.
- Follower and video counts: populate metrics and health indicators.
- secUid: store it; you’ll need it to list videos.
- Optionally, call Get video list with the returned secUid to enumerate recent content for feeds or analytics.
- Optionally, call Get Video Or Photo Details with a selected video URL or ID for deep dives (e.g., show per-post details on click).
Quick Python example: get user detail and read core fields
This example calls Get User Detail, extracts the profile’s basic info and follower statistics, and shows how to keep the secUid if you plan to fetch videos later.
import os
import requests
API_KEY = os.getenv("ZYLA_API_KEY", "YOUR_API_KEY")
BASE_USER_DETAIL = "https://zylalabs.com/api/12389/tiktok-public-media-api/23413/get-user-detail"
def get_user_detail(username: str) -> dict:
url = f"{BASE_USER_DETAIL}?username={username}"
headers = {"Authorization": f"Bearer {API_KEY}"}
resp = requests.get(url, headers=headers, timeout=30)
resp.raise_for_status()
return resp.json()
if __name__ == "__main__":
username = "_ttqueen"
data = get_user_detail(username)
user = data.get("data", {})
stats = user.get("statistics", {})
print("User ID:", user.get("id"))
print("Unique ID:", user.get("uniqueId"))
print("Nickname:", user.get("nickname"))
print("Verified:", user.get("isVerified"))
print("Avatar URL:", (user.get("hdAvatarUrlList") or [None])[0])
print("Followers:", stats.get("followerCount"))
print("Following:", stats.get("followingCount"))
print("Hearts:", stats.get("heartCount"))
print("Video Count:", stats.get("videoCount"))
print("secUid (for video list):", user.get("secUid"))
Notes:
- Authorization is a Bearer header with your key from the API listing.
- Always check for missing fields before indexing to avoid KeyError.
- Persist
idoruniqueIdas your local foreign key, and keepsecUidif you’ll fetch videos later.
Practical details that save time
- Authentication: All endpoints require the Authorization header exactly as Authorization: Bearer YOUR_API_KEY.
- Data freshness: Treat follower and heart counts as point-in-time values. If you cache, decide your refresh cadence based on your product’s needs.
- Timestamps: When fetching videos, you’ll see numeric
createdAtvalues. Normalize them in your application to your desired timezone and format. - Identifiers: Store both
idanduniqueIdfor resilience;secUidis needed to list a user’s videos. - Error handling: Use HTTP status codes and presence/absence of fields to branch logic. Log the request URL and username for retries.
- Quotas: The API uses a subscription + quota model. Check the listing for your current limits and the available 7-day trial.
Use cases you can ship this week
- Creator lookup widget: Type a username, instantly show avatar, verification badge, and follower count.
- CRM enrichment: Store TikTok IDs and follower stats next to influencer records.
- Moderation/curation tooling: Resolve a handle, then fetch their videos to build review queues or highlight reels.
- Reporting jobs: Nightly tasks that refresh follower, heart, and video counts to power analytics dashboards.
Calling this API from AI agents via MCP
If you automate with code assistants or agentic IDEs, you can call any Zyla API via the MCP endpoint. Configure your MCP-compatible client to point at:
https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY
This makes the Tiktok Public Media API callable as a tool from clients like Claude Code, Cursor, Windsurf, and others. For more, see the MCP page.
Chaining the other endpoints (optional patterns)
Get a user’s videos after resolving the profile
Once you read secUid from Get User Detail, send it to:
GET https://zylalabs.com/api/12389/tiktok-public-media-api/23414/get-video-list?secUid=MS4wLjABAAAA6e26Ok_w7ReVcKXUIZoygasHXTl9ZPPvhmuTQz1GGRaMU5RLQk6-yftHzzfIfr9L
Use this to populate a “Recent uploads” tab or to run analytics across items.
Get details for a specific item
When a user clicks a video in your UI, fetch deep details by passing the TikTok URL or ID to:
GET https://zylalabs.com/api/12389/tiktok-public-media-api/23415/get-video-or-photo-details?idOrUrl=https%3A%2F%2Fwww.tiktok.com%2F%40khaby.lame%2Fvideo%2F7661681676719869214%3Flang%3Den
This is handy for item-level pages, previews, and server-side link unfurls.
One-minute verification checklist
- Authorization header is present and correctly formatted.
- Username string is URL-encoded when necessary.
- Store
id,uniqueId, andsecUidfrom the user profile for subsequent operations. - Gracefully handle empty arrays such as
hdAvatarUrlList. - Log request URLs for reproducible bug reports.
FAQ
How do I authenticate my requests?
Include Authorization: Bearer YOUR_API_KEY on every call. Get your key from the API listing after subscribing or starting the trial.
Where do I get the secUid needed for the video list endpoint?
Call Get User Detail with the username; the response includes data.secUid. Use that value with Get video list.
Can I pass a TikTok video URL directly to get details?
Yes. Use Get Video Or Photo Details and set the idOrUrl parameter to the TikTok URL or to the item ID.
What are the pricing and quotas?
Access is subscription + quota (not pay-per-call). Check the API page for current access options. A 7-day trial is available on the listing.
Is there a Free Plan?
There is no Free Plan. Use the 7-day trial on the listing to evaluate, then choose a subscription that fits your usage.
Ready to ship your user detail integration? Get your key and start testing with the official endpoints here: Start 7-day trial on Tiktok Public Media API. One account and one key work across thousands of APIs on Zyla API Hub.