Short answer: POST a keyword to /tiktok/search and you get TikTok's video results as JSON — 16 videos per page with link, caption, author, view/like/comment/share/save counts, hashtags and the cover image, plus a cursor for the next page.
TikTok's official Research API is limited to approved academic researchers, and the Display API only covers accounts that log in to your app. For keyword search across public videos, an API that reads TikTok's search results is the practical option.
The request
curl -X POST 'https://api.serpbase.dev/tiktok/search' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY' \
-d '{"q":"pasta recipe"}'
What comes back
On 25 November 2026 "pasta recipe" returned 16 videos in 6.7 seconds and pagination: {"has_more": true, "next_cursor": "16"}. Sending "cursor": "16" returned the next 16 in 3.6 seconds, with next_cursor "32".
Each item in posts:
| Field | What it holds |
|---|---|
id, link | Video ID and its tiktok.com URL |
text | Caption, including hashtags |
hashtags | Hashtags as a list |
views_count, likes_count, comments_count, shares_count, saves_count | Engagement counts (strings) |
published_at | Upload time, ISO 8601 |
author | username, name, followers_count, verified, profile link |
media | Cover image and video duration; the sound used, with its title |
Python: top videos by views across two pages
import requests
def page(q, cursor=None):
body = {"q": q}
if cursor:
body["cursor"] = cursor
return requests.post(
"https://api.serpbase.dev/tiktok/search",
headers={"X-API-Key": "YOUR_API_KEY"},
json=body,
timeout=60,
).json()
posts, cursor = [], None
for _ in range(2):
r = page("pasta recipe", cursor)
if r["status"] != 0:
break
posts += r["posts"]
if not r["pagination"].get("has_more"):
break
cursor = r["pagination"]["next_cursor"]
for p in sorted(posts, key=lambda p: int(p["views_count"]), reverse=True)[:10]:
print(p["views_count"], p["author"]["username"], p["link"])
Things that trip people up
- Counts are strings. Convert with
int()before sorting. - Results are not limited to one language. Our English query's first result had an Arabic caption. Filter on
textor the author if you need one market. - Media URLs expire. The cover and video URLs carry an expiry; save what you need when you fetch it.
- Pass
next_cursorback exactly as returned; it is TikTok's offset, not a page number.
Related endpoints
For the same topic on YouTube, use YouTube search; for what people search on Google around it, Google autocomplete.
Cost and limits
Each request costs 1 credit; failed requests are not charged. Responses are HTTP 200 with a status field (0 = success). Credits cost $0.25–$0.50 per 1,000 depending on the plan; new accounts get 500 free credits without a card.
- Parameters and the full response: TikTok Search docs
- Try it in the browser: TikTok Search
- Credit packs: pricing