Answers

Is there an API to search TikTok videos by keyword?

Short answer

Yes. TikTok video search (/v1/tiktok/videos/search) takes a keyword and returns a page of about 30 public videos with caption, author, plays, likes, comments and shares for $0.002 a call. 1,000 videos take 34 calls, $0.068 in total, with no TikTok account and no approval process.

Say a sunscreen brand wants to know what TikTok shows for "sunscreen review" this week: which videos rank, who made them, and how many people watched. In the app that is ten minutes of scrolling and screenshots. With an API key it is one request that returns the same kind of list as structured data, ready for a spreadsheet or a model.

The endpoint

TikTok video search needs one parameter, query, typed the way a person types into TikTok's search box. sort is optional: relevance (the default) or most_liked. Each video in the page carries:

  • text (the caption), hashtags, published_at and url
  • author with handle, display name and verification
  • metrics.views, metrics.likes, metrics.comments, metrics.shares and metrics.favorites (saves)
  • images for photo posts, and with view=full the length, music title and region under ext

Price

You want Calls Cost
One page (about 30 videos) 1 $0.002
About 300 videos 10 $0.02
1,000 videos 34 $0.068

Each page is charged when it comes back, and calls that fail are not charged at all.

Try it

curl -s -G "https://api.okdata.online/v1/tiktok/videos/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode "query=sunscreen review" \
  -d sort=most_liked \
  -d fields=id,url,text,published_at,author.username,metrics

# next page: send page.next_cursor back as cursor
curl -s -G "https://api.okdata.online/v1/tiktok/videos/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode "query=sunscreen review" -d sort=most_liked \
  --data-urlencode "cursor=<page.next_cursor>"

What search will not do

  • There is no country or date filter. TikTok ranks by relevance or by likes, so sort=latest does not promise newest first; sort on published_at yourself and drop what is too old.
  • author.followers is empty inside search results. Look up the creators you care about with TikTok account profile.
  • When TikTok hides a play count, metrics.views is null and the field is named in meta.unavailable.
  • How many pages a keyword yields is up to TikTok. Stop when page.has_more is false.

Other ways to search TikTok

  • TikTok's Research API has keyword, date and region queries and costs nothing, but only approved non-profit academic researchers get access.
  • TikTokApi and similar open-source libraries drive a real browser. They are free and fine for a weekend project; expect bot checks and empty responses on a server.
  • The app itself is the right tool for a one-off look at twenty videos.

The content research page shows a full keyword study across platforms, and every TikTok price is on pricing.

Updated