Available on RapidAPI
TikTok Video & Creator API
Unofficial API for public TikTok data. Search videos and accounts by keyword, get creator profiles and their posts, read a video's comments and replies, list videos for a hashtag or a sound, and page through follower and following lists. Every endpoint is a GET request that returns JSON, with the same field names everywhere.
Why not TikTok's own API
TikTok's official APIs serve other jobs. Login Kit and the Display API read the account of a user who logs in to your app. The Content Posting API publishes to it. The Research API is limited to academic and not-for-profit researchers, with no commercial use. None of them lets a company search public videos or read any creator's posts and comments.
This API reads the same public pages a logged-out visitor sees. No TikTok account, login or cookies of yours are needed.
Quick start
Subscribe on RapidAPI to get a key; the free plan has 100 requests for testing. Send requests to https://tiktok-video-creator-api.p.rapidapi.com with both headers. This searches videos for "street food":
curl
curl --request GET \
--url 'https://tiktok-video-creator-api.p.rapidapi.com/v1/tiktok/search/videos?q=street%20food' \
--header "X-RapidAPI-Key: $RAPIDAPI_KEY" \
--header 'X-RapidAPI-Host: tiktok-video-creator-api.p.rapidapi.com'
Python
import os
import requests
BASE = "https://tiktok-video-creator-api.p.rapidapi.com"
HEADERS = {
"X-RapidAPI-Key": os.environ["RAPIDAPI_KEY"],
"X-RapidAPI-Host": "tiktok-video-creator-api.p.rapidapi.com",
}
response = requests.get(f"{BASE}/v1/tiktok/search/videos",
headers=HEADERS, params={"q": "street food"}, timeout=30)
response.raise_for_status()
for video in response.json()["videos"]:
print(video["stats"]["plays"], video["url"])
Endpoints
Every call costs one request, whatever the endpoint and however many items the page holds.
| Path | Returns | Per page |
|---|---|---|
/v1/tiktok/search/videos?q= | Videos for a keyword | up to 20 |
/v1/tiktok/search/users?q= | Accounts for a keyword | up to 10 |
/v1/tiktok/users/{username} | A creator's public profile with exact counts | 1 |
/v1/tiktok/users/{username}/videos | A creator's posts, newest first (guide) | about 30 |
/v1/tiktok/users/{username}/followers | An account's followers (guide) | up to 30 |
/v1/tiktok/users/{username}/following | The accounts it follows | up to 30 |
/v1/tiktok/videos/{id} | One video or photo post, by ID or URL | 1 |
/v1/tiktok/videos/{id}/comments | Top-level comments (guide) | usually 33–42 |
/v1/tiktok/videos/{id}/comments/{comment_id}/replies | Replies to one comment | varies |
/v1/tiktok/hashtags/{name} | Hashtag info: video and view counts | 1 |
/v1/tiktok/hashtags/{name}/videos | Videos using a hashtag (guide) | about 30 |
/v1/tiktok/sounds/{id} | Sound info and how many posts use it | 1 |
/v1/tiktok/sounds/{id}/videos | Posts that use a sound | about 30 |
The full parameter reference is on the RapidAPI listing.
Example response
Real response for GET /v1/tiktok/users/zachking, avatar link shortened
{
"id": "68616495085350913",
"username": "zachking",
"nickname": "Zach King",
"avatar": "https://p19-common-sign.tiktokcdn-us.com/…",
"verified": true,
"sec_uid": "MS4wLjABAAAANnzJ9pdfxtlf3m5Ku_M-rCXVitJC13w4GavqyUD3RE8h1cZ-7O9FT-uQ9rCJjU_E",
"url": "https://www.tiktok.com/@zachking",
"bio": "Bringing a little more wonder into the world, 15 seconds at a time",
"bio_link": "https://youtu.be/ulVscDewRPI?si=-65KnrnwSiGHDeT2",
"private": false,
"language": "en",
"created_at": "2016-02-29T07:29:22Z",
"stats": { "followers": 86890382, "following": 182, "likes": 1301093987, "videos": 617, "friends": 119 }
}
A video has the same fields wherever it comes from (search, a creator's posts, a hashtag, a sound): id, url, description, created_at, duration, hashtags, stats (plays, likes, comments, shares, bookmarks), author and music. The guides show full video examples.
Pagination
Every list has count, has_more and next_cursor. Pass next_cursor back unchanged as cursor for the next page; it is null on the last page.
def pages(path, **params):
while True:
r = requests.get(BASE + path, headers=HEADERS, params=params, timeout=30)
r.raise_for_status()
data = r.json()
yield data
if not data.get("has_more") or not data.get("next_cursor"):
return
params["cursor"] = data["next_cursor"]
Field notes
- Counts. The profile endpoint returns exact counts. Counts inside videos are the values TikTok ships with the post, which TikTok rounds for large numbers (86,890,382 followers on the profile, 86,900,000 inside a video).
- Freshness. Answers are cached for up to 24 hours, so counts can be up to a day old.
- Media links (
cover,play_url,avatar, images) are TikTok CDN links that expire after a few hours. Download what you need to keep. - Times are UTC, RFC 3339.
- Refused keywords. A keyword TikTok itself won't search (adult, drug or self-harm terms) returns an empty page, as on TikTok.
Errors
| Status | When |
|---|---|
400 | Missing or invalid parameter; the body says which |
403 | The account is private |
404 | No such account, video, hashtag or sound (or it was removed) |
429 | Your plan's rate limit |
502 | TikTok failed after our retries; retry with backoff |
503 | Temporarily no capacity; wait for Retry-After |
Errors are JSON: {"error": "…"}.
Guides
- Scrape TikTok comments and replies with Python
- Export a TikTok account's followers list
- Get videos and view counts for a hashtag
- Get all videos from a TikTok user
- Search TikTok videos by keyword and export them to CSV
- Track a TikTok creator's new videos and growth
Without code
For one-off exports without writing code, the same kinds of data are available as Actors on Apify. You run them from the browser and download the results as CSV, Excel or JSON:
- TikTok Video Search: videos for a keyword
- TikTok User Search: accounts for a keyword
- TikTok Profile & Videos: creator profiles and their latest videos
- TikTok Hashtag Videos: videos under a hashtag
- TikTok Sound Videos: videos that use a sound
- TikTok Video Details: full details for videos by link
- TikTok Transcripts: a video's captions as text, when TikTok has them
Plans and support
A free plan covers testing. Plans, monthly quotas and rate limits are listed on the RapidAPI listing. For more volume or a custom plan, use Contact provider on the listing; the same button takes questions and bug reports.