# Zillow.com Real Estate & Agents API (`ashrafess3/zillow-scraper`) Actor

Scrape real-time property listings, agent data, and market stats from Zillow.com. Supports search by location, coordinates, address, property details, similar homes, market stats, and agent profiles.

- **URL**: https://apify.com/ashrafess3/zillow-scraper.md
- **Developed by:** [Achraf Essaoudi](https://apify.com/ashrafess3) (community)
- **Categories:** Real estate, E-commerce, Lead generation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Zillow Scraper — Apify Actor

Scrape real-time property listings, agent data, and market statistics from [Zillow.com](https://www.zillow.com).

### Quick Start

#### Local

```bash
cd zillow_scraper_apify
pip install -r requirements.txt
apify run
```

#### Deploy to Apify Cloud

```bash
apify login
apify push
```

### Tasks

| Task | Required Input | Description |
|---|---|---|
| `search-by-location` | `location` | Search properties by city/zip/address slug |
| `search-by-coordinates` | `lat`, `lng` | Search properties near coordinates |
| `search-by-address` | `address` | Resolve a street address to full property details |
| `property-details` | `zpid` | Full property details by Zillow Property ID |
| `similar-homes` | `zpid` | Comparable homes ranked by similarity |
| `market-stats` | `location` | Regional market statistics (ZHVI, inventory, rents) |
| `agent-search` | `location` | Real estate agents by location |
| `agent-details` | `agentname` or `agentUrl` | Agent profile information |
| `agent-reviews` | `agentname` or `agentUrl` | Agent reviews |
| `agent-properties` | `agentname` or `agentUrl` | Agent's listed properties |
| `autocomplete` | `query` | Location and address autocomplete suggestions |

### Input

All inputs are passed as a JSON object. See `.actor/INPUT_SCHEMA.json` for the full schema.

#### Example: Search by location

```json
{
  "task": "search-by-location",
  "location": "Austin-TX",
  "listType": "for-sale",
  "page": 1,
  "sort": "newest"
}
```

#### Example: Property details

```json
{
  "task": "property-details",
  "zpid": 2060051934
}
```

#### Example: Similar homes

```json
{
  "task": "similar-homes",
  "zpid": 2060051934,
  "count": 10,
  "listType": "for-sale"
}
```

#### Example: Market stats with history

```json
{
  "task": "market-stats",
  "location": "Austin-TX",
  "history": true
}
```

### Proxy Configuration

Zillow aggressively blocks datacenter IPs. For reliable scraping, provide proxy URLs:

```json
{
  "task": "search-by-location",
  "location": "Austin-TX",
  "proxies": ["http://user:pass@proxy.example.com:8080"]
}
```

Without proxies, requests go direct and will likely be blocked after a few calls.

### Architecture

This Actor is a Django-free port of the [zillow-scraper](https://github.com/) REST API. The scraping engine (`curl_cffi` with TLS impersonation, session pooling, retry logic) is preserved exactly. What changed:

- **Django removed**: no ORM, no DRF, no middleware, no Celery
- **Redis replaced**: in-memory TTL cache per run (stateless Actor)
- **Proxy selection simplified**: no RapidAPI host detection, just pass proxy URLs
- **Single entry point**: one `main.py` routes tasks to scraper methods

#### Output

Results are pushed to the default [Apify Dataset](https://docs.apify.com/storage/dataset). You can preview, export (CSV/JSON/Excel), or access via API.

```bash
## Retrieve results via API
curl "https://api.apify.com/v2/datasets/YOUR_DATASET_ID/items?token=YOUR_TOKEN"
```

### Scheduling

In Apify Console: **Schedules** > **Create Schedule** > set cron and target this Actor.

### Development

```bash
## Run locally
apify run

## Test a specific task
apify run --input '{"task": "autocomplete", "query": "Austin TX"}'

## Deploy
apify push
```

### License

Same as the parent project.

# Actor input Schema

## `task` (type: `string`):

The scraping task to perform.

## `location` (type: `string`):

Location string for search tasks (e.g. 'Austin-TX', 'Los Angeles CA', '90210').

## `address` (type: `string`):

Full street address for search-by-address task.

## `zpid` (type: `integer`):

Zillow Property ID for detail tasks.

## `lat` (type: `number`):

Latitude for search-by-coordinates task.

## `lng` (type: `number`):

Longitude for search-by-coordinates task.

## `listType` (type: `string`):

Filter by listing type.

## `page` (type: `integer`):

Page number for paginated results (max 20).

## `sort` (type: `string`):

Sort order for search results.

## `count` (type: `integer`):

Number of similar homes to return.

## `history` (type: `boolean`):

Include historical data for market stats.

## `agentname` (type: `string`):

Agent screen name for agent tasks.

## `agentUrl` (type: `string`):

Full agent profile URL (alternative to agentname).

## `propertyType` (type: `string`):

Property type filter for agent-properties task.

## `query` (type: `string`):

Search query for autocomplete task.

## `proxyConfig` (type: `object`):

Apify Proxy is used by default. Switch to your own proxy or disable proxying in advanced settings.

## `proxyUrls` (type: `array`):

Override Apify proxy with your own. One URL per line. Format: http://user:pass@host:port

## `requestDelayMin` (type: `number`):

Minimum random delay between requests in seconds.

## `requestDelayMax` (type: `number`):

Maximum random delay between requests in seconds.

## `maxRetries` (type: `integer`):

Maximum number of retries per request.

## Actor input object example

```json
{
  "task": "search-by-location",
  "listType": "for-sale",
  "page": 1,
  "sort": "relevant",
  "count": 8,
  "history": false,
  "propertyType": "for-sale",
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": []
  },
  "proxyUrls": [],
  "requestDelayMin": 1,
  "requestDelayMax": 3,
  "maxRetries": 5
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items containing scraped Zillow data.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "proxyConfig": {
        "useApifyProxy": true,
        "apifyProxyGroups": []
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ashrafess3/zillow-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "proxyConfig": {
        "useApifyProxy": True,
        "apifyProxyGroups": [],
    } }

# Run the Actor and wait for it to finish
run = client.actor("ashrafess3/zillow-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": []
  }
}' |
apify call ashrafess3/zillow-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ashrafess3/zillow-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/hnYzKdTdOqLkFr79g/builds/oeoteCe31KcpGQXMA/openapi.json
