Skip to content

Zillow property data in CrewAI (crewai-zillapi tools)

Seven ready-made CrewAI tools for U.S. property data, one environment variable.

The crewai-zillapi package gives CrewAI agents ZillAPI property data as tools. An agent can resolve a street address, zpid or zillow.com URL to a full property record, pull one detail section (Zestimate and rent Zestimate, price history, tax history, schools, photos, listing agent, comparable homes, open houses or the full fact sheet), search for sale, for rent and sold listings inside a bounding box, and check its own credit balance. Use it to build crews that value a home, screen a market for deals, or write a property brief with real numbers. The tools call the same REST API as the rest of these docs, with the same API key.

Install

Terminal window
pip install crewai-zillapi

Requires Python 3.10 or later and crewai 0.80.0 or later (installed for you as a dependency).

Add your API key

  1. Sign up and create a key on the API keys page. Keys start with zk_.
  2. Set it in the environment the crew runs in:
Terminal window
export ZILLAPI_KEY="zk_your_key_here"

The tools read ZILLAPI_KEY on every call and send it as a Bearer token. Your crew still needs its usual LLM setup (for example your model provider’s API key); the ZillAPI key is only for property data. See Authentication for how keys work.

Tools

Tool class Arguments What it does
ZillapiPropertyByAddressTool address, status, fields Resolve a full street address to a property record
ZillapiPropertyByZpidTool zpid, fields Full property record for a known zpid
ZillapiPropertyDetailTool zpid, section One detail section for a zpid
ZillapiPropertyByUrlTool url, status, extract_units, fields Resolve a zillow.com URL to a property or building
ZillapiListingSearchTool west, south, east, north, status, price_min, price_max, beds_min, beds_max, baths_min, baths_max, sqft_min, sqft_max, home_types, max_items Search listings inside a bounding box
ZillapiJobTool job_id, action Poll an async search job and read its results
ZillapiAccountTool resource Plan and credit balance (account) or recent usage (usage)

Costs per tool and plans are on the pricing page.

Argument values:

  • status on the lookup tools: FOR_SALE (default), RECENTLY_SOLD or FOR_RENT. On the search tool: for_sale (default), for_rent or sold.
  • section: zestimate, price-history, tax-history, schools, photos, agent, nearby, open-houses or facts.
  • fields: comma-separated dotted paths, such as zpid,price,bedrooms, to return only part of the record. See Field projection.
  • extract_units (URL tool, building pages): all, for_sale, recently_sold, for_rent, off_market or disabled.
  • home_types: a list of any of house, condo, townhouse, multi_family, manufactured, lot, apartment.
  • max_items: 1 to 500, default 20. Up to 50 returns results inline; above 50 the search runs as an async job and returns a job_id.
  • action (job tool): status (default) or results.

Example crews

1. Property brief for one address

An analyst agent looks up the address, then pulls the price history and schools for its zpid.

from crewai import Agent, Task, Crew
from crewai_zillapi import (
ZillapiPropertyByAddressTool,
ZillapiPropertyDetailTool,
)
analyst = Agent(
role="Residential property analyst",
goal="Write short, factual briefs on U.S. homes using live property data",
backstory="You research homes with ZillAPI data and always quote the numbers you used.",
tools=[ZillapiPropertyByAddressTool(), ZillapiPropertyDetailTool()],
)
brief = Task(
description=(
"Look up the property at {address}. Report the price, Zestimate and rent "
"Zestimate. Then use its zpid to fetch the 'price-history' and 'schools' "
"sections, and summarize the last sale and the assigned schools."
),
expected_output="A short markdown brief with the figures you used.",
agent=analyst,
)
crew = Crew(agents=[analyst], tasks=[brief])
result = crew.kickoff(inputs={"address": "350 5th Ave, New York, NY 10118"})
print(result)

2. Market scout for an area

A scout agent searches a bounding box (south Austin, TX here) and checks the Zestimate of the most promising listings. max_items=10 caps the search at 10 listings.

from crewai import Agent, Task, Crew
from crewai_zillapi import (
ZillapiListingSearchTool,
ZillapiPropertyDetailTool,
ZillapiAccountTool,
)
scout = Agent(
role="Real estate deal scout",
goal="Find listings priced below their Zestimate",
backstory="You screen markets with ZillAPI data and keep searches small.",
tools=[ZillapiAccountTool(), ZillapiListingSearchTool(), ZillapiPropertyDetailTool()],
)
screen = Task(
description=(
"First check the remaining credit balance. Then search for_sale listings in the "
"bounding box west=-97.85, south=30.20, east=-97.65, north=30.35 with at least "
"3 beds and a price of at most 650000, max_items=10. Pick the 3 listings with "
"the lowest price per square foot and fetch the 'zestimate' section for each."
),
expected_output="A table of 3 listings: address, price, Zestimate, gap, zillow.com link.",
agent=scout,
)
print(Crew(agents=[scout], tasks=[screen]).kickoff())

