Listing agent contacts from active listings
Every listing HomeHarvest returns carries the listing agent's name, email and phone numbers, plus the office and broker. Pull a city's active and pending listings, group by agent, and you have a list of who's listing homes there right now and how many each has.
How do I get listing agents for a city?
This pulls 500 for-sale and pending listings in Denver, picks each agent's mobile number, and counts listings per agent. The agent columns come with every search, so it skips the slower per-home details.
from homeharvest import scrape_property
listings = scrape_property(
location="Denver, CO",
listing_type=["for_sale", "pending"],
limit=500,
extra_property_data=False, # skip per-home details for a faster pull
)
def first_phone(phones):
# agent_phones is a list like [{"number": "...", "type": "Mobile", ...}]
if not isinstance(phones, list) or not phones:
return None
mobile = [p for p in phones if p.get("type") == "Mobile"]
return (mobile or phones)[0].get("number")
if listings.empty:
print("No listings found.")
else:
listings["agent_phone"] = listings["agent_phones"].apply(first_phone)
agents = (
listings.dropna(subset=["agent_name"])
.groupby(["agent_name", "office_name"], dropna=False)
.agg(listings=("property_id", "count"),
email=("agent_email", "first"),
phone=("agent_phone", "first"))
.sort_values("listings", ascending=False)
.reset_index()
)
print(len(agents), "listing agents")
print(agents.head(10)[["agent_name", "office_name", "listings"]].to_string(index=False))
agents.to_csv("denver_listing_agents.csv", index=False)Tested with homeharvest 0.8.18 and 0.9.0 on 2026-11-23.
Output (example values):
455 listing agents
agent_name office_name listings
Jane Agent Example Realty 6
Sam Agent Main St RE 4
Which agent and office columns are there?
| Column | What it is |
|---|---|
agent_name, agent_id | Listing agent and a stable ID for them |
agent_email | Agent's email, when the listing gives one |
agent_phones | List of numbers, each with a type (Mobile, Office, Fax, Other) |
agent_mls_set, agent_nrds_id | The agent's MLS and NRDS (Realtor association) IDs |
office_name, office_email, office_phones | The listing office |
broker_name | The brokerage |
How complete are agent emails and phones?
In a test of 20 recent San Diego sales, every row had an agent name, and 95% had an email and a phone. Fill rates vary by area and listing type. Rentals listed by property managers often have no agent at all.
Can I get agents for sold or pending homes too?
Yes. Use listing_type="sold" with past_days to see who closed deals recently, or "pending" for who just went under contract. The agent columns are the same.
Can I get the buyer's agent?
Yes, on sold homes, from version 0.9.0. The buyer_agent_* columns name the agent who brought the buyer, with email, phones and office. In our test, 117 of 200 recent San Diego sales listed one.
from homeharvest import scrape_property
# Who brought the buyers? The buyer's agent is on sold homes (needs extra_property_data, the default).
sold = scrape_property(location="San Diego, CA", listing_type="sold", past_days=30, limit=200)
with_buyer = sold.dropna(subset=["buyer_agent_name"])
print(len(with_buyer), "of", len(sold), "sales list a buyer's agent")
top = (with_buyer.groupby(["buyer_agent_name", "buyer_office_name"], dropna=False)
.size().sort_values(ascending=False).head(10))
print(top.to_string())Tested with homeharvest 0.9.0 on 2026-11-23. Needs 0.9.0 or newer.
What should I keep in mind before contacting agents?
Agents put their contact details on listings so people can reach them about the home. Keep your message about the listing, follow the CAN-SPAM Act for email, and get consent where the TCPA requires it before texting or auto-dialing. Honor opt-outs right away.
Last updated 2026-11-23. Report a problem.