Resumen
Este flujo de trabajo collects resenas de productos y menciones de Amazon y Reddit, assigns un basico sentiment puntuacion to cada, y rastrea como sentiment tendencias sobre time. It ayuda producto teams catch calidad problemas early, detectar el impact of nuevo lanzamientos, y monitorear competidor producto reception sin manual resena reading.
Desencadenador
Cron programar (diario at 11 AM UTC)
Programación
Ejecuta diario at 11 AM UTC
Pasos del flujo de trabajo
Define producto lista
Cargar el lista of your own productos y competidor productos to rastrear de configuracion.
Search Amazon y Reddit
Call el Scavio API on ambos plataformas for cada producto to retrieve reciente resenas y discussions.
Extraer resena text
Pull out el resena cuerpo, rating, y fragmento text de cada resultado.
Puntuacion sentiment
Apply un keyword-based o LLM-based sentiment scorer to cada resena. Clasificar as positive, neutral, o negative.
Agregar y tendencia
Compute el diario sentiment distribution y comparar it to el promedio movil de el past 7 dias.
Alert on shifts
Si negative sentiment exceeds el umbral o shifts significativamente, enviar un alerta to el producto team.
Implementacion en Python
import requests
import json
from pathlib import Path
API_KEY = "your_scavio_api_key"
POSITIVE_WORDS = {"great", "love", "excellent", "perfect", "best", "amazing"}
NEGATIVE_WORDS = {"broken", "terrible", "worst", "waste", "awful", "bad", "poor"}
def search_product(query: str, platform: str) -> list[dict]:
res = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": platform, "query": f"{query} reviews"},
timeout=15,
)
res.raise_for_status()
return res.json().get("organic", [])
def score_sentiment(text: str) -> str:
words = set(text.lower().split())
pos = len(words & POSITIVE_WORDS)
neg = len(words & NEGATIVE_WORDS)
if pos > neg:
return "positive"
if neg > pos:
return "negative"
return "neutral"
def run():
products = ["your-product-name", "competitor-product"]
results = []
for product in products:
for platform in ["amazon", "reddit"]:
items = search_product(product, platform)
for item in items:
text = item.get("snippet", "") or item.get("title", "")
sentiment = score_sentiment(text)
results.append({
"product": product,
"platform": platform,
"title": item.get("title", ""),
"sentiment": sentiment,
})
counts = {"positive": 0, "neutral": 0, "negative": 0}
for r in results:
counts[r["sentiment"]] += 1
print(f"Tracked {len(results)} mentions")
print(f"Sentiment: {json.dumps(counts)}")
neg_ratio = counts["negative"] / max(len(results), 1)
if neg_ratio > 0.4:
print("ALERT: Negative sentiment exceeds 40% threshold")
if __name__ == "__main__":
run()Implementacion en JavaScript
const API_KEY = "your_scavio_api_key";
const POSITIVE = new Set(["great", "love", "excellent", "perfect", "best", "amazing"]);
const NEGATIVE = new Set(["broken", "terrible", "worst", "waste", "awful", "bad", "poor"]);
async function searchProduct(query, platform) {
const res = await fetch("https://api.scavio.dev/api/v1/search", {
method: "POST",
headers: {
"x-api-key": API_KEY,
"content-type": "application/json",
},
body: JSON.stringify({ platform, query: `${query} reviews` }),
});
if (!res.ok) throw new Error(`scavio ${res.status}`);
const data = await res.json();
return data.organic ?? [];
}
function scoreSentiment(text) {
const words = new Set(text.toLowerCase().split(/\s+/));
let pos = 0, neg = 0;
for (const w of words) {
if (POSITIVE.has(w)) pos++;
if (NEGATIVE.has(w)) neg++;
}
if (pos > neg) return "positive";
if (neg > pos) return "negative";
return "neutral";
}
async function run() {
const products = ["your-product-name", "competitor-product"];
const results = [];
for (const product of products) {
for (const platform of ["amazon", "reddit"]) {
const items = await searchProduct(product, platform);
for (const item of items) {
const text = item.snippet ?? item.title ?? "";
results.push({
product,
platform,
title: item.title ?? "",
sentiment: scoreSentiment(text),
});
}
}
}
const counts = { positive: 0, neutral: 0, negative: 0 };
for (const r of results) counts[r.sentiment]++;
console.log(`Tracked ${results.length} mentions`);
console.log("Sentiment:", JSON.stringify(counts));
const negRatio = counts.negative / Math.max(results.length, 1);
if (negRatio > 0.4) {
console.log("ALERT: Negative sentiment exceeds 40% threshold");
}
}
run();Plataformas utilizadas
Amazon
Búsqueda de productos con precios, calificaciones y reseñas
Comunidad, publicaciones y comentarios en hilos de cualquier subreddit