Resumen
Takes un CSV of company names, searches for cada company via Google search API, extrae sitio web URL, company descripcion, y reciente news fragmentos, entonces salidas un enriquecido CSV listo for personalized outreach.
Desencadenador
Manual activar o webhook (e.g., on nuevo CSV subir to S3 o form submission)
Programación
Manual o webhook-activado
Pasos del flujo de trabajo
Leer entrada CSV
Analizar entrada CSV columnas: company_name (requerido), industria (optional). Validar y deduplicate entradas.
Search for company info
For cada company, POST to Scavio search API con consulta '[company_name] official sitio web'. Extraer top resultado URL y fragmento.
Search for reciente news
Second search per company: '[company_name] news 2026'. Extraer top 2 news fragmentos for context in personalization.
Extraer company descripcion
From el first search resultado fragmento, extraer un 1-2 sentence company descripcion. Eliminar boilerplate ('Visit us', 'Learn mas').
Assemble enriquecido fila
Combine original campos con: website_url, company_description, recent_news_1, recent_news_2, search_date.
Salida enriquecido CSV
Escribir enriquecido filas to salida CSV. Log companies donde search returned no usable datos for manual resena.
Implementacion en Python
import csv
import requests
import re
from datetime import date
import time
SCRAVIO_KEY = "YOUR_API_KEY"
INPUT_CSV = "leads.csv"
OUTPUT_CSV = "leads_enriched.csv"
def search(query: str) -> list:
resp = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": SCRAVIO_KEY},
json={"query": query, "platform": "google", "num": 5}
)
resp.raise_for_status()
return resp.json().get("results", [])
def clean_snippet(snippet: str) -> str:
junk = ["Visit", "Learn more", "Click here", "Sign up", "Subscribe"]
for j in junk:
snippet = snippet.replace(j, "").strip()
return snippet[:200]
def enrich_company(company_name: str) -> dict:
# Company website + description
site_results = search(f"{company_name} official website")
website_url = site_results[0]["url"] if site_results else ""
description = clean_snippet(site_results[0].get("snippet", "")) if site_results else ""
time.sleep(0.2)
# Recent news
news_results = search(f"{company_name} news 2026")
news_1 = clean_snippet(news_results[0].get("snippet", "")) if len(news_results) > 0 else ""
news_2 = clean_snippet(news_results[1].get("snippet", "")) if len(news_results) > 1 else ""
time.sleep(0.2)
return {
"website_url": website_url,
"company_description": description,
"recent_news_1": news_1,
"recent_news_2": news_2,
"search_date": date.today().isoformat()
}
def run():
with open(INPUT_CSV) as f:
reader = csv.DictReader(f)
rows = list(reader)
enriched = []
for row in rows:
company = row["company_name"].strip()
if not company:
continue
extra = enrich_company(company)
enriched.append({**row, **extra})
print(f"Enriched: {company}")
if not enriched:
return
fieldnames = list(enriched[0].keys())
with open(OUTPUT_CSV, "w", newline="") as f:
writer = csv.DictWriter(f, fieldnames=fieldnames)
writer.writeheader()
writer.writerows(enriched)
print(f"Done. {len(enriched)} companies enriched -> {OUTPUT_CSV}")
if __name__ == "__main__":
run()
Implementacion en JavaScript
const fs = require('fs');
const { parse } = require('csv-parse/sync');
const { stringify } = require('csv-stringify/sync');
const fetch = require('node-fetch');
const SCRAVIO_KEY = 'YOUR_API_KEY';
const INPUT_CSV = 'leads.csv';
const OUTPUT_CSV = 'leads_enriched.csv';
async function search(query) {
const res = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: { 'x-api-key': SCRAVIO_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ query, platform: 'google', num: 5 })
});
return (await res.json()).results || [];
}
function cleanSnippet(s) {
return (s || '').replace(/Visit|Learn more|Click here|Sign up/g, '').trim().slice(0, 200);
}
async function enrichCompany(name) {
const siteResults = await search(`${name} official website`);
const website_url = siteResults[0]?.url || '';
const company_description = cleanSnippet(siteResults[0]?.snippet);
await new Promise(r => setTimeout(r, 200));
const news = await search(`${name} news 2026`);
const recent_news_1 = cleanSnippet(news[0]?.snippet);
const recent_news_2 = cleanSnippet(news[1]?.snippet);
await new Promise(r => setTimeout(r, 200));
return { website_url, company_description, recent_news_1, recent_news_2, search_date: new Date().toISOString().slice(0, 10) };
}
async function run() {
const rows = parse(fs.readFileSync(INPUT_CSV), { columns: true, skip_empty_lines: true });
const enriched = [];
for (const row of rows) {
const name = (row.company_name || '').trim();
if (!name) continue;
const extra = await enrichCompany(name);
enriched.push({ ...row, ...extra });
console.log(`Enriched: ${name}`);
}
fs.writeFileSync(OUTPUT_CSV, stringify(enriched, { header: true }));
console.log(`Done. ${enriched.length} companies -> ${OUTPUT_CSV}`);
}
run().catch(console.error);
Plataformas utilizadas
Búsqueda web con grafo de conocimiento, PAA y resúmenes de IA