You need to pull a TikTok user’s profile and follower stats into your app without building a scraper or reverse-engineering headers. By the end of this guide, you’ll query a real endpoint that returns user metadata (followers, following, profile fields) by username, and you’ll know how to chain it to fetch their content for user management workflows like profile dashboards and moderation queues.
What this API does and when to use it
The Tiktok Public Media API exposes read-only endpoints for working with public TikTok user data. The key user-management capability is retrieving a user’s detailed profile by their username, which includes follower and following counts, profile fields, and IDs you can use for subsequent calls. Typical applications include:
- Building a user profile panel showing follower trends and basic stats.
- Verifying a TikTok account connection by looking up a username and confirming expected metadata.
- Seeding a user’s content workflow by resolving their immutable identifiers (e.g., secUid) to fetch their videos.
All endpoints are available on Zyla API Hub under the Tiktok Public Media API, and you can explore more than 10,000 public APIs on Zyla API Hub with one account, one API key, and a subscription + quota model.
Getting started on Zyla API Hub
Open the API’s listing page on Zyla API Hub and select Subscribe or Start 7-day trial when available. The first API can be tried with a 7-day trial or 50 requests. There’s no free plan; check the API page for current access options and pricing. After subscribing, you’ll receive an API key.
- Authentication: pass your key using the header Authorization: Bearer YOUR_API_KEY
- Base calling pattern: use the exact endpoint URLs documented below on zylalabs.com
- Billing: subscription + quota (not pay-per-call)
Endpoints you’ll use for user management
1) Get User Detail
Retrieve detailed profile information of a TikTok user using their username. This returns user metadata such as follower count, following count, and profile details.
- Method: GET
- URL: https://zylalabs.com/api/12389/tiktok-public-media-api/23413/get-user-detail
- Required request parameter:
- username (string): the TikTok handle, for example: _ttqueen
Official cURL example (copy/paste):
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 JSON response:
{
"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
}
}
}
Field notes you’ll actually use:
- data.id: numeric user ID (string). Use as a stable key in your database.
- data.uniqueId: the public username you looked up.
- data.secUid: security-scoped unique identifier required by other endpoints (e.g., fetching the user’s video list).
- data.hdAvatarUrlList: list of avatar image URLs for profile displays.
- data.statistics.*: followerCount, followingCount, heartCount, videoCount are essential for profile KPIs.
- data.isVerified: boolean flag for badge displays and moderation routing.
2) Get video list
Retrieve a list of videos posted by a TikTok user using their secUid. Returns video metadata including IDs, descriptions, and statistics.
- Method: GET
- URL: https://zylalabs.com/api/12389/tiktok-public-media-api/23414/get-video-list
- Required request parameter:
- secUid (string): use the exact value returned from Get User Detail (data.secUid)
Notes:
- The response includes a data.awemeList array. Each item has fields like id, url, description, createdAt (UNIX timestamp, seconds), contentType, and author details.
- Use createdAt to order content chronologically. Timestamps are integers representing seconds since UNIX epoch; convert to your local timezone in your UI.
3) Get Video Or Photo Details
Retrieve TikTok video details by ID or URL, including description, statistics, author info, and media URLs.
- Method: GET
- URL: https://zylalabs.com/api/12389/tiktok-public-media-api/23415/get-video-or-photo-details
- Required request parameter:
- idOrUrl (string): pass a TikTok video URL or ID
Notes:
- Use this to enrich a user’s content detail page when an item is selected from the list view.
- The response includes author fields and media links that are suitable for previewing content in moderation or admin panels.
End-to-end flow for a user management dashboard
- Resolve the user by username using Get User Detail.
- Store identifiers (id, uniqueId, secUid) along with statistics for your user record.
- When needed, fetch their content using Get video list with the returned secUid.
- For a selected post, call Get Video Or Photo Details with its URL or ID to render a detail view.
This mirrors how most production dashboards keep a canonical user record keyed by id and secUid, periodically refreshing statistics while fetching content on-demand to control latency and costs.
Practical implementation details that save time
- Authentication: Every request must include Authorization: Bearer YOUR_API_KEY.
- Timestamps: createdAt fields returned by content endpoints are UNIX epoch seconds (UTC). Convert according to your product’s timezone policy.
- Caching: Cache Get User Detail responses (e.g., 5–15 minutes) if you poll follower counts for many profiles. This reduces duplicate requests and smooths UI loads.
- Identifiers: secUid is required for content fetching. Persist it immediately after your first lookup to avoid an extra call later.
- Quotas: Access is subscription + quota. The first API can be tried with a 7-day trial or 50 requests. Monitor usage in your Zyla dashboard.
Python example: resolve a user and display profile stats
This sample calls Get User Detail, extracts core user-management fields, and prints a compact profile summary. Replace YOUR_API_KEY with your key.
import os
import requests
API_KEY = os.getenv("ZYLA_API_KEY", "YOUR_API_KEY")
USERNAME = "_ttqueen"
url = "https://zylalabs.com/api/12389/tiktok-public-media-api/23413/get-user-detail"
params = {"username": USERNAME}
headers = {"Authorization": f"Bearer {API_KEY}"}
resp = requests.get(url, params=params, headers=headers, timeout=20)
resp.raise_for_status()
data = resp.json().get("data", {})
user_id = data.get("id")
unique_id = data.get("uniqueId")
sec_uid = data.get("secUid")
nickname = data.get("nickname")
avatar_urls = data.get("hdAvatarUrlList", [])
stats = data.get("statistics", {}) or {}
summary = {
"id": user_id,
"username": unique_id,
"nickname": nickname,
"followers": stats.get("followerCount"),
"following": stats.get("followingCount"),
"videos": stats.get("videoCount"),
"hearts": stats.get("heartCount"),
"verified": data.get("isVerified"),
"secUid": sec_uid,
"avatar": avatar_urls[0] if avatar_urls else None
}
print(summary)
From here, you can persist id and secUid for downstream content calls, and display summary["avatar"] in your UI’s profile header.
Error handling and operational tips
- Retry budget: Network blips happen. Use a small retry policy with exponential backoff for idempotent GETs (e.g., 2–3 retries).
- Input validation: Only pass the documented parameters. For user lookups, ensure the username string matches the expected TikTok handle format you collect from users.
- Partial data: Arrays like hdAvatarUrlList can be empty; guard for missing fields as shown in the sample.
- Scheduling: If you periodically refresh follower stats, stagger requests to avoid spikes and to stay within quota.
Real-world user management use cases
- Identity resolution: When a user connects their TikTok in your product, call Get User Detail by username to verify ownership (display nickname, avatar, follower count for confirmation).
- Admin profiles: Build internal pages that show user identity (id, uniqueId, nickname), a verification badge, and summary stats (followers, hearts, videos) for quick reviews.
- Growth snapshots: Persist daily aggregates from statistics to track followerCount and videoCount changes over time.
- Moderation queues: Combine Get video list with the secUid from Get User Detail to prefetch recent content into a review queue.
Calling the API from an AI agent via MCP
If you orchestrate tasks with an MCP-compatible client (Claude Code, Cursor, Windsurf), you can call Zyla APIs through the MCP endpoint. The same Authorization header applies; your client handles tool invocation.
- MCP endpoint: MCP (append your apikey as a query parameter when your tool requires it: apikey=YOUR_API_KEY)
- Use the exact hub URLs shown above for tools that accept direct HTTP calls, with the Authorization header set.
This lets an agent retrieve user details by username, parse out secUid, then fetch videos, all inside a coding session or automation without leaving your editor.
Integration checklist
- Subscribe on Zyla and get your API key.
- Implement Get User Detail by username; persist id and secUid.
- Render profile: nickname, avatar (first item in hdAvatarUrlList), isVerified badge, statistics.
- Add a job or on-demand call to fetch the user’s videos using secUid when needed.
- Wrap requests with retries and minimal caching (e.g., 5–15 minutes) for profile stats.
- Monitor quota in your Zyla dashboard and tune polling frequency accordingly.
FAQ
Q: Which header is required for authentication?
A: Use Authorization: Bearer YOUR_API_KEY on every request.
Q: How do I fetch a user’s videos after I look them up by username?
A: Call Get User Detail to get data.secUid, then pass that secUid to the Get video list endpoint.
Q: What timezone are createdAt timestamps in?
A: createdAt values are UNIX epoch seconds (UTC). Convert to your desired timezone in your UI.
Q: Is pricing pay-per-call?
A: No. Zyla uses a subscription + quota model. The first API can be tried with a 7-day trial or 50 requests. Check the API page for current access options and pricing.
Q: Can I use this in an AI coding agent?
A: Yes. Call the same hub endpoints through the Zyla MCP endpoint with your API key; MCP-compatible clients can invoke the tools directly.
Ready to wire this into your app? Start with the official listing, grab your key, and make your first request now: Start 7-day trial on Tiktok Public Media API. Explore more APIs anytime on Zyla API Hub.