Manually auditing page titles, meta descriptions, heading structure, and canonical tags is tedious at scale. Here's how to automate on-page SEO audits for your entire SaaS.
What a Full SEO Audit Checks
import requests
resp = requests.post("https://api.lazy-mac.com/seo-analyzer/audit", json={
"url": "https://your-site.com/pricing",
"checks": [
"title", # Length, keyword presence
"meta_description", # Length, CTA presence
"headings", # H1 count, hierarchy
"images", # Alt text missing
"canonical", # Canonical URL correct
"structured_data", # JSON-LD present
"page_speed", # Basic load indicators
"mobile_friendly" # Viewport meta present
]
})
audit = resp.json()
Sample response:
{
"url": "https://your-site.com/pricing",
"score": 72,
"issues": [
{
"check": "title",
"severity": "warning",
"message": "Title is 73 characters (recommended: 50-60)",
"current": "Pricing — Full Feature Comparison | YourSaaS Platform",
"suggestion": "Pricing | YourSaaS — Plans from $9/month"
},
{
"check": "images",
"severity": "error",
"message": "3 images missing alt text",
"elements": ["hero-image.jpg", "feature-1.png", "testimonial.webp"]
}
],
"passed": ["meta_description", "headings", "canonical", "mobile_friendly"]
}
Bulk Audit for Your Entire Site
import requests
pages = [
"/", "/pricing", "/features", "/blog", "/docs",
"/about", "/contact", "/login", "/signup"
]
base_url = "https://your-site.com"
results = []
for page in pages:
r = requests.post("https://api.lazy-mac.com/seo-analyzer/audit", json={
"url": base_url + page,
"checks": ["title", "meta_description", "headings", "canonical"]
})
data = r.json()
results.append({"page": page, "score": data['score'], "issue_count": len(data['issues'])})
# Sort by worst score first
results.sort(key=lambda x: x['score'])
for r in results:
print(f"Score {r['score']:3d} | {len(r['issue_count']):2d} issues | {r['page']}")
CI Integration
# .github/workflows/seo-check.yml
- name: SEO Audit
run: |
SCORE=$(curl -s -X POST "https://api.lazy-mac.com/seo-analyzer/audit" \
-H "Content-Type: application/json" \
-d '{"url": "https://your-site.com", "checks": ["title","meta_description","headings"]}' \
| jq '.score')
if [ "$SCORE" -lt 60 ]; then echo "SEO score $SCORE below threshold"; exit 1; fi
Top comments (0)