Google review data provides strong signals for B2B lead scoring. A business with many recent reviews and a moderate rating often needs help improving customer experience. A business with a high rating and steady review growth is a strong partnership prospect. This tutorial shows how to build a lead scoring system that uses Google review data to prioritize outreach. You will create a scoring model that combines rating, review count, and response patterns into a single quality score.
Prerequisites
- Python 3.8+ installed
- requests library installed
- A Scavio API key from scavio.dev
- A list of prospect businesses or categories to score
Walkthrough
Step 1: Fetch review data for businesses
Query Google Maps for businesses and extract review data for scoring.
import os, requests, json
API_KEY = os.environ["SCAVIO_API_KEY"]
def get_businesses(query):
resp = requests.post("https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "google", "query": query, "type": "maps"})
return resp.json().get("local_results", [])Step 2: Build the scoring model
Create a scoring function that weighs rating, review volume, and review quality.
def score_lead(business):
rating = float(business.get("rating", 0))
reviews = int(business.get("reviews", 0))
rating_score = max(0, (5 - rating) * 25)
volume_score = min(reviews / 2, 100)
combined = round(rating_score * 0.5 + volume_score * 0.5)
return {
"name": business.get("title", ""),
"rating": rating,
"reviews": reviews,
"rating_score": round(rating_score),
"volume_score": round(volume_score),
"lead_score": combined,
"priority": "high" if combined >= 60 else "medium" if combined >= 30 else "low",
}Step 3: Enrich scored leads
Add contact and website data to the top-scored leads.
def enrich_scored_lead(lead):
resp = requests.post("https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "google", "query": f"{lead['name']} contact website"})
results = resp.json().get("organic_results", [])[:2]
lead["website"] = results[0].get("link", "") if results else ""
return leadStep 4: Export scored leads
Save the scored and enriched leads for outreach prioritization.
import csv
def export_scored(leads, filename):
with open(filename, "w", newline="") as f:
fields = ["name", "rating", "reviews", "lead_score", "priority", "website"]
w = csv.DictWriter(f, fieldnames=fields, extrasaction="ignore")
w.writeheader()
w.writerows(leads)
print(f"Exported {len(leads)} scored leads to {filename}")Python Example
import os, requests
API_KEY = os.environ["SCAVIO_API_KEY"]
resp = requests.post("https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "google", "query": "restaurants in Denver CO", "type": "maps"})
for b in resp.json().get("local_results", [])[:5]:
r = float(b.get("rating", 0))
score = round((5 - r) * 25 * 0.5 + min(int(b.get("reviews",0))/2, 100) * 0.5)
print(f"{b['title']}: score={score}, rating={r}")JavaScript Example
const H = {"x-api-key": process.env.SCAVIO_API_KEY, "Content-Type": "application/json"};
const r = await fetch("https://api.scavio.dev/api/v1/search", {
method: "POST", headers: H,
body: JSON.stringify({platform: "google", query: "restaurants in Denver CO", type: "maps"})
});
(await r.json()).local_results.slice(0,5).forEach(b => {
const score = Math.round((5-parseFloat(b.rating||0))*25*0.5 + Math.min(parseInt(b.reviews||0)/2,100)*0.5);
console.log(b.title, "score:", score);
});Expected Output
A scored list of B2B leads ranked by review-based quality score, with contact enrichment and priority classification for outreach campaigns.