# Compass Real Estate Listings Scraper (`nanoteki/compass-scraper`) Actor

Extract structured Compass.com real estate listing and search result data. Supports single listing details, search results, and enriched search results with one dataset row per property record.

- **URL**: https://apify.com/nanoteki/compass-scraper.md
- **Developed by:** [Nano](https://apify.com/nanoteki) (community)
- **Categories:** Real estate
- **Stats:** 2 total users, 1 monthly users, 100.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/platform/actors/running/actors-in-store#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

## Compass Real Estate Listings Scraper

Extract structured property data from Compass.com listing and search pages. Use this Actor to turn Compass listing URLs and search result pages into clean dataset records that can be exported, analyzed, or connected to your existing data workflow.

This Actor can:

- scrape a single Compass listing page,
- scrape Compass search result pages for sale or rental listings,
- optionally enrich search results with additional listing details,
- save results to an Apify dataset for JSON, CSV, Excel, API, and integration workflows.

This Actor is not affiliated with, endorsed by, or sponsored by Compass.

### Common use cases

- Real estate market research
- Rental and sale inventory analysis
- Price and availability tracking
- Property data collection for spreadsheets or dashboards
- Agent, brokerage, and listing research
- Data pipelines using Apify API, webhooks, Make, Zapier, n8n, Google Sheets, or BI tools

### Input

| Field | Type | Description |
|---|---:|---|
| `url` | string | A Compass listing URL or Compass search/results URL. |
| `scrapingMethod` | string | Choose `detail`, `search`, or `search-with-details`. If a search URL is provided while `detail` is selected, the Actor automatically switches to search mode. |
| `maxItems` | integer | Maximum number of listings to return in search modes. |
| `maxPages` | integer | Maximum number of search result pages to visit. |
| `useApifyProxy` | boolean | Enable Apify Proxy for the browser session. Useful for larger or repeated runs. |
| `apifyProxyGroups` | string | Proxy group to use when Apify Proxy is enabled. |
| `apifyProxyCountry` | string | Proxy country. `US` is recommended for Compass.com. |
| `proxyUrls` | string\[] | Optional custom proxy URLs. If provided, these are used instead of Apify Proxy. |

### Example inputs

#### Scrape one listing

```json
{
  "scrapingMethod": "detail",
  "url": "https://www.compass.com/listing/6349-north-78th-street-unit-110-scottsdale-az-85250/1776331275243532865/",
  "useApifyProxy": false
}
```

#### Scrape search results

```json
{
  "scrapingMethod": "search",
  "url": "https://www.compass.com/for-rent/los-angeles-ca-90017/",
  "maxItems": 100,
  "maxPages": 5,
  "useApifyProxy": false
}
```

#### Scrape search results with listing details

```json
{
  "scrapingMethod": "search-with-details",
  "url": "https://www.compass.com/for-sale/los-angeles-ca/",
  "maxItems": 50,
  "maxPages": 3,
  "useApifyProxy": true,
  "apifyProxyGroups": "RESIDENTIAL",
  "apifyProxyCountry": "US"
}
```

### Output

Results are stored in the default Apify dataset.

Search modes return one dataset item per listing. Detail mode returns one dataset item for the requested listing.

#### Search result fields

| Field | Description |
|---|---|
| `searchUrl` | The original Compass search URL used for the run. |
| `url` | The Compass listing URL. |
| `address` | Property address when available. |
| `price` | Parsed numeric listing price when available. |
| `formattedPrice` | Human-readable price string. |
| `bedrooms` | Number of bedrooms when available. |
| `bathrooms` | Number of bathrooms when available. |
| `image` | Primary listing image URL when available. |
| `status` | Listing status when available. |
| `rawDetails` | Additional listing detail payload, included in `search-with-details` mode when detail extraction succeeds. |

Example search result item:

```json
{
  "searchUrl": "https://www.compass.com/for-rent/los-angeles-ca-90017/",
  "url": "https://www.compass.com/homedetails/1100-Wilshire-Unit-2811-Los-Angeles-CA-90017/2164046243993855009_lid/",
  "price": 3850,
  "formattedPrice": "$3,850",
  "address": "1100 Wilshire, Unit 2811, Los Angeles, CA 90017",
  "bedrooms": 2,
  "bathrooms": 1.5,
  "image": "https://www.compass.com/m/example/origin.jpg",
  "status": null
}
```

#### Detail result fields

Detail mode includes:

| Field | Description |
|---|---|
| `url` | The Compass listing URL. |
| `summary` | Normalized property summary with address, price, media, and listing metadata when available. |
| `rawDetails` | Full extracted listing details from Compass page data when available. |
| `extractionMethod` | Internal extraction method label. |
| `debug` | Optional diagnostic data. |

Example detail item:

```json
{
  "url": "https://www.compass.com/listing/.../",
  "summary": [
    {
      "name": "6349 North 78th Street, Unit 110",
      "url": "https://www.compass.com/listing/.../",
      "address": {
        "streetAddress": "6349 North 78th Street, Unit 110",
        "addressLocality": "Scottsdale",
        "addressRegion": "AZ",
        "postalCode": "85250"
      },
      "offers": {
        "price": 404000,
        "priceCurrency": "USD"
      }
    }
  ],
  "rawDetails": {
    "listing": "full extracted listing details when available"
  }
}
```

### How to export data

After a run finishes, open the dataset and export results as:

- JSON
- CSV
- Excel
- XML
- RSS
- API response

You can also connect the dataset to Apify integrations, schedules, webhooks, or your own API pipeline.

### Reliability notes

Compass pages can vary by market, listing type, and page layout. Some fields may be missing on some listings, and website changes or anti-bot protections can affect extraction.

If a run returns fewer results than expected, try:

1. checking that the Compass URL is live in a browser,
2. lowering `maxItems`,
3. lowering `maxPages`,
4. enabling Apify Proxy,
5. using US residential proxies for larger runs.

### Responsible use

- This Actor extracts data from pages supplied by the user.
- Users are responsible for ensuring their use complies with applicable laws, website terms, privacy rules, and Apify policies.
- Do not use extracted data for unlawful discrimination, harassment, spam, or privacy-invasive targeting.
- The Actor does not provide official MLS verification and does not guarantee that every Compass field will be present for every listing.

# Actor input Schema

## `scrapingMethod` (type: `string`):

Choose whether to scrape one listing, a search results page, or search results enriched with detail-page data.

## `url` (type: `string`):

Compass.com URL to scrape. Detail mode expects an individual listing URL, such as https://www.compass.com/listing/... Search modes expect a search URL, such as https://www.compass.com/for-sale/los-angeles-ca/ or https://www.compass.com/for-rent/miami-fl/.

## `maxItems` (type: `integer`):

Maximum number of listing records to return in search modes. This does not affect single listing detail mode.

## `maxPages` (type: `integer`):

Maximum number of Compass search result pages to visit in search modes.

## `useApifyProxy` (type: `boolean`):

Enable Apify Proxy for better reliability on larger or repeated runs. US residential proxies are recommended for Compass.com search pages.

## `apifyProxyGroups` (type: `string`):

Proxy group to use when Apify Proxy is enabled. Residential is recommended for larger Compass scraping jobs. AUTO uses available proxy types in your account.

## `chooseProxiesAutomatically` (type: `boolean`):

Let Apify automatically select proxy sessions when supported.

## `apifyProxyCountry` (type: `string`):

Proxy country for geographic targeting. US is recommended for Compass.com.

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

Optional custom proxy URLs. Format: http://username:password@proxy.example.com:8080. If provided, these are used instead of Apify Proxy.

## Actor input object example

```json
{
  "scrapingMethod": "detail",
  "url": "https://www.compass.com/listing/6349-north-78th-street-unit-110-scottsdale-az-85250/1776331275243532865/",
  "maxItems": 200,
  "maxPages": 10,
  "useApifyProxy": false,
  "apifyProxyGroups": "RESIDENTIAL",
  "chooseProxiesAutomatically": true,
  "apifyProxyCountry": "US"
}
```

# Actor output Schema

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

Compass property records from the default dataset. One visible dataset row equals one property result for pay-per-result monetization.

# 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 = {
    "url": "https://www.compass.com/listing/6349-north-78th-street-unit-110-scottsdale-az-85250/1776331275243532865/"
};

// Run the Actor and wait for it to finish
const run = await client.actor("nanoteki/compass-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 = { "url": "https://www.compass.com/listing/6349-north-78th-street-unit-110-scottsdale-az-85250/1776331275243532865/" }

# Run the Actor and wait for it to finish
run = client.actor("nanoteki/compass-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 '{
  "url": "https://www.compass.com/listing/6349-north-78th-street-unit-110-scottsdale-az-85250/1776331275243532865/"
}' |
apify call nanoteki/compass-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nanoteki/compass-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/IXjZBnpQJqog7ZGfb/builds/x84IC9acRUS3viZWy/openapi.json
