One-page audits are a proven lead magnet for agencies and SaaS companies: you audit a prospect's website and deliver a concise report showing what they can improve. Enriching these audits with live search data makes them dramatically more valuable because they include real competitor rankings, content gaps, and keyword opportunities. This tutorial shows how to build an automated one-page audit enrichment pipeline that takes a domain, queries live SERP data, and generates a rich audit with actionable insights.
Prerequisites
- Python 3.8+ installed
- requests library installed
- A Scavio API key from scavio.dev
- A prospect domain to audit
Walkthrough
Step 1: Set up the audit pipeline
Configure the API client and define the audit structure.
import os, requests, json
API_KEY = os.environ["SCAVIO_API_KEY"]
def search(query):
resp = requests.post("https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "google", "query": query})
return resp.json()Step 2: Audit site visibility
Check how many pages the prospect's domain has indexed and what ranks.
def audit_visibility(domain):
data = search(f"site:{domain}")
results = data.get("organic_results", [])
return {
"domain": domain,
"indexed_pages_sample": len(results),
"top_pages": [{"title": r["title"], "url": r.get("link", "")}
for r in results[:5]],
}Step 3: Analyze competitor landscape
Find who ranks for the prospect's primary keyword and compare positions.
def audit_competitors(domain, keyword):
data = search(keyword)
results = data.get("organic_results", [])[:10]
my_position = None
competitors = []
for i, r in enumerate(results):
if domain in r.get("link", ""):
my_position = i + 1
else:
competitors.append({"title": r["title"][:60], "position": i + 1,
"url": r.get("link", "")})
return {
"keyword": keyword,
"my_position": my_position,
"top_competitors": competitors[:5],
"paa": [q.get("question","") for q in data.get("people_also_ask", [])],
}Step 4: Generate the enriched audit report
Combine all audit data into a single enriched report.
def generate_audit(domain, keywords):
visibility = audit_visibility(domain)
keyword_audits = [audit_competitors(domain, kw) for kw in keywords]
gaps = []
for ka in keyword_audits:
gaps.extend(ka["paa"])
return {
"domain": domain,
"visibility": visibility,
"keyword_analysis": keyword_audits,
"content_gaps": list(set(gaps))[:10],
"recommendations": [
f"Target {len(set(gaps))} unanswered questions from PAA",
f"Compete with {sum(len(ka['top_competitors']) for ka in keyword_audits)} ranking pages",
],
}
audit = generate_audit("example.com", ["project management tool", "team collaboration software"])
with open("audit_report.json", "w") as f:
json.dump(audit, f, indent=2)
print("Audit generated")Python Example
import os, requests
API_KEY = os.environ["SCAVIO_API_KEY"]
def audit(domain):
resp = requests.post("https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "google", "query": f"site:{domain}"})
results = resp.json().get("organic_results", [])[:5]
return {"domain": domain, "pages": len(results),
"titles": [r["title"] for r in results]}
print(audit("example.com"))JavaScript Example
const H = {"x-api-key": process.env.SCAVIO_API_KEY, "Content-Type": "application/json"};
async function audit(domain) {
const r = await fetch("https://api.scavio.dev/api/v1/search", {
method: "POST", headers: H,
body: JSON.stringify({platform: "google", query: `site:${domain}`})
});
const results = (await r.json()).organic_results || [];
return {domain, pages: results.length, titles: results.slice(0,5).map(r=>r.title)};
}
audit("example.com").then(console.log);Expected Output
An enriched one-page audit report with site visibility, competitor analysis, keyword positions, PAA-based content gaps, and actionable recommendations.