Trend detection with an API: catch rising sounds and topics
Trend detection with an API snapshots trending feeds and the usage counts of sounds and hashtags on a schedule, then flags items whose growth today is well above their recent average. Tracking 5 countries every 3 hours plus 150 watched sounds and hashtags daily costs about 7,380 credits a month on ScrapeIO, or $13.87 on the $47 pack.
A trend is something whose growth is speeding up, not something that is big. Big things are already on every list. Trend detection means taking repeated snapshots of counts, computing how fast they change, and alerting when the change is unusual. The data side is cheap; the value is in the math and the timing.
Who does this and why
- Content teams want to use a sound or format while it is still rising.
- Brand and product marketers watch for topics that touch their category.
- Music labels and artist teams track how fast a track's usage grows on TikTok and Instagram.
- Analysts and newsrooms want an early read on what people are starting to talk about.
For industry-level shifts in social data (pricing, access rules), see social media data trends in 2026. This page is about detecting content trends.
The data you need
| Step | Platform | Endpoint | Credits |
|---|---|---|---|
| 1. What is trending now | TikTok | TikTok trending feed | 1 |
| 1. What is trending now | X | X trends | 1 |
| 1. What is trending now | YouTube, Instagram | YouTube Shorts trending, Instagram reels trending | 1 |
| 2. Usage count over time | TikTok sounds | TikTok sound | 1 |
| 2. Usage count over time | TikTok hashtags | TikTok hashtag search | 1 |
| 3. Rising searches | TikTok, YouTube | TikTok search suggestions, YouTube typeahead | 1 |
| 4. Who is using it | TikTok, Instagram | TikTok sound videos, Instagram audio reels | 1 per page |
| Niche signals | Reddit, GitHub | Reddit subreddit posts, GitHub trending | 1 |
Worked example: 5 countries plus a watchlist
- TikTok trending feed, 5 countries, every 3 hours (8 a day): 5 x 8 = 40 credits a day.
- X trends, same schedule: 40 a day.
- YouTube Shorts and Instagram reels trending, 8 times a day each: 16 a day.
- A watchlist of 100 sounds, one usage snapshot a day: 100 a day.
- A watchlist of 50 hashtags, one snapshot a day: 50 a day.
That is 246 credits a day, 7,380 a month, or $13.87 on the $47 pack. Polling trending feeds faster than every 30 minutes adds nothing: repeats inside the cache window return the same answer, free. Every 2 to 3 hours is plenty for most teams.
Build the watchlist from the trending feeds. Every new sound that appears in a feed goes on the list and gets a daily snapshot until it has been flat for two weeks.
Code: snapshot sounds and compute growth
import requests, sqlite3, datetime
KEY = "YOUR_KEY"
db = sqlite3.connect("trends.db")
db.execute("create table if not exists sound (day, url, videos)")
WATCH = ["https://www.tiktok.com/music/original-sound-7000000000000000000"]
day = datetime.date.today().isoformat()
for url in WATCH:
r = requests.get("https://scrapeio.com/v1/tiktok/song", params={"url": url},
headers={"x-api-key": KEY}, timeout=60).json()
if r.get("success"):
db.execute("insert into sound values (?,?,?)", (day, url, r["data"]["videos"]))
db.commit()
def growth_ratio(url):
rows = [v for (v,) in db.execute(
"select videos from sound where url=? order by day desc limit 9", (url,))]
if len(rows) < 9:
return None
adds = [rows[i] - rows[i + 1] for i in range(8)] # daily new videos, newest first
base = sum(adds[1:]) / 7
return adds[0] / base if base else None
The sound endpoint returns videos, the number of videos using it. The daily difference is the number of new videos, which is the figure that moves first.
The formulas
- Daily adds = count today - count yesterday.
- Growth ratio = today's adds / average daily adds over the previous 7 days. Above 2 means it doubled its pace.
- Z-score = (today's adds - 7-day mean) / 7-day standard deviation. Above 3 is unusual for most items.
- Acceleration = growth ratio today - growth ratio yesterday. Positive two days in a row is a better signal than one spike.
- Spread = the number of countries whose trending feed shows the item. Two or more countries usually means it travels.
A practical alert rule: growth ratio at least 2, at least 500 new videos a day (so tiny bases do not trigger), and rising two days running. Tune the floor to your niche.
Pitfalls
- Small bases. Going from 3 to 12 videos is 4x growth and means nothing. Always pair a ratio with an absolute floor.
- Feeds are samples. A trending feed is what the platform shows from one region at one moment. Use it to find candidates, and use counts to measure them.
- Stale totals. Hashtag totals can update slower than sound counts. Prefer the count with the fastest refresh for velocity, and use hashtag totals for size.
- Weekly cycles. Usage dips at weekends in many niches. Compare to the same weekday, or use a 7-day baseline as above.
- Lifecycle. By the time a sound tops global charts, it is late. The window is when growth is high and the total is still modest.
Run it from an AI agent
The social-trend-research skill teaches an agent this workflow. With the MCP server connected:
Pull the TikTok trending feed for US, GB and DE and X trends for US.
List sounds and topics that appear in at least two of them.
For each sound, get its usage count and the top 5 videos using it,
and say what format those videos share.
The agent calls tiktok_trending_feed, twitter_trends, tiktok_song and tiktok_song_videos. Agents give a good snapshot; growth ratios need the stored history from the scheduled job.
Doing it with ScrapeIO
Trending feeds for TikTok, X, YouTube Shorts and Instagram reels, plus sound and hashtag counts, are all 1 credit, and repeats inside the cache window are free. A 5-country tracker with a 150-item watchlist costs about $14 a month.
100 free credits, no card. Credits never expire.
Get API key