Zillow Property Search API in Python: From Listings to Zestimate
If a listing card already prints a Zestimate, it is tempting to treat city search as the valuation API: dump a market, read zestimate, and call the job done. That is the wrong cut. A search result is inventory — address, list price, beds, a photo, days on market, and a zpid. The number on the card is a snapshot from that listing, not a scheduled valuation refresh, and it is not the fact sheet you need for HOA fees, parking, or appliances.
The useful unit is the zpid handoff: filter a market, keep the identifier, hydrate facts for the homes you actually opened, then call property-zestimate on purpose. A Zillow property search API in Python against this project is an unofficial, read-only JSON service — not an official Zillow product, an appraisal, or a complete historical feed. Official public endpoints were discontinued; this pipeline does not restore them. A past Los Angeles page-1 sample returned 41 listings. That does not guarantee the same inventory, a non-empty result, or a populated estimate today.
Search results are not a valuation
search answers "what is listed here." Pass a free-text location (city, county, neighborhood, or ZIP) plus buyer-style filters. search-by-coordinates is the same listing-card job around a map point (lat, long, optional diameter in miles). Neither call is a portfolio AVM. Cards may include zestimate and rentZestimate; those fields are convenient for ranking a shortlist, not a reason to skip the later point lookup.
property-details is the hydration step: bedroom and bathroom breakdowns, appliances, association fee, parking, and the rest of resoFacts. property-zestimate returns a deliberately small payload keyed by zpid or a listing-page url. If your input is a street address from a form or spreadsheet, property-by-address skips discovery and returns the same fact sheet — it still is not the Zestimate operation.
Sign up if you need an account, then copy an authorized platform key from the dashboard. The script reads OPENDATA_API_KEY from the server environment; keep YOUR_API_KEY as a placeholder in any URL you paste until you intentionally run a request. No Zillow account, cookie, or session token is involved. Query URLs carry the key, so keep production calls server-side and redact URLs from logs, screenshots, and shared links. Opening this page or copying the script does not send a data request.
HTTP success is only transport. Check the status code, then the gateway envelope's code, message, and data — gateway code 200 is business success. Inside that envelope, search payloads add their own status: OK with a populated or legitimately empty array, or ERROR with a precise message such as Invalid location. Inspect failures through redacted diagnostics.
Filter a market, keep the zpid
The documented city example is Los Angeles, CA. home_status switches inventory among FOR_SALE, FOR_RENT, and RECENTLY_SOLD. Price, bedrooms, and sort=NEWEST are portal-style filters, not a promise of matches. Install requests and set the environment variable on the server before running anything.
import os
import requests
BASE = "https://api.opendata-api.com/api/project/zillow"
API_KEY = os.environ["OPENDATA_API_KEY"]
PAGE_SIZE = 41
MAX_PAGES = 3
def call(operation, **params):
try:
response = requests.get(
f"{BASE}/{operation}",
params={**params, "key": API_KEY},
timeout=30,
)
except requests.RequestException:
raise RuntimeError("Request failed; use redacted diagnostics") from None
if not response.ok:
raise RuntimeError(f"HTTP {response.status_code}")
gateway = response.json()
if not isinstance(gateway, dict) or gateway.get("code") != 200:
raise RuntimeError("Gateway business failure; inspect code/message safely")
payload = gateway.get("data")
if not isinstance(payload, dict):
raise RuntimeError("Unexpected operation payload")
if payload.get("status") == "ERROR":
raise RuntimeError("Operation error; inspect message safely")
return payload.get("data")
def search_market(location, max_pages=MAX_PAGES, **filters):
listings = []
for page in range(1, max_pages + 1):
rows = call("search", location=location, page=page, **filters)
if rows is None:
break
if not isinstance(rows, list):
raise RuntimeError("Expected a listing array")
listings.extend(rows)
if len(rows) < PAGE_SIZE:
break
return listings
homes = search_market(
"Los Angeles, CA",
home_status="FOR_SALE",
min_price=300000,
max_price=850000,
min_bedrooms=2,
sort="NEWEST",
)
print(f"{len(homes)} listings collected")
Keep every zpid as a string. Headline fields on the card — price, bedrooms, bathrooms, livingArea, daysOnZillow, homeType, imgSrc, detailUrl, and address components — are enough to shortlist. Do not hydrate every row.
A radius search uses the same helper: call("search-by-coordinates", lat=34.01822, long=-118.504744, diameter=1.0, home_status="FOR_SALE"). The Santa Monica point is the documented example; current condos at that point are not guaranteed. search-by-polygon is the same listing-card job inside a drawn boundary (longitude then latitude pairs). You still leave any of these doors with a zpid, not a finished valuation.
Facts, then the Zestimate
Hydrate only the homes a user opened, an underwriting form selected, or a nightly job marked for refresh. Pass a zpid from a card (the documented example is 20171939) or a pasted listing-page url.
if homes:
zpid = homes[0].get("zpid")
details = call("property-details", zpid=zpid) or {}
if not isinstance(details, dict):
raise RuntimeError("Expected a property object")
facts = details.get("resoFacts") or {}
raw_estimate = call("property-zestimate", zpid=zpid)
zestimate = (
raw_estimate.get("zestimate")
if isinstance(raw_estimate, dict)
else raw_estimate
)
print({
"zpid": zpid,
"address": details.get("streetAddress"),
"bedrooms": facts.get("bedrooms"),
"bathrooms": facts.get("bathrooms"),
"hoa_fee": facts.get("associationFee"),
"list_price": details.get("price"),
"zestimate": zestimate,
})
Field population varies. Preserve nulls instead of inventing HOA fees or year built. A live check once showed the point Zestimate matching the search card for the same zpid; treat that as consistency between operations, not a certified appraisal.
When the input is 1443 Bellevue Ave Los Angeles, CA 90026 rather than an ID, call property-by-address with that address. You get the fact sheet without a prior search. For a later Zestimate you still need a zpid or listing url — do not assume the address call is a valuation, and do not invent an identifier that was not returned.
Rent estimates already sit on search cards as rentZestimate. Use property-zestimate to refresh sale-side values on a schedule. A page of up to 41 cards costs one search request; hydrating every card does not. See pricing for the current per-request rate.
Where pagination and empty listings lie
Pages are numbered 1–100 and return up to 41 listings. A short page means this filter ran out of inventory, not that the API failed. Cap max_pages in production; walking all 100 pages is a budget choice, not a completeness certificate. Deduplicate zpid values if you overlap filters or rerun NEWEST.
A valid filter that matches nothing returns HTTP 200 with inner status OK and data: []. That is a real empty market for those inputs — stop, log the filter, do not retry as if the key were invalid. An unrecognizable location returns a precise Invalid location error; do not silently substitute another city. Keep price ranges plausible: an absurd minimum (a trillion-dollar floor) can surface as a temporary 503 instead of an empty array. Back off; do not treat 503 as "no homes."
None of these states is a Zestimate. Empty search means there is no zpid to hand off. Do not average missing estimates into zero.
Mistakes that break the handoff
Treating search as property-zestimate. Ranking cards by the snapshot zestimate is fine; storing that snapshot as a nightly NAV is not the point-lookup job.
Hydrating every listing. property-details is for opened or selected homes. Credits are per request; 41 cards are still one search.
Dropping the zpid or coercing it to a float. Later facts and estimates have nothing to join on.
Collapsing empty data with ERROR and with HTTP 503. No matches, bad location, and overloaded or absurd filters are different branches.
Skipping the gateway code because HTTP was 200. Transport success is not business success.
Calling property-by-address and assuming you now have a valuation. Facts first, Zestimate second, and only with a real zpid or listing url.
Reading this article as a live query. Copying examples does not hit the API; running them with your key does. Start from the listing search, property details, address lookup, and Zestimate references, or the Zillow project page.