Track TikTok trends for a niche every morning
Pull TikTok search and hashtag data on a daily schedule, extract transcripts and comments, and see what a full week of tracking costs.
Nov 15, 2026 · 6 min read

A morning TikTok tracker for one niche costs $1.00 a week when you pull 200 search and hashtag results a day, grab full transcripts for the top 20 breakout clips, and summarize the hooks with an LLM. Expand that job to creator profiles, thousands of viewer comments, and production briefs written with Claude Sonnet 5.5, and a full week costs $4.95.
Use a data tool for agents as your tiktok trend tracking api and you skip browser cookies, residential proxies, and brittle DOM parsers. Your cron job or scheduled agent calls tiktok-search, filters the JSON by play-to-age velocity, calls tiktok-transcript on the winners, and sends the text to an LLM on the same Lovely Router API key.
Why manual scrolling misses niche trends#
Opening TikTok on a phone shows you what the consumer algorithm wants you to watch, not a full picture of your market. The feed mixes watch history, device location, and broad entertainment. Train a dedicated account on home espresso gear, B2B payroll software, or magnesium supplements and you still miss posts with high engagement velocity in small pockets that have not reached the main feed.
A homemade tiktok scraper for agents built on headless browsers hits a different wall: session rot. TikTok rotates web signatures, throws puzzle captchas at automated browsers, and throttles IP ranges when you query several hashtags in a row. A cron job that dies every third Tuesday because a cookie expired is useless for daily tracking.
A scheduled agent needs structured records on demand. For each video that matches a keyword or hashtag, you want the video ID, creation timestamp, author handle, play count, digg (like) count, comment count, share count, music metadata, and caption text. With those fields in plain JSON, fifty lines of Python can score velocity and pick the clips worth reading in full.
The four tools that power a morning trend run#
Lovely Router exposes four TikTok social listening and extraction tools alongside Claude, GPT, and Gemini on one prepaid API key:
- Search TikTok videos (
tiktok-search): queries keywords and hashtags and returns video metadata, author stats, sound details, and engagement counts at $0.00045 per video ($0.45 per 1,000). - Get TikTok transcripts (
tiktok-transcript): extracts the spoken transcript with timestamps from a video at $0.0015 per transcript ($1.50 per 1,000). - Get TikTok profile videos (
tiktok-profile): pulls the recent video feed from specific competitor or creator handles at $0.00045 per video ($0.45 per 1,000). - List TikTok comments (
tiktok-comments): fetches viewer comments on a video to capture product questions, objections, and slang at $0.00045 per comment ($0.45 per 1,000).
None of the four tools charges a per-run base fee. Fetch 20 videos for a query and you pay for those 20 videos. Call tiktok-transcript only on the videos that pass your velocity filter, and you avoid transcribing every search result.
How the daily pipeline filters noise before calling the model#
A practical morning job runs at 6:00 AM via cron, a scheduled automation job, or a workflow runner. Do not dump every raw search result into an LLM context window. Run a three-stage funnel.
First, define niche queries and hashtags. For a skincare brand, that might be five product keywords (azelaic acid serum, barrier repair cream, fungal acne cleanser, retinoid purge, peptides routine) and five hashtags (#skintok, #dermatologistreacts, #acneroutine, #glassskinroutine, #skincarechemist). Twenty recent videos per term is 200 videos each morning.
Second, drop video IDs you have already stored in a local database or a JSON state file, then score what is new. Raw play count favors old videos from huge accounts. Velocity and share ratio show what is taking off now:
$$\text{Velocity} = \frac{\text{Plays}}{\max(\text{Hours since upload}, 1)}$$
$$\text{Share Ratio} = \frac{\text{Shares}}{\max(\text{Plays}, 1)}$$
A video uploaded 14 hours ago with high hourly plays and a strong share-to-play ratio is one people are sending to friends or saving to buy. Cut the 200 daily candidates down to the top 20 breakout videos.
Third, pass only those 20 video IDs to tiktok-transcript. The agent now has the spoken hook, the middle explanation, and the call to action for the day's fastest clips. Send those 20 transcripts plus metadata to gemini-3-flash or claude-sonnet-5.5 on the same API key to group the angles and write the morning brief.
import os
import time
import json
from urllib.request import Request, urlopen
API_KEY = os.environ["LOVELYROUTER_API_KEY"]
BASE_URL = "https://api.lovelyrouter.com/v1"
HEADERS = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}
QUERIES = [
"azelaic acid serum",
"barrier repair cream",
"#skintok",
"#dermatologistreacts",
]
def run_tool(tool_id: str, payload: dict) -> dict:
body = json.dumps(payload).encode()
req = Request(
f"{BASE_URL}/tools/{tool_id}",
data=body,
headers=HEADERS,
method="POST",
)
with urlopen(req, timeout=60) as resp:
return json.load(resp)
def collect_morning_winners() -> list[dict]:
now = time.time()
seen_ids = set()
candidates = []
for query in QUERIES:
data = run_tool("tiktok-search", {"query": query, "limit": 20})
for video in data.get("items", []):
vid = video["id"]
if vid in seen_ids:
continue
seen_ids.add(vid)
created_at = video.get("createTime", now - 86400)
age_hours = max((now - created_at) / 3600.0, 1.0)
plays = video.get("stats", {}).get("playCount", 0)
shares = video.get("stats", {}).get("shareCount", 0)
if age_hours <= 72 and plays > 0:
video["velocity"] = plays / age_hours
video["share_ratio"] = shares / plays
candidates.append(video)
candidates.sort(key=lambda x: (x["velocity"], x["share_ratio"]), reverse=True)
top_videos = candidates[:20]
for video in top_videos:
tx = run_tool("tiktok-transcript", {"video_id": video["id"]})
video["transcript"] = tx.get("transcript", "")
return top_videos
def summarize_trends(winners: list[dict]) -> str:
digest_lines = []
for v in winners:
digest_lines.append(
f"Author: @{v['author']['uniqueId']} | Velocity: {v['velocity']:.0f}/hr | "
f"Shares: {v['stats']['shareCount']}\n"
f"Caption: {v.get('desc', '')}\n"
f"Transcript: {v.get('transcript', '')}\n"
)
prompt = (
"Group these breakout TikTok videos into recurring hooks and topic angles. "
"Quote the exact opening line from the top three transcripts and suggest "
"two repeatable video concepts for our brand today.\n\n"
+ "\n---\n".join(digest_lines)
)
body = json.dumps({
"model": "gemini-3-flash",
"messages": [{"role": "user", "content": prompt}],
}).encode()
req = Request(
f"{BASE_URL}/chat/completions",
data=body,
headers=HEADERS,
method="POST",
)
with urlopen(req, timeout=60) as chat_resp:
data = json.load(chat_resp)
return data["choices"][0]["message"]["content"]
if __name__ == "__main__":
winners = collect_morning_winners()
report = summarize_trends(winners)
print(report)Both /v1/tools/tiktok-search and /v1/chat/completions authenticate with the same LOVELYROUTER_API_KEY. Data collection and model inference share one billing account.
What to measure when you run your own benchmark#
Niches move at different speeds. Run the script for three mornings and log two ratios before you lock the schedule.
Freshness ratio is how many videos from your tiktok-search queries were published in the last 48 hours, versus older evergreen videos that still rank for the keyword. If a broad hashtag returns mostly six-month-old hits, swap it for a tighter phrase or add a recency sort parameter to the request payload.
Transcript hit rate is the share of your top 20 velocity videos that return spoken dialogue from tiktok-transcript, versus music-only montages or text-on-screen slideshows. In talking-head niches like finance, SaaS, and supplements, most breakout clips have dense spoken hooks. In visual niches like outfit styling or home decor, more clips lean on background audio and caption text, so the prompt should weight the desc caption and sound title alongside the transcript.
What a week of tracking costs#
Two weekly setups: a lean morning tracker for a founder watching one niche, and a deeper radar for a growth team tracking keywords, creator profiles, and comment sections.
Case 1: Lean morning niche tracker ($1.00 per week)#
Track 10 search terms and hashtags every morning at 20 videos per query (200 videos a day, or 1,400 videos across 7 days). Each morning the velocity filter picks the top 20 breakout videos for full transcription (140 transcripts a week). Pass the filtered metadata and transcripts into Gemini 3 Flash (gemini-3-flash), using 200,000 input tokens and 20,000 output tokens over the week.
| Item | Weekly volume | Catalog price | Weekly cost |
|---|---|---|---|
Search TikTok videos (tiktok-search) | 1,400 videos | $0.45 per 1,000 | $0.63 |
Get TikTok transcripts (tiktok-transcript) | 140 transcripts | $1.50 per 1,000 | $0.21 |
Gemini 3 Flash (gemini-3-flash) input | 0.20M tokens | $0.50 per 1M | $0.10 |
Gemini 3 Flash (gemini-3-flash) output | 0.02M tokens | $3.00 per 1M | $0.06 |
| Total | $1.00 |
At $1.00 per week, the data tools account for $0.63 + $0.21 = $0.84 and the LLM summarization accounts for $0.10 + $0.06 = $0.16.
Case 2: Deep niche radar with profiles and comments ($4.95 per week)#
If the team also runs influencer research and mines viewer comments for ad copy, a 7-day week looks like this. The schedule pulls 4,000 videos via tiktok-search, checks recent uploads across a watchlist of niche creators totaling 1,000 profile videos via tiktok-profile, transcribes 200 breakout videos with tiktok-transcript, and pulls 2,000 viewer comments on those winners with tiktok-comments to see what buyers are asking. Transcripts and comment threads go to Claude Sonnet 5.5 (claude-sonnet-5.5) for hook analysis and script writing (500,000 input tokens and 50,000 output tokens over the week).
| Item | Weekly volume | Catalog price | Weekly cost |
|---|---|---|---|
Search TikTok videos (tiktok-search) | 4,000 videos | $0.45 per 1,000 | $1.80 |
Get TikTok profile videos (tiktok-profile) | 1,000 videos | $0.45 per 1,000 | $0.45 |
Get TikTok transcripts (tiktok-transcript) | 200 transcripts | $1.50 per 1,000 | $0.30 |
List TikTok comments (tiktok-comments) | 2,000 comments | $0.45 per 1,000 | $0.90 |
Claude Sonnet 5.5 (claude-sonnet-5.5) input | 0.50M tokens | $2.00 per 1M | $1.00 |
Claude Sonnet 5.5 (claude-sonnet-5.5) output | 0.05M tokens | $10.00 per 1M | $0.50 |
| Total | $4.95 |
Turning the morning brief into an actionable queue#
The tracker only helps if someone acts before the trend peaks. Shape the LLM prompt so the morning message lands in a team chat, a community channel, or email with three fixed blocks:
- Three verbatim hooks: the exact first five seconds spoken in the fastest-growing clips, paired with a link to the original video so your creator or founder can watch the pacing and visual framing.
- Repeated viewer questions: phrases pulled from
tiktok-commentsthat start with "where do I", "does this work with", or "is there a cheaper", which double as scripts for reply videos and FAQ ads. - Breakout audio and formats: any sound ID or visual format that showed up across two or more independent creators in the same morning run.
Set up your first morning run#
Create one prepaid API key, pick five keywords and five hashtags for your niche, and run the script above against the documentation to get your first morning report in under ten minutes.
Try it yourself
One prepaid key, no subscription. Every price in this article is the price you pay.
Keep reading
All articles →
Pull 500 Google Maps leads into a spreadsheet with one prompt
Use a Google Maps leads scraper tool inside an AI agent to pull 500 local businesses with emails into a CSV for `500 places × $0.00051 per place = $0.255` in data costs.

How to Automate Login with 2FA Using a Browser Agent
Automate login with 2FA safely by pairing an AI browser agent with vault secrets and local TOTP tools so credentials never enter the LLM prompt.

Give Claude Code web search and a browser in one command
Add a remote MCP server to Claude Code in one terminal command for live web search, page crawling, and browser screenshots on one prepaid API key.