TikTok APItiktok.com ↗
Get TikTok video details (caption, stats, media URL, author) and paginated comments for any public video via two simple endpoints.
What is the TikTok API?
This API covers two endpoints — get_post_details and get_comments — giving you structured data from any public TikTok video. get_post_details returns 10 fields including caption, duration, cover image URL, video dimensions, and engagement stats (likes, shares, plays, saves, comments). get_comments returns paginated comment threads with per-comment like counts, reply counts, and a flag for whether the creator liked each comment.
curl -X GET 'https://api.parse.bot/scraper/8fb77401-1c2f-4e77-a331-41cac1121187/get_post_details?url=https%3A%2F%2Fwww.tiktok.com%2F%40lilireinhart%2Fvideo%2F7517409255914212638&video_id=7622064700431289630' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace tiktok-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""TikTok Video API — fetch video details and browse comments."""
from parse_apis.tiktok_video_api import TikTok, Count, VideoNotFound
client = TikTok()
# Fetch a video by its full TikTok URL
video = client.videos.get(url="https://www.tiktok.com/@lilireinhart/video/7517409255914212638")
print(f"Video: {video.caption} by @{video.author.unique_id}")
print(f"Stats: {video.stats.plays} plays, {video.stats.likes} likes, {video.stats.shares} shares")
print(f"Music: {video.music.title} by {video.music.author}")
# Browse the video's comments (limit caps total items fetched)
for comment in video.comments.list(count=Count._10, limit=5):
print(f" @{comment.user.username}: {comment.text[:60]} ({comment.likes} likes)")
# Handle a video that doesn't exist
try:
missing = client.videos.get(url="https://www.tiktok.com/@nobody/video/0000000000000000000")
print(missing.caption)
except VideoNotFound as exc:
print(f"Video not found: {exc}")
print("Exercised: videos.get, video.comments.list, VideoNotFound error handling")Get video details including caption, media URL, author info, engagement stats, and metadata for a public TikTok video. Requires a full TikTok video URL including the username path (e.g. https://www.tiktok.com/@username/video/VIDEO_ID). Returns a single Video resource with nested author, stats, and music objects. The media_url is a time-limited signed playback URL.
| Param | Type | Description |
|---|---|---|
| urlrequired | string | Full TikTok video URL in the format https://www.tiktok.com/@username/video/VIDEO_ID |
{
"type": "object",
"fields": {
"id": "string - Video ID",
"cover": "string - Video cover image URL",
"music": "object - Music info with id, title, author",
"stats": "object - Engagement stats with likes, shares, comments, plays, saves counts",
"width": "integer - Video width in pixels",
"author": "object - Author info with uid, unique_id, nickname, avatar URL, and verified boolean",
"format": "string - Video format (e.g. mp4)",
"height": "integer - Video height in pixels",
"caption": "string - Video caption/description",
"duration": "integer - Video duration in seconds",
"media_url": "string - Time-limited signed video playback URL",
"create_time": "string - Unix timestamp of creation",
"origin_cover": "string - Original cover image URL"
},
"sample": {
"data": {
"id": "7517409255914212638",
"cover": "https://p16-common-sign.tiktokcdn-us.com/example-cover.image",
"music": {
"id": "7515252172306942726",
"title": "MAMASITAAA",
"author": "celebsnapz"
},
"stats": {
"likes": 480100,
"plays": 4500000,
"saves": 13123,
"shares": 14400,
"comments": 1105
},
"width": 576,
"author": {
"uid": "6815436682578723845",
"avatar": "https://p19-common-sign.tiktokcdn-us.com/tos-maliva-avt-0068/example.jpeg",
"nickname": "Lili Reinhart",
"verified": true,
"unique_id": "lilireinhart"
},
"format": "mp4",
"height": 1024,
"caption": "Mother & son ",
"duration": 15,
"media_url": "https://v16-webapp-prime.us.tiktok.com/video/example",
"create_time": "1750283252",
"origin_cover": "https://p19-common-sign.tiktokcdn-us.com/example-origin.image"
},
"status": "success"
}
}About the TikTok API
Video Details
The get_post_details endpoint accepts a full TikTok video URL in the format https://www.tiktok.com/@username/video/VIDEO_ID — both the username path and the numeric video ID are required. It returns a single video object with the caption, duration in seconds, format (e.g. mp4), width and height in pixels, and a cover image URL. The nested stats object contains likes, shares, comments, plays, and saves counts. The author object includes uid, unique_id, nickname, an avatar URL, and a verified boolean. The music object provides the track id, title, and author.
Comments and Pagination
The get_comments endpoint accepts either a full TikTok video URL or a bare numeric video ID in the url parameter. Each response includes a comments array, a total count for that page, a has_more boolean, the video_id the comments belong to, and a cursor integer. Pass the returned cursor back as the cursor input on your next request to step through subsequent pages. The count parameter caps at 50 comments per request. Each comment object carries comment_id, text, create_time, likes, reply_count, is_liked_by_creator, and a labels array alongside a nested user object.
Coverage Scope
Both endpoints operate on public TikTok videos. Private videos, age-restricted content requiring login, and anything behind a regional block are not accessible. The get_comments endpoint returns comments sorted by relevance as TikTok surfaces them — there is no sort parameter to switch to chronological order.
The TikTok API is a managed, monitored endpoint for tiktok.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when tiktok.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official tiktok.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Track engagement trends by polling
stats.plays,stats.likes, andstats.saveson a set of videos over time - Build a comment moderation dashboard using
text,likes, andis_liked_by_creatorfields fromget_comments - Identify verified creators by checking
author.verifiedand filtering bystats.playsthresholds - Aggregate music usage data across videos using the
music.titleandmusic.authorfields - Feed a sentiment analysis pipeline with raw comment
textandcreate_timefrom paginated comment pages - Monitor a brand or campaign by checking
captionfor keywords and surfacingstats.shareson matching videos - Build a TikTok video metadata archive by storing
id,cover,duration, andformatfor collections of videos
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does TikTok have an official developer API?+
What does `get_comments` return beyond comment text?+
comment_id, text, create_time (Unix timestamp), likes, reply_count, is_liked_by_creator, and a labels array. A nested user object is attached to each comment. The has_more boolean and cursor integer let you page through all available comments in batches of up to 50.Can I retrieve the actual video file from `get_post_details`?+
get_post_details returns the cover image URL, video format, width, and height, but the response does not include a direct download URL for the video file itself. The API covers metadata and engagement stats. You can fork it on Parse and revise it to add a download URL field if one becomes available in the response shape.Does the API support fetching a creator's full video list or profile data?+
get_post_details and video comments via get_comments. There is no endpoint for listing all videos by a creator or returning profile-level stats. You can fork it on Parse and revise it to add a profile or video-list endpoint.Are comment replies (nested threads) returned by `get_comments`?+
get_comments endpoint returns top-level comments with a reply_count field on each, but does not return the nested reply thread for each comment. The API covers top-level comment data only. You can fork it on Parse and revise it to add a replies endpoint that fetches threaded replies for a given comment ID.