On TikTok, timing is everything.
If you join a trend too early, nobody sees it. If you join too late, it's "cringe". You need to hit the sweet spot: right when the curve goes exponential.
But how do you know when that is?
In this guide, we'll build a TikTok Challenge Tracker using SociaVault. We'll monitor specific hashtags to calculate their "Viral Velocity".
The Strategy
We will write a script that:
- Searches for a hashtag (e.g.,
#75Hard). - Extracts the total view count.
- Calculates the growth rate.
Prerequisites
You'll need a SociaVault API key. You can get one here.
Step 1: Get Hashtag Stats
We'll use the /scrape/tiktok/search/hashtag endpoint.
const axios = require('axios');
const API_KEY = 'YOUR_SOCIAVAULT_API_KEY';
const BASE_URL = 'https://api.sociavault.com/v1';
async function getHashtagStats(hashtag) {
console.log(`š Checking stats for #${hashtag}...`);
try {
const response = await axios.get(`${BASE_URL}/scrape/tiktok/search/hashtag`, {
params: {
hashtag: hashtag,
region: 'US'
},
headers: { 'x-api-key': API_KEY }
});
if (response.data.success) {
// Note: The API returns a list of videos.
// To get the TOTAL views for the hashtag, we sum the top videos
// or use the challenge info if available in the metadata.
const videos = response.data.data;
let totalViews = 0;
let totalLikes = 0;
videos.forEach(video => {
totalViews += video.play_count;
totalLikes += video.digg_count;
});
return {
hashtag,
sampleSize: videos.length,
totalViews,
totalLikes,
avgViews: Math.round(totalViews / videos.length)
};
}
} catch (error) {
console.error("Error fetching hashtag:", error.message);
}
}
Step 2: Calculate Viral Velocity
One data point isn't enough. You need to track it over time.
// Simulated database of yesterday's stats
const history = {
'wesanderson': { views: 1000000, date: '2025-01-09' }
};
async function checkVelocity(hashtag) {
const current = await getHashtagStats(hashtag);
const previous = history[hashtag];
if (current && previous) {
const growth = current.totalViews - previous.views;
const percentGrowth = ((growth / previous.views) * 100).toFixed(2);
console.log(`\nš Velocity Report for #${hashtag}:`);
console.log(` Current Views: ${current.totalViews.toLocaleString()}`);
console.log(` Growth (24h): +${growth.toLocaleString()} (${percentGrowth}%)`);
if (percentGrowth > 20) {
console.log(" š„ STATUS: VIRAL (Join Now!)");
} else if (percentGrowth > 5) {
console.log(" š STATUS: Growing");
} else {
console.log(" š STATUS: Peaked/Stable");
}
}
}
// Run the check
checkVelocity('wesanderson');
Sample Output
š Checking stats for #wesanderson...
š Velocity Report for #wesanderson:
Current Views: 1,500,000
Growth (24h): +500,000 (50.00%)
š„ STATUS: VIRAL (Join Now!)
Why This Matters
For brands, jumping on a trend early can mean millions of free impressions.
For example, when the "Wes Anderson" trend started, the first few brands to participate got massive engagement. Those who joined 3 weeks later got very little.
By automating this tracking, you can get a daily email with the "Top 5 Rising Challenges" and brief your creative team immediately.
Get Started
Don't miss the next wave. Get your API key here.
Found this helpful?
Share it with others who might benefit
Ready to Try SociaVault?
Start extracting social media data with our powerful API. No credit card required.