The search tool needs real coordinates. A place name on its own is not accepted, so put the box in the task or add a geocoding step before the search.

3. Call the tools directly, no LLM

Every tool returns a JSON string, so you can use them in plain Python too, for example to test your key or to prefetch data for a crew.

import json
from crewai_zillapi import ZillapiPropertyByAddressTool, ZillapiPropertyDetailTool
lookup = json.loads(
ZillapiPropertyByAddressTool().run(
address="350 5th Ave, New York, NY 10118",
fields="zpid,price,zestimate",
)
)
if not lookup["success"]:
raise SystemExit(lookup["error"]["code"])
zpid = lookup["data"]["zpid"]
history = json.loads(ZillapiPropertyDetailTool().run(zpid=zpid, section="price-history"))
print(lookup["data"])
print(history["data"] if history["success"] else history["error"]["code"])

Larger searches (async jobs)

Asking for more than 50 listings starts an async job. Poll it with ZillapiJobTool until it succeeds, then read the rows:

import json, time
from crewai_zillapi import ZillapiListingSearchTool, ZillapiJobTool
start = json.loads(
ZillapiListingSearchTool().run(
west=-97.85, south=30.20, east=-97.65, north=30.35,
status="for_sale", max_items=100,
)
)
job_id = start["data"]["job_id"]
jobs = ZillapiJobTool()
while True:
status = json.loads(jobs.run(job_id=job_id, action="status"))
if status["success"] and status["data"]["status"] in ("succeeded", "failed", "timed_out", "aborted"):
break
time.sleep(5)
rows = json.loads(jobs.run(job_id=job_id, action="results"))
print(len(rows["data"]), rows["meta"])

The job tool returns up to the first 100 rows of a job. For bigger jobs, page through GET /v1/jobs/{id}/results with limit and offset; see Async jobs.

Response shape

Every tool returns a JSON string with the same envelope. On success, data holds the payload itself, with request_id (and meta on list results) alongside:

{ "success": true, "data": { "zpid": "1234567", "price": 1250000 }, "request_id": "req_abc123" }

On failure the tool returns an error instead of raising, so the agent can read it and adjust:

{ "success": false, "error": { "code": "invalid_filters", "message": "..." } }

Match on code, never on message. Arguments that do not fit a tool’s schema (for example an unknown section) are rejected before any request is sent.

Troubleshooting

  • missing_api_key. ZILLAPI_KEY is not set in the process that runs the crew. Export it in the same shell, or load it from your .env before you create the tools.
  • invalid_api_key. The key was rejected. Copy the whole key, starting with zk_, or create a new one on the API keys page.
  • out_of_credits. The account has run out of credits. See the pricing page.
  • 400 missing_input or invalid_filters on a search. The search was sent without a valid bounding box. Give the agent west, south, east and north in decimal degrees, with west less than east and south less than north.
  • not_found. Nothing matched. Use a full street address with city, state and ZIP, a digits-only zpid, or a zillow.com /homedetails/ link.
  • job_not_ready. The async job is still running. Poll with action="status" until it reports succeeded.
  • rate_limited. Too many requests for your plan. Run tasks sequentially rather than fanning out parallel calls with the same key, and retry after a pause.
  • timeout, network or service_unavailable. A temporary problem reaching the data. Retry with backoff.

Full error codes are listed on Errors.

FAQ

Is there a CrewAI tool for Zillow property data?
Yes. The crewai-zillapi package on PyPI gives CrewAI agents seven ZillAPI tools: property lookup by address, zpid or Zillow URL, one detail section such as Zestimate, schools or price history, listing search inside a bounding box, async job polling, and an account and credit balance check.
How do I install crewai-zillapi?
Run pip install crewai-zillapi on Python 3.10 or later, then set the ZILLAPI_KEY environment variable to your ZillAPI API key from zillapi.com/app/keys. The tools read the key from that variable.
Can a CrewAI agent search listings by city name?
Not directly. The listing search tool needs a bounding box of west, south, east and north coordinates in decimal degrees. Convert the place to coordinates first, for example with a geocoding step or by giving the agent the box in the task.
What do the CrewAI tools return when a call fails?
Every tool returns a JSON string. A failed request returns success false with an error code such as invalid_api_key, out_of_credits, not_found or rate_limited, so the agent can read the result instead of crashing. Match on the code, not the message.

ZillAPI is an independent service, not affiliated with, endorsed by, or sponsored by Zillow Group, Inc. “Zillow” and “Zestimate” are trademarks of Zillow Group, Inc., used here descriptively. See Trademark & Affiliation.