Spot a trend while it is still early
Search a term once a day and rank the videos by views per day since they were posted. What climbs that list fastest is what is about to be everywhere.
GET tiktok/search | × 30 | 120 cr |
| a month, one term daily | 120 cr |
≈ $0.072 at the 250k pack
const API = 'https://api.scrapefield.com/v1';
const sf = (path, q) =>
fetch(API + '/' + path + '?' + new URLSearchParams(q), {
headers: { Authorization: 'Bearer ' + process.env.SCRAPEFIELD_KEY },
}).then((r) => r.json());
const q = { query: 'sourdough', type: 'video', limit: 30 };
const { data } = await sf('tiktok/search', q);
const ranked = data
.map((v) => {
const age = (Date.now() - Date.parse(v.create_time)) / 864e5;
const days = Math.max(age, 1);
return { url: v.share_url, perDay: Math.round(v.view_count / days) };
})
.sort((a, b) => b.perDay - a.perDay);
console.table(ranked.slice(0, 10));