Short answer: send the hashtag, with the #, as the query to /tiktok/search. The answer is a list of videos with caption, hashtags, views, likes, comments, shares, saves and author. On 4 December 2026 #latteart returned 16 videos, 15 of them tagged #latteart, and #booktok returned 16 of 16.
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":"#latteart"}'
What came back
| request (4 December 2026) | videos | carrying the hashtag | next cursor |
|---|---|---|---|
{"q":"#latteart"} | 16 | 15 | "16" |
{"q":"#latteart","cursor":"16"} | 16 new ones | 11 | "32" |
{"q":"#booktok"} | 16 | 16 | "16" |
One video, shortened:
{
"id": "7078877428164267310",
"text": "Start with a heart! #Goldenbrowncoffee #coffeetiktok #barista #learnontiktok #homecafe #foodietiktok #coffeeart #latteart #espresso #coffee",
"hashtags": ["goldenbrowncoffee", "coffeetiktok", "barista", "learnontiktok", "homecafe", "foodietiktok", "coffeeart", "latteart", "espresso", "coffee"],
"views_count": "5700000",
"likes_count": "257900",
"comments_count": "1432",
"shares_count": "9488",
"saves_count": "123315",
"published_at": "2022-03-25T03:39:49Z",
"link": "https://www.tiktok.com/@goldenbrown.coffee/video/7078877428164267310",
"author": {
"username": "goldenbrown.coffee",
"name": "Golden Brown Coffee",
"followers_count": "682500"
}
}
Across the 32 #latteart videos the hashtags used most often next to it were #coffee (13 videos), #barista (7), #lattearttutorial (7), #fyp (6) and #coffeeart (5) — a quick way to find neighbouring tags.
Python: two pages, tagged videos only, related hashtags
import collections, time, requests
TAG = "latteart"
def page(cursor=None):
body = {"q": "#" + TAG}
if cursor:
body["cursor"] = cursor
r = requests.post(
"https://api.serpbase.dev/tiktok/search",
headers={"X-API-Key": "YOUR_API_KEY"},
json=body,
timeout=60,
).json()
if r["status"] != 0:
raise RuntimeError(r.get("error"))
return r["posts"], r["pagination"]
videos, cursor = {}, None
for _ in range(2):
posts, paging = page(cursor)
for p in posts:
videos[p["id"]] = p
if not paging.get("has_more"):
break
cursor = paging["next_cursor"]
time.sleep(1)
tagged = [v for v in videos.values() if TAG in [h.lower() for h in v.get("hashtags", [])]]
print(len(videos), "videos,", len(tagged), "tagged #" + TAG)
for v in sorted(tagged, key=lambda v: int(v["views_count"]), reverse=True)[:5]:
print(f'{int(v["views_count"]):>10,} @{v["author"]["username"]} {v["link"]}')
related = collections.Counter(h.lower() for v in tagged for h in v.get("hashtags", []) if h.lower() != TAG)
print(related.most_common(8))
Things that trip people up
- It is a search for the hashtag, not TikTok's hashtag page. Most results carry the tag, but not all: 26 of our 32 #latteart videos did. Filter on the
hashtagslist when you need only tagged videos. hashtagscome without the#and in the case the creator typed. Compare in lower case.- Counts are strings.
"views_count": "5700000"— convert withint()before sorting or adding. - Results are not sorted by date. The top #latteart video was from 2022. Sort by
published_atyourself if you want recent ones. - Paging uses a cursor. Send back
pagination.next_cursorascursor; the two pages we fetched had no video in common. - No total count. The endpoint does not return how many videos use a hashtag overall.
Related
- TikTok Search API: videos by keyword
- TikTok Post API: one video's numbers
- TikTok Profile API: followers and video counts
Cost and docs
A TikTok search is 1 credit per page; credits cost $0.25–$0.50 per 1,000 depending on the pack. Failed requests are not charged, and new accounts get 500 free credits.
- Parameters and fields: TikTok Search docs
- Try it in the browser: TikTok Search API
- Credit packs: pricing