Tutorial

How to Build a Real Estate Search Tool with Google APIs

Aggregate real estate listings and neighborhood data from Google search using the Scavio API. Build a property research tool without a dedicated real estate API.

Real estate search tools typically rely on expensive proprietary data APIs like Zillow, Redfin, or MLS feeds. For many use cases — neighborhood research, market trend analysis, investment opportunity scanning — publicly available Google search data is sufficient. The Scavio Google SERP API returns organic results, shopping results, and knowledge graph data that can surface real estate listings and neighborhood insights. This tutorial builds a property research tool that aggregates data from Google search results.

Prerequisites

  • Python 3.8 or higher
  • requests library installed
  • A Scavio API key
  • Understanding of real estate terminology

Walkthrough

Step 1: Search for properties by location and type

Construct targeted queries that surface real estate listings from Zillow, Realtor.com, and similar sites in Google results.

Python
def search_properties(location: str, property_type: str = "homes for sale") -> dict:
    query = f"{property_type} in {location}"
    r = requests.post(ENDPOINT, headers={"x-api-key": API_KEY},
                      json={"query": query, "country_code": "us"})
    r.raise_for_status()
    return r.json()

Step 2: Extract listing results

Filter organic results for real estate listing sites by checking for known domains in the URL.

Python
LISTING_SITES = ["zillow.com", "realtor.com", "redfin.com", "trulia.com"]

def extract_listings(data: dict) -> list[dict]:
    results = []
    for r in data.get("organic_results", []):
        if any(site in r.get("link", "") for site in LISTING_SITES):
            results.append({"title": r["title"], "snippet": r.get("snippet"), "link": r["link"]})
    return results

Step 3: Get neighborhood knowledge graph

Fetch the knowledge graph for a neighborhood or city to get population, median income, and other demographic data.

Python
def get_neighborhood_info(location: str) -> dict | None:
    r = requests.post(ENDPOINT, headers={"x-api-key": API_KEY},
                      json={"query": location, "country_code": "us"})
    r.raise_for_status()
    return r.json().get("knowledge_graph")

Step 4: Build a property research summary

Combine listing results and neighborhood knowledge graph into a structured property research report.

Python
def research(location: str) -> dict:
    prop_data = search_properties(location)
    listings = extract_listings(prop_data)
    kg = get_neighborhood_info(location)
    return {
        "location": location,
        "listing_count": len(listings),
        "top_listings": listings[:3],
        "neighborhood": kg.get("title") if kg else None,
    }

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"
LISTING_SITES = ["zillow.com", "realtor.com", "redfin.com"]

def search(q: str) -> dict:
    r = requests.post(ENDPOINT, headers={"x-api-key": API_KEY},
                      json={"query": q, "country_code": "us"})
    r.raise_for_status()
    return r.json()

def research(location: str, prop_type: str = "homes for sale") -> None:
    data = search(f"{prop_type} in {location}")
    listings = [r for r in data.get("organic_results", []) if any(s in r.get("link", "") for s in LISTING_SITES)]
    kg = data.get("knowledge_graph")
    print(f"Location: {location}")
    print(f"Listing results found: {len(listings)}")
    if kg:
        print(f"Knowledge panel: {kg.get('title')} — {kg.get('description', '')[:100]}")
    for listing in listings[:3]:
        print(f"  {listing['title'][:60]}")

if __name__ == "__main__":
    research("Austin, Texas")

JavaScript Example

JavaScript
const API_KEY = process.env.SCAVIO_API_KEY || "your_scavio_api_key";
const ENDPOINT = "https://api.scavio.dev/api/v1/search";
const LISTING_SITES = ["zillow.com", "realtor.com", "redfin.com"];

async function search(q) {
  const res = await fetch(ENDPOINT, {
    method: "POST",
    headers: { "x-api-key": API_KEY, "Content-Type": "application/json" },
    body: JSON.stringify({ query: q, country_code: "us" })
  });
  return res.json();
}

async function research(location, propType = "homes for sale") {
  const data = await search(`${propType} in ${location}`);
  const listings = (data.organic_results || []).filter(r => LISTING_SITES.some(s => r.link.includes(s)));
  console.log(`Location: ${location}`);
  console.log(`Listings found: ${listings.length}`);
  listings.slice(0, 3).forEach(l => console.log(`  ${l.title.slice(0, 60)}`));
}

research("Austin, Texas").catch(console.error);

Expected Output

JSON
Location: Austin, Texas
Listing results found: 4
Knowledge panel: Austin — State capital of Texas, known for its technology industry...
  Zillow: 2,847 Homes For Sale in Austin, TX
  Realtor.com: Austin, TX Real Estate and Homes for Sale
  Redfin: Austin TX Homes for Sale and Real Estate

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 higher. requests library installed. A Scavio API key. Understanding of real estate terminology. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 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

Aggregate real estate listings and neighborhood data from Google search using the Scavio API. Build a property research tool without a dedicated real estate API.