Tutorial

How to Extract Google Maps Data via Search API

Get Google Maps business data including name, address, phone, rating, and reviews through a structured SERP API. No scraping or browser automation.

Google Maps data powers local lead generation, competitive analysis, and location intelligence workflows. Scraping Maps directly is unreliable because Google uses heavy anti-bot protections and frequently changes its DOM structure. The Scavio API returns structured Maps data including business names, addresses, phone numbers, ratings, review counts, and opening hours as clean JSON. This tutorial shows how to query local business data through a SERP API in Python and JavaScript. You will build a simple pipeline that extracts and filters businesses by rating and review count.

Prerequisites

  • Python 3.8+ or Node.js 18+ installed
  • requests library installed (Python)
  • A Scavio API key from scavio.dev
  • A target location and business category to search

Walkthrough

Step 1: Configure the search query

Set up your API key and define the local business search query with location context.

Python
import os, requests

API_KEY = os.environ["SCAVIO_API_KEY"]
QUERY = "plumbers in Austin TX"

Step 2: Fetch Maps results

POST to the Scavio API with a Google Maps query. The response includes local_results with business details.

Python
resp = requests.post("https://api.scavio.dev/api/v1/search",
    headers={"x-api-key": API_KEY},
    json={"platform": "google", "query": QUERY, "type": "maps"})
data = resp.json()
locals = data.get("local_results", [])

Step 3: Filter by rating and reviews

Filter businesses to find high-quality leads based on minimum rating and review count.

Python
quality_leads = [
    b for b in locals
    if float(b.get("rating", 0)) >= 4.0 and int(b.get("reviews", 0)) >= 20
]
for b in quality_leads:
    print(f"{b['title']} - {b.get('rating')} ({b.get('reviews')} reviews)")
    print(f"  {b.get('address', 'N/A')} | {b.get('phone', 'N/A')}")

Step 4: Export leads to JSON

Save the filtered leads to a JSON file for CRM import or outreach pipelines.

Python
import json

leads = [{
    "name": b.get("title", ""),
    "address": b.get("address", ""),
    "phone": b.get("phone", ""),
    "rating": b.get("rating", ""),
    "reviews": b.get("reviews", 0),
    "url": b.get("link", ""),
} for b in quality_leads]
with open("leads.json", "w") as f:
    json.dump(leads, f, indent=2)
print(f"Exported {len(leads)} leads")

Python Example

Python
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": "plumbers in Austin TX", "type": "maps"})
for b in resp.json().get("local_results", [])[:5]:
    print(f"{b['title']} - {b.get('rating')} stars")

JavaScript Example

JavaScript
const r = await fetch("https://api.scavio.dev/api/v1/search", {
  method: "POST",
  headers: {"x-api-key": process.env.SCAVIO_API_KEY, "Content-Type": "application/json"},
  body: JSON.stringify({platform: "google", query: "plumbers in Austin TX", type: "maps"})
});
const data = await r.json();
(data.local_results || []).slice(0, 5).forEach(b =>
  console.log(b.title, b.rating, b.reviews)
);

Expected Output

JSON
A list of local businesses with name, address, phone, rating, and review count extracted from Google Maps as structured JSON.

Related Tutorials

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 Node.js 18+ installed. requests library installed (Python). A Scavio API key from scavio.dev. A target location and business category to search. 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.

Start Building

Get Google Maps business data including name, address, phone, rating, and reviews through a structured SERP API. No scraping or browser automation.