La surveillance de marque est essentielle pour la gestion de la réputation, la réponse RP et l'intelligence concurrentielle. Savoir quand votre marque est mentionnée dans Google News, les résultats organiques et YouTube vous permet de réagir rapidement aux articles et de mesurer l'impact des campagnes marketing. Ce tutoriel construit un script de surveillance multi-plateforme qui interroge Google et YouTube pour les mentions de marque, déduplique les résultats et envoie un résumé quotidien des nouvelles mentions.
Prérequis
- Python 3.8 ou supérieur
- bibliothèque requests installée
- Une clé API Scavio
- Un nom de marque et des noms de concurrents optionnels à suivre
Parcours
Étape 1: Définir les marques à surveiller
Configurez une liste de noms de marque et de variantes à suivre. Incluez les fautes d'orthographe courantes ou les noms de produits si pertinent.
BRANDS = ["Scavio", "scavio.dev", "Scavio API"]
MONITOR_COMPETITORS = ["SerpAPI", "Bright Data"]Étape 2: Récupérer les mentions Google
Interrogez Google pour chaque nom de marque et collectez les résultats organiques et les résultats d'actualités comme candidats de mentions.
def google_mentions(brand: str) -> list[dict]:
data = search_google(brand)
mentions = data.get("organic_results", [])
mentions += data.get("news_results", [])
return [{"source": "google", "title": m.get("title"), "link": m.get("link"), "date": m.get("date")} for m in mentions]Étape 3: Récupérer les mentions YouTube
Recherchez YouTube pour chaque nom de marque et collectez les titres et les URL des vidéos comme mentions.
def youtube_mentions(brand: str) -> list[dict]:
r = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "youtube", "query": brand}
)
r.raise_for_status()
videos = r.json().get("videos", [])
return [{"source": "youtube", "title": v.get("title"), "link": v.get("url"), "date": v.get("published_at")} for v in videos]Étape 4: Fusionner et dédupliquer
Combinez les mentions Google et YouTube, dédupliquez par URL et triez par date.
def collect_mentions(brand: str) -> list[dict]:
mentions = google_mentions(brand) + youtube_mentions(brand)
seen = {}
for m in mentions:
if m["link"] not in seen:
seen[m["link"]] = m
return list(seen.values())Exemple Python
import os
import requests
API_KEY = os.environ.get("SCAVIO_API_KEY", "your_scavio_api_key")
ENDPOINT = "https://api.scavio.dev/api/v1/search"
BRANDS = ["Scavio", "Scavio API"]
def search(platform: str, query: str, extra: dict = {}) -> dict:
body = {"platform": platform, "query": query, **extra} if platform != "google" else {"query": query, "country_code": "us"}
r = requests.post(ENDPOINT, headers={"x-api-key": API_KEY}, json=body)
r.raise_for_status()
return r.json()
def monitor(brand: str) -> list[dict]:
g = search("google", brand)
y = search("youtube", brand)
mentions = []
for m in g.get("organic_results", [])[:5]:
mentions.append({"src": "google", "title": m.get("title"), "url": m.get("link")})
for v in y.get("videos", [])[:5]:
mentions.append({"src": "youtube", "title": v.get("title"), "url": v.get("url")})
return mentions
if __name__ == "__main__":
for brand in BRANDS:
print(f"\n=== {brand} ===")
for m in monitor(brand):
print(f"[{m['src']}] {m['title']}")Exemple JavaScript
const API_KEY = process.env.SCAVIO_API_KEY || "your_scavio_api_key";
const ENDPOINT = "https://api.scavio.dev/api/v1/search";
const BRANDS = ["Scavio", "Scavio API"];
async function search(platform, query) {
const body = platform === "google" ? { query, country_code: "us" } : { platform, query };
const res = await fetch(ENDPOINT, {
method: "POST",
headers: { "x-api-key": API_KEY, "Content-Type": "application/json" },
body: JSON.stringify(body)
});
return res.json();
}
async function monitor(brand) {
const [g, y] = await Promise.all([search("google", brand), search("youtube", brand)]);
const mentions = [];
(g.organic_results || []).slice(0, 5).forEach(m => mentions.push({ src: "google", title: m.title, url: m.link }));
(y.videos || []).slice(0, 5).forEach(v => mentions.push({ src: "youtube", title: v.title, url: v.url }));
return mentions;
}
async function main() {
for (const brand of BRANDS) {
console.log(`\n=== ${brand} ===`);
const m = await monitor(brand);
m.forEach(item => console.log(`[${item.src}] ${item.title}`));
}
}
main().catch(console.error);Sortie attendue
=== Scavio ===
[google] Scavio Review: Real-Time Search API for AI Agents
[google] Scavio vs SerpAPI: Which Is Better in 2026?
[youtube] I Built an AI Agent with Scavio - Full Tutorial
[youtube] Scavio API vs Bright Data Comparison