Find viral TikTok videos for a keyword or hashtag
Search TikTok by keyword or hashtag and get captions, views, likes, shares, author and music as JSON for content and trend research.
Before you plan a TikTok video, a campaign or a product test, you need to know what already works in your niche. TikTok search shows a handful of videos at a time and gives you no way to export or rank them. Lovely Router runs the search for you. Send keywords or hashtags, get one JSON object per video with caption, views, likes, shares, author and music, pay per video from a prepaid balance.
Hand it to your AI agent
Copy this prompt into Claude Code, Cursor, Codex or any coding agent. It tells the agent where the docs are and how to use your API key.
Find viral TikTok videos for a keyword or hashtag. Use the Lovely Router data tools: each returns JSON and is billed per result.
- Docs (read first): https://lovelyrouter.com/docs/tools/find.md and https://lovelyrouter.com/docs/tools/run.md
- Plan first: POST https://lovelyrouter.com/v1/tools/suggest with `{"task": "<my task in plain words>"}` (free). It returns the tools to run in order, each with an example `input`, the `input_required` fields, an estimated cost and a ready-made `run` request. Replace the example values with my task's; if a field is unclear, read the tool with GET https://lovelyrouter.com/v1/tools/<id>. To browse instead, POST https://lovelyrouter.com/v1/tools/discover searches the catalog.
- Show me the plan and its estimated cost (`total_est_cost_usd`) before running anything large.
- Run: POST https://lovelyrouter.com/v1/tools/<id>/run with `{"input": {...}, "max_results": N}`. A 200 has the finished run with `items`; a 202 means it is still running, so poll the `poll` path until `status` is `succeeded`, `failed`, `timed_out` or `stopped`.
- Only delivered results are billed. Keep max_results small on the first run, check the output, then scale up.
- If you support MCP, connect https://lovelyrouter.com/mcp instead (Streamable HTTP, same key; https://lovelyrouter.com/docs/tools/mcp.md) and use suggest_tools, get_tool and run_tool.
- Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt.
My task: <the inputs (links, keywords or accounts) and how many results you need>How it works
Choose the keywords
List the terms your buyers use and the hashtags around your product. One keyword per entry.
Run the tool with a cap
Send them to
POST /v1/tools/tiktok-search/runwithmaxItemsin the input andmax_resultson the request. ChoosesortType,dateRangeandlocationto narrow the field.Rank and study the winners
Sort by views, likes or shares. Read the captions of the top ten, note the music and the authors, and see what they have in common.
Search TikTok videos with one request
Search TikTok videos takes keywords, or TikTok links in startUrls. sortType accepts RELEVANCE, MOST_LIKED or DATE_POSTED, and maxItems caps the results:
curl https://lovelyrouter.com/v1/tools/tiktok-search/run \
-H "Authorization: Bearer $LOVELY_API_KEY" \
-H "content-type: application/json" \
-d '{
"input": {
"keywords": [
"espresso"
],
"maxItems": 10,
"sortType": "RELEVANCE"
},
"max_results": 10
}'Sort order applies to keyword searches only, not to startUrls. Run a small cap first to see how the results look. A run still going after 60 seconds returns 202; Run a tool shows how to poll.
What each video holds
| Field group | What you get |
|---|---|
| Content | The video caption |
| Engagement | Views, likes and shares |
| Author | The account that posted the video |
| Audio | The music used |
dateRange accepts YESTERDAY, THIS_WEEK, THIS_MONTH, LAST_THREE_MONTHS, LAST_SIX_MONTHS, ALL_TIME or DEFAULT. location takes a two-letter country code.
Recipes
Search your category with dateRange set to THIS_WEEK and sortType set to MOST_LIKED. Keep the top 20 captions and sounds, and send the list to your content team every Monday.
Run five keywords, group the results by music, and count which sounds appear in the most videos.
Run each hashtag with the same cap and compare median views and shares. The one with higher shares is more likely to be passed around.
Use location to run the same keyword in two countries and see how the top videos differ.
Group videos by author and keep the accounts that appear more than once, then check them with tiktok-profile.
Prefer plain words? Connect the MCP server and tell Claude Code or Cursor: "Search TikTok for espresso, sorted by most liked this month, and list the top 25 with caption, views, shares and the sound used. Set max_results to 25."
Pair it with other TikTok tools
Search finds the videos. These tools explain why they work:
TikTok videos for keywords or hashtags: caption, views, likes, shares, author, music.
A TikTok account's videos with the author's follower and like counts.
Comments on a TikTok video by URL.
Spoken-word transcripts of TikTok videos by URL.
Shorts from YouTube channels: title, views, likes, comments, date.
tiktok-profilelists the videos of an account you found in the results.tiktok-commentsshows what viewers said under the top video.tiktok-transcriptgives the script behind a video that took off.youtube-shortslets you compare with short-form video on YouTube.
For picking creators from what you find, see influencer research.
What you pay
You pay per video: starting a run holds its maximum cost, the per-call fee plus the per-video fee times max_results, and the run settles to what it returned. The rest of the hold goes back to your balance. A run that fails or times out pays only for the videos it delivered, and a run refused at the start costs nothing.
Reading 100 videos is billed as 100 videos. There is no subscription and no monthly minimum: top up from $5, and one balance pays for tools and models. The card above shows today's price; pricing lists every tool.
Frequently asked questions
Can I search by hashtag?+
Yes. Pass the hashtag as a keyword, or paste a TikTok tag link into startUrls. Tag, user, music, location and search links are supported there.
How do I get only recent videos?+
Set dateRange. It works for keyword searches only and accepts values from YESTERDAY to LAST_SIX_MONTHS.
Can I search from a specific country?+
The input has a location field that takes a two-letter country code. Results then come from that region.
How many videos can one run return?+
The cap is maxItems, and the tool's maximum is 500 videos per run.
Do I need a subscription?+
No. You add credit to a prepaid balance and each run draws it down. Failed runs pay only for the videos they delivered, and nothing renews automatically.
Looking for more? See the rest of the tool catalog and the pricing page.