SerpBase
Back to Blog

TikTok Search API: Search Videos by Keyword as JSON

Search TikTok by keyword and get 16 videos per page as JSON: links, captions, authors, views, likes, shares and hashtags, with a cursor for more. Tested request.

November 25, 2026
By SerpBase Team2 min read

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:

FieldWhat it holds
id, linkVideo ID and its tiktok.com URL
textCaption, including hashtags
hashtagsHashtags as a list
views_count, likes_count, comments_count, shares_count, saves_countEngagement counts (strings)
published_atUpload time, ISO 8601
authorusername, name, followers_count, verified, profile link
mediaCover 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 text or 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_cursor back 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.