ScavioScavio
FeaturesPricingDocs
Sign InGet Started
  1. Home
  2. Tutorials
  3. How to Build a Local SEO Checker with Google Maps API Data
Tutorial

How to Build a Local SEO Checker with Google Maps API Data

Build a local SEO checker in Python that analyzes Google Maps listings and local pack results using the Scavio API. Score businesses on local SEO factors.

Get Free API KeyAPI Docs

Local SEO determines whether a business appears in Google Maps and the local pack for geo-targeted queries. A local SEO checker analyzes how a business appears in local results: its rating, review count, whether it has a website, and how it ranks relative to competitors. This tutorial builds a local SEO checker using the Scavio API that queries local results for target keywords, evaluates the business listing quality, and produces a local SEO score report.

Prerequisites

  • Python 3.8 or higher
  • requests library installed
  • A Scavio API key
  • A business name and location to check

Walkthrough

Step 1: Fetch local results for target keywords

Search for local-intent keywords that your business should rank for. The local_results field contains Google Maps listings.

Python
def get_local_results(keyword: str, location: str) -> list[dict]:
    r = requests.post(
        "https://api.scavio.dev/api/v1/search",
        headers={"x-api-key": API_KEY},
        json={"query": f"{keyword} in {location}", "country_code": "us"}
    )
    r.raise_for_status()
    return r.json().get("local_results", [])

Step 2: Find the target business in results

Scan local results for the target business name. Return its position and listing details if found.

Python
def find_business(results: list[dict], business_name: str) -> dict | None:
    for i, r in enumerate(results):
        if business_name.lower() in r.get("title", "").lower():
            return {"position": i + 1, **r}
    return None

Step 3: Score the listing quality

Calculate a local SEO score based on rating, review count, website presence, and phone number availability.

Python
def score_listing(listing: dict) -> dict:
    score = 0
    factors = {}
    rating = float(listing.get("rating", 0) or 0)
    if rating >= 4.5:
        score += 30
        factors["rating"] = f"{rating}/5 (excellent)"
    elif rating >= 4.0:
        score += 20
        factors["rating"] = f"{rating}/5 (good)"
    else:
        factors["rating"] = f"{rating}/5 (needs improvement)"
    reviews = int(listing.get("reviews", 0) or 0)
    if reviews >= 100:
        score += 25
    elif reviews >= 20:
        score += 15
    factors["reviews"] = str(reviews)
    if listing.get("website"):
        score += 20
        factors["website"] = "present"
    else:
        factors["website"] = "missing"
    if listing.get("phone"):
        score += 15
        factors["phone"] = "present"
    else:
        factors["phone"] = "missing"
    return {"score": score, "max_score": 90, "factors": factors}

Step 4: Generate the local SEO report

Run the checker across multiple keywords and output a comprehensive local SEO report.

Python
def local_seo_check(business: str, location: str, keywords: list[str]) -> None:
    print(f"Local SEO Report: {business} in {location}\n" + "=" * 50)
    for kw in keywords:
        results = get_local_results(kw, location)
        match = find_business(results, business)
        if match:
            scores = score_listing(match)
            print(f"\n{kw}: Position #{match['position']}, Score: {scores['score']}/{scores['max_score']}")
        else:
            print(f"\n{kw}: Not found in local results")

Python Example

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"

def get_local(kw: str, loc: str) -> list[dict]:
    r = requests.post(ENDPOINT, headers={"x-api-key": API_KEY},
                      json={"query": f"{kw} in {loc}", "country_code": "us"})
    r.raise_for_status()
    return r.json().get("local_results", [])

def score(listing: dict) -> int:
    s = 0
    if float(listing.get("rating") or 0) >= 4.0: s += 25
    if int(listing.get("reviews") or 0) >= 50: s += 25
    if listing.get("website"): s += 25
    if listing.get("phone"): s += 15
    return s

if __name__ == "__main__":
    business = "Joe's Coffee"
    keywords = ["coffee shop", "best coffee", "cafe near me"]
    for kw in keywords:
        results = get_local(kw, "Austin, TX")
        match = next((r for r in results if business.lower() in r.get("title", "").lower()), None)
        if match:
            print(f"{kw}: #{results.index(match)+1}, score={score(match)}/90")
        else:
            print(f"{kw}: not found")

JavaScript Example

JavaScript
const API_KEY = process.env.SCAVIO_API_KEY || "your_scavio_api_key";
const ENDPOINT = "https://api.scavio.dev/api/v1/search";

async function getLocal(kw, loc) {
  const res = await fetch(ENDPOINT, {
    method: "POST",
    headers: { "x-api-key": API_KEY, "Content-Type": "application/json" },
    body: JSON.stringify({ query: `${kw} in ${loc}`, country_code: "us" })
  });
  const data = await res.json();
  return data.local_results || [];
}

async function main() {
  const business = "Joe's Coffee";
  const keywords = ["coffee shop", "best coffee"];
  for (const kw of keywords) {
    const results = await getLocal(kw, "Austin, TX");
    const idx = results.findIndex(r => r.title?.toLowerCase().includes(business.toLowerCase()));
    if (idx >= 0) {
      console.log(`${kw}: #${idx + 1}, rating: ${results[idx].rating}`);
    } else {
      console.log(`${kw}: not found`);
    }
  }
}
main().catch(console.error);

Expected Output

JSON
Local SEO Report: Joe's Coffee in Austin, TX
==================================================

coffee shop: Position #3, Score: 75/90
  rating: 4.7/5 (excellent)
  reviews: 234
  website: present
  phone: present

best coffee: Position #5, Score: 65/90

cafe near me: Not found in local results

Related Tutorials

  • How to Scrape Google Maps Business Data Without Getting Blocked
  • How to Build an SEO Audit Tool with SERP and Competitor Analysis

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Python 3.8 or higher. requests library installed. A Scavio API key. A business name and location to check. A Scavio API key gives you 250 free credits per month.

Yes. The free tier includes 250 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Related Resources

Best Of

Best Google Maps Business Data APIs (May 2026)

Read more
Best Of

Best SERP API for Local SEO in 2026

Read more
Use Case

Google Maps Local Lead Gen

Read more
Use Case

Local SEO Research with Google Maps Data

Read more
Glossary

Local Pack Structured Data

Read more
Comparison

Google Places API vs SERP Local Pack API

Read more

Start Building

Build a local SEO checker in Python that analyzes Google Maps listings and local pack results using the Scavio API. Score businesses on local SEO factors.

Get Free API KeyRead the Docs
ScavioScavio

Real-time search API for AI agents. Search every platform, not just Google.

Product

  • Features
  • Pricing
  • Dashboard
  • Affiliates

Developers

  • Documentation
  • API Reference
  • Quickstart
  • MCP Integration
  • Python SDK

Alternatives

  • Tavily Alternative
  • SerpAPI Alternative
  • Firecrawl Alternative
  • Exa Alternative

Tools

  • JSON Formatter
  • cURL to Code
  • Token Counter
  • All Tools

© 2026 Scavio. All rights reserved.

Featured on TAAFT
Terms of ServicePrivacy Policy