Zillow Scraper Python: How to Price a Property with Comparable Listings
You can test whether an asking price is defensible without paying for a formal appraisal — by pulling public property records for the surrounding market, filtering them into a genuine comparable set, and computing a price-per-square-foot estimate with an explicit verdict band. This guide is for home buyers deciding whether to offer at list, sellers sanity-checking a listing agent's number, and analysts who want a repeatable comp screen instead of eyeballing three nearby pins on a map.
The workflow uses two repositories from the data-scrape account: a Zillow data scraper that extracts prices, Zestimates, bed/bath/sqft details, and price history for collection, and the companion Zillow scraper API repository when you want collection running as a service on a schedule. The repositories handle collection. The scoring layer below is the part that tells you whether the asking price survives contact with the comp band.
TL;DR
- Collect public property records for the target ZIP or neighborhood, then keep only records with a usable
priceandsqft. - Filter comps to within one bedroom of the subject property and within a square-footage tolerance (25% is a sane default).
- Estimate value as median comp dollars-per-square-foot × subject square footage — never the raw median price.
- Gate every run behind a minimum comp count. Below the threshold, the verdict is "insufficient sample", not a number.
- Classify the asking price against the estimate with explicit thresholds: overpriced, underpriced, or in band.
- Save each run as a dated JSON file and compare verdicts week over week. A screen is a filter for further diligence, never a substitute for an appraisal or inspection.
Why "compare to the nearest listing" fails
The default approach is opening a map, finding three nearby listings, and pricing by feel. That method fails for reasons that are easy to fix once you name them.
The median price lies. A neighborhood's median listing price mixes 1-bedroom condos with 4-bedroom houses. Median $610,000 means nothing for a 1,650 sqft 3/2 — the honest baseline is dollars per square foot within a size-matched set.
Size dominates price non-linearly. Price per square foot falls as homes get larger, so a 1,200 sqft comp will always look "expensive" next to a 2,500 sqft subject. You need a tolerance band, not the whole market.
One comp is an anecdote. The renovated house next door and the dated estate sale two streets over both anchor human judgment in opposite directions. A quantile band across eight or more comps washes out both.
Zillow's Zestimate is an estimate, not a verdict. It is a useful second opinion, but treating it as the answer ignores that it carries its own model error. The screen below reports the gap between asking price and Zestimate as a signal, not as truth.
Stale listings distort the band. A record from eight months ago reflects a different market. Refresh the comp set before every decision and timestamp every record — which is exactly why collected records need a captured_at-style field rather than a saved screenshot.
What the screener measures
| Signal | Definition in this workflow | What it catches |
|---|---|---|
| Comp eligibility | Same bed count ±1, sqft within tolerance of the subject | Whether the comparison set is actually comparable |
| Median $/sqft | Median of price ÷ sqft across eligible comps | The honest size-adjusted baseline |
| Price band (Q1–Q3) | Interquartile range of comp prices | Where "normal" starts and ends, so outliers don't anchor |
| Comp-based estimate | Median $/sqft × subject sqft | The number the asking price is tested against |
| Asking/estimate ratio | Subject list price ÷ comp estimate | The verdict: overpriced, underpriced, or in band |
| Zestimate gap | Asking price ÷ Zestimate − 1 | A second opinion from Zillow's own model |
Two choices matter. A minimum comp count, because a "verdict" computed from three records is noise wearing a suit. And explicit verdict thresholds (default: overpriced above 1.10× the estimate, underpriced below 0.90×), because a number without a decision rule is trivia. The gap between 1.08× and 1.12× is not precision — the thresholds just make the screen consistent between runs.
The repositories, and which one to use when
Both projects are Python, MIT-licensed, and installable from source. They serve different shapes of work.
The Zillow data scraper repository is the record-oriented option. Its README documents extraction of property price and Zestimate, full address and coordinates, bed/bath/sqft details, photo URLs, tax history and price history, and days-on-market tracking, with full pagination, optional proxy rotation, and json, csv, or both output formats. The documented field list includes zpid, address, price, zestimate, rent_zestimate, beds, baths, sqft, lot_size, year_built, price_history, tax_history, photos, latitude, longitude, and url. Use it when your job is "give me the property records for these queries" and you run the collection yourself.
The Zillow scraper API repository is the service-shaped sibling for putting collection behind a scheduled or API-driven workflow. Its exact invocation surface and authentication model change over time, so confirm the current setup on its README before wiring it into production; the scoring layer below does not care which one collected the records — it only reads the JSON.
Neither repository is an official Zillow product, and neither promises coverage, quota, or uptime. Confirm the current usage terms and output format on the README before depending on either.
Setup
Python 3.11+ is enough for the repository itself; the screener below runs on the standard library alone. Install the collector from source:
git clone https://github.com/data-scrape/zillow-data-scraper.git
cd zillow-data-scraper
pip install -r requirements.txt
Collect records for the market you care about:
python scraper.py "Homes for sale in Austin, TX 78741" \
--output zillow_78741 \
--format json \
--max-results 100
Configuration lives in environment variables, never hardcoded in the script:
export RECORDS_PATH="zillow_78741.json" # collector output
export SUBJECT_PATH="subject.json" # the property being priced
export MIN_COMPS=4 # minimum comps before a verdict
export SQFT_TOLERANCE=0.25 # comp size band around the subject
export OVERPRICE_THRESHOLD=1.10 # asking > 1.10x estimate => overpriced
export UNDERPRICE_THRESHOLD=0.90 # asking < 0.90x estimate => underpriced
The subject file is one record in the same shape the collector emits:
{
"address": "1412 Willow Creek Dr, Austin, TX 78741",
"beds": 3,
"baths": 2,
"sqft": 1650,
"price": 635000,
"zestimate": 591000
}
The screener script
#!/usr/bin/env python3
"""Comp-based price screener for public property records.
Reads collector output (a JSON list of property records) plus one subject
record, filters a comparable set, and prints a pricing verdict.
"""
import json
import os
import statistics
from pathlib import Path
RECORDS_PATH = os.environ.get("RECORDS_PATH", "zillow_records.json")
SUBJECT_PATH = os.environ.get("SUBJECT_PATH", "subject.json")
MIN_COMPS = int(os.environ.get("MIN_COMPS", "4"))
SQFT_TOLERANCE = float(os.environ.get("SQFT_TOLERANCE", "0.25"))
OVERPRICE_THRESHOLD = float(os.environ.get("OVERPRICE_THRESHOLD", "1.10"))
UNDERPRICE_THRESHOLD = float(os.environ.get("UNDERPRICE_THRESHOLD", "0.90"))
def load_records(path: str) -> list[dict]:
data = json.loads(Path(path).read_text(encoding="utf-8"))
if isinstance(data, dict):
data = data.get("records") or data.get("results") or []
return [r for r in data if isinstance(r, dict)]
def usable(record: dict) -> bool:
price, sqft = record.get("price"), record.get("sqft")
return (
isinstance(price, (int, float)) and price > 0
and isinstance(sqft, (int, float)) and sqft > 0
)
def is_comp(record: dict, subject: dict) -> bool:
beds, subject_beds = record.get("beds"), subject.get("beds")
if isinstance(beds, int) and isinstance(subject_beds, int):
if abs(beds - subject_beds) > 1:
return False
ratio = record["sqft"] / subject["sqft"]
return (1 - SQFT_TOLERANCE) <= ratio <= (1 + SQFT_TOLERANCE)
def main() -> None:
subject = json.loads(Path(SUBJECT_PATH).read_text(encoding="utf-8"))
records = [r for r in load_records(RECORDS_PATH) if usable(r)]
comps = [r for r in records if is_comp(r, subject)]
print(
f"Subject: {subject['address']} | {subject['beds']}/{subject['baths']}"
f" | {subject['sqft']} sqft | asking ${subject['price']:,.0f}"
)
print(f"Comp set: {len(comps)} of {len(records)} usable records")
if len(comps) < MIN_COMPS:
print(f"INSUFFICIENT SAMPLE: {len(comps)} comps, minimum is {MIN_COMPS}")
return
ppsf = [r["price"] / r["sqft"] for r in comps]
prices = [r["price"] for r in comps]
cuts = statistics.quantiles(prices, n=4)
q1, q3 = cuts[0], cuts[2]
med_ppsf = statistics.median(ppsf)
med_price = statistics.median(prices)
estimate = med_ppsf * subject["sqft"]
ratio = subject["price"] / estimate
print()
print("Closest comps (by size):")
for r in sorted(comps, key=lambda r: abs(r["sqft"] - subject["sqft"]))[:5]:
print(
f" {r['address'][:40]:<40} {r['beds']}/{r['baths']}"
f" {r['sqft']:>5} sqft ${r['price']:>9,.0f} ${r['price'] / r['sqft']:.0f}/sqft"
)
print()
print(f"Median comp price: ${med_price:,.0f}")
print(f"Comp price band (Q1-Q3): ${q1:,.0f} - ${q3:,.0f}")
print(f"Median $/sqft: ${med_ppsf:.0f}")
print(f"Comp-based estimate: ${estimate:,.0f}")
zest = subject.get("zestimate")
if isinstance(zest, (int, float)) and zest > 0:
print(f"Zestimate gap: {(subject['price'] / zest - 1) * 100:+.1f}% (asking vs Zestimate)")
if ratio > OVERPRICE_THRESHOLD:
verdict = "OVERPRICED vs comps"
elif ratio < UNDERPRICE_THRESHOLD:
verdict = "UNDERPRICED vs comps"
else:
verdict = "IN BAND with comps"
print(f"Asking / estimate: {ratio:.2f} -> {verdict}")
if __name__ == "__main__":
main()
Representative output
The block below is the actual output of the script on a 12-record sample built from the documented field schema (real runs use your collector output):
Subject: 1412 Willow Creek Dr, Austin, TX 78741 | 3/2 | 1650 sqft | asking $635,000
Comp set: 8 of 12 usable records
Closest comps (by size):
77 Oakcrest Dr, Austin, TX 78741 3/2.5 1655 sqft $ 588,000 $355/sqft
1908 Marigold Ave, Austin, TX 78741 3/2 1580 sqft $ 545,000 $345/sqft
3304 Sunnybrook Ln, Austin, TX 78741 3/2 1720 sqft $ 579,000 $337/sqft
1128 Cottonwood Pass, Austin, TX 78741 3/2 1790 sqft $ 604,000 $337/sqft
902 Pecan Hollow Ct, Austin, TX 78741 3/2 1490 sqft $ 522,000 $350/sqft
Median comp price: $562,000
Comp price band (Q1-Q3): $504,000 - $600,000
Median $/sqft: $348
Comp-based estimate: $573,600
Zestimate gap: +7.4% (asking vs Zestimate)
Asking / estimate: 1.11 -> OVERPRICED vs comps
Reading it: the listing agent's $635,000 sits 11% above what size-matched comps support, and 7.4% above Zillow's own estimate. That does not prove the house is overpriced — maybe it has a rebuilt kitchen the records can't see. What it does prove is that the burden of justification has moved to the asking price, and a buyer can anchor an offer near the band instead of near the list.
Comparison: three ways to get to a comp verdict
| Approach | Setup model | Maintenance burden | Best for |
|---|---|---|---|
| Manual map browsing | None | High per decision, no repeatability | One-off casual checks |
| Repo + this screener | Clone, collect JSON, run locally | Refresh records before each run | Buyers/sellers pricing one property at a time |
| Scheduled collection via the API-shaped repo | Service setup, confirm auth on README | Moderate — monitor the pipeline | Analysts screening many properties weekly |
Pre-flight checklist
- [ ] Collector output is fresh — re-collect before every decision, not monthly.
- [ ] Subject record uses the same field names as the collector output (
price,sqft,beds,baths). - [ ]
MIN_COMPSgate passes; otherwise treat the run as inconclusive. - [ ] Comp set inspection: glance at the closest-comps list for obviously wrong records (garage apartments, half-built listings).
- [ ] Verdict thresholds chosen deliberately; defaults are 1.10 / 0.90, not gospel.
- [ ] Every saved run is dated, so verdicts can be compared over time.
Use cases
- Offer anchoring for buyers: screen the asking price before writing an offer, and put your number at the band rather than at list.
- Listing sanity checks for sellers: run the screen before signing a listing agreement, and ask the agent to reconcile any premium the comps don't support.
- Investor triage: score a watchlist of listings weekly and only walk the ones that screen in-band or underpriced.
- Market briefings: the Q1–Q3 band per run is a compact, defensible snapshot of what "normal" looks like for a property class in a ZIP code.
Limits, compliance, and maintenance
Zillow's terms apply. The repository's own disclaimer states it is for educational and research purposes; you are responsible for complying with the target website's Terms of Service, robots.txt, and applicable laws. Keep collection conservative — small result caps, delays between runs — and never resell or republish raw records as a dataset.
The Zestimate is a model, not a valuation. Treat the Zestimate gap as one signal among several; it is explicitly an estimate and carries its own error.
Records are not appraisals. The screen cannot see condition, renovations, lot premiums, or view corridors. Its job is to move the negotiation anchor, not to replace a licensed appraisal or an inspection.
Coverage varies. Availability of records depends on what the platform exposes for a given market at a given time; verify current behavior on the repository README before scaling up.
Maintenance is two habits: re-collect before every decision cycle, and re-read both repository READMEs periodically — CLI flags, output schemas, and platform behavior change without notice.
FAQ
Does this replace an appraisal or a real estate agent?
No. It replaces guessing. A licensed appraisal remains the only defensible valuation for lending purposes, and an agent's local knowledge of micro-markets is real. The screen's job is to make sure every number you're shown has survived a comparable test.
Why median price per square foot instead of a regression model?
Because you can audit it in your head. Median $/sqft × sqft is transparent, robust to one weird comp, and reproducible across runs. A regression over 12 records is a fashion statement.
What if the comp set includes condos or new construction?
Inspect the closest-comps list every run. If the market mixes property types, tighten the sqft tolerance or add a property-type filter before the estimate — the is_comp function is the single place to encode that judgment.
How large should the tolerance band be?
25% of subject square footage is a workable default. Tighter bands give cleaner comps but shrink the sample; below MIN_COMPS the verdict gate refuses to answer, which is the correct behavior.
Can I run this weekly for a watchlist?
Yes — that's what the scheduled-collection path via the API-shaped repository is for. Keep one dated JSON file per run, and diff verdicts over time; a listing that stays overpriced for six weeks is telling you something different than one that just re-listed.
What about tax history and price history fields?
They're in the documented output schema and are useful for follow-on analysis — price-cut cadence signals a motivated seller — but this screener deliberately stays on the pricing verdict so its output stays readable.
Next step
Clone the Zillow data scraper, collect one market's records, and run the screener on a property you'd actually bid on — then browse the data-scrape account for the Zillow scraper API repository and other ready-made Python scrapers across marketplaces, travel, and social platforms when you need a second workflow. For a broader view of how public web records feed structured market research, the Chinese-language CoreClaw guide to web data for market research workflows covers the same collection-to-analysis pattern in depth.
Every number in a negotiation should earn its place. This screener makes the comp band — not the asking price — earn it first.
Top comments (0)