Resumen
Monitorear un establecer of TikTok hashtags cada hora to detectar trending momentum antes de competidores notice. Pull hashtag metadata (view conteo, video conteo) y el ultimo videos posted bajo cada hashtag. Calcular view velocity y marcar hashtags con accelerating crecimiento.
Desencadenador
Hourly cron at :00
Programación
Hourly at :00
Pasos del flujo de trabajo
Cargar hashtag watchlist
Leer objetivo hashtags de config. Cada entrada tiene el hashtag nombre y el anterior hour's view conteo for delta calculation.
Pull hashtag metadata
For cada hashtag, call el hashtag endpoint to obtener actual total view conteo y video conteo.
Obtener ultimo videos
Call hashtag/videos to obtener el 20 mas reciente videos. Extraer publicacion times, view counts, y creator info.
Calcular velocity
Comparar actual view conteo to anterior hora. Marcar hashtags gaining mas than 10% per hora as trending.
Alert on breakout hashtags
Enviar un notificacion (Slack, correo electronico, webhook) for hashtags ese cross el velocity umbral. Include el top 3 videos driving crecimiento.
Implementacion en Python
import requests, os, json, time
H = {"Authorization": f"Bearer {os.environ['SCAVIO_API_KEY']}", "Content-Type": "application/json"}
BASE = "https://api.scavio.dev"
STATE_FILE = "hashtag_state.json"
def load_state():
try:
with open(STATE_FILE) as f: return json.load(f)
except FileNotFoundError: return {}
def track_hashtags(hashtags):
state = load_state()
alerts = []
for tag in hashtags:
resp = requests.post(f"{BASE}/api/v1/tiktok/hashtag",
headers=H, json={"hashtag": tag}).json()
data = resp["data"]
views = data.get("stats", {}).get("view_count", 0)
videos = data.get("stats", {}).get("video_count", 0)
prev = state.get(tag, {}).get("views", views)
delta = (views - prev) / prev * 100 if prev > 0 else 0
state[tag] = {"views": views, "videos": videos, "ts": int(time.time())}
if delta > 10:
alerts.append({"hashtag": tag, "delta_pct": round(delta, 1), "views": views})
with open(STATE_FILE, "w") as f: json.dump(state, f)
return alerts
alerts = track_hashtags(["skincare", "booktok", "techreview"])
for a in alerts:
print(f"#{a['hashtag']} trending: +{a['delta_pct']}% ({a['views']:,} views)")Implementacion en JavaScript
const BASE = "https://api.scavio.dev";
const H = { Authorization: `Bearer ${process.env.SCAVIO_API_KEY}`, "Content-Type": "application/json" };
const fs = require("fs");
async function trackHashtag(tag, prevViews = 0) {
const resp = await fetch(`${BASE}/api/v1/tiktok/hashtag`, {
method: "POST", headers: H, body: JSON.stringify({ hashtag: tag })
}).then(r => r.json());
const views = resp.data?.stats?.view_count || 0;
const delta = prevViews > 0 ? ((views - prevViews) / prevViews * 100) : 0;
if (delta > 10) console.log(`#${tag} TRENDING: +${delta.toFixed(1)}% (${views.toLocaleString()} views)`);
return { tag, views, delta };
}
trackHashtag("skincare", 1000000);Plataformas utilizadas
TikTok
Descubrimiento de videos, creadores y productos en tendencia