# ComprarCasa Portugal Scraper - Real Estate Listings (`studio-amba/comprarcasa-pt-scraper`) Actor

Scrape every property listing from ComprarCasa (comprarcasa.pt), the Portuguese real estate network. Price, typology, useful, gross and land area, photos, energy certificate, coordinates, district, municipality, parish, agent and store. Sale and rent. No login.

- **URL**: https://apify.com/studio-amba/comprarcasa-pt-scraper.md
- **Developed by:** [Studio Amba](https://apify.com/studio-amba) (community)
- **Categories:** Real estate
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 result scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## ComprarCasa Portugal Scraper

Scrape every property listing from ComprarCasa (comprarcasa.pt), the Portuguese real estate network with stores across the country, from Braga and Porto to Leiria, Évora, the Algarve and the Azores.

### Why use this actor?

ComprarCasa publishes the stock of all its stores on comprarcasa.pt, and part of it never reaches the big portals. If you run a real estate CRM, track agency stock per district, or compare asking prices per parish, this actor gives you every listing as a structured row: price, typology, the three area types, all photos, energy certificate, coordinates, the consultant and the store that hold the mandate.

One run with empty filters reads the whole site: sale and rent, every property type, every district.

### How to scrape ComprarCasa data

1. Leave every filter empty to get every comprarcasa.pt listing in Portugal (about 1,700, sale and rent, all property types).
2. Or narrow it down with **Transaction type**, **Property type**, **District**, **Municipality** or **Parish**. Accents are optional: `Evora` and `Évora` both work.
3. Optionally add **Typology / bedrooms**, **Minimum price** and **Maximum price**.
4. Switch on **Only available listings** to leave out listings stamped sold, reserved or rented.
5. Set **Country** to `ALL` to add the network's small Spain feed in the same run.
6. Run, then download the dataset as JSON, CSV or Excel, or read it through the Apify API.

The actor uses the site's own search, so the filters behave like the filters on comprarcasa.pt. Every result is then checked against your filters again before it is saved. If you ask for a place where comprarcasa.pt has no listings, the run stops and lists the districts that do have listings.

No login, cookies or browser are needed.

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `country` | String | No | `PT` (default), `ES`, or `ALL` for both |
| `transactionTypes` | Array | No | `sale`, `rent`, `transfer`, `holiday_rent`, `exchange`, `share_transfer`. Empty = all. |
| `propertyTypes` | Array | No | `apartment`, `house`, `land`, `shop`, `office`, `building`, `warehouse`, `farm`, `estate`, `garage`, `development`, `storage`. Empty = all. |
| `district` | String | No | Distrito, e.g. `Braga`, `Porto`, `Lisboa`, `Évora` |
| `municipality` | String | No | Concelho, e.g. `Guimarães`, `Vila Nova de Gaia` |
| `parish` | String | No | Freguesia, as the site writes it |
| `bedrooms` | Array of integers | No | e.g. `[2, 3]` for T2 and T3. 10 means T10 or more. |
| `minPrice` / `maxPrice` | Integer | No | Price range in EUR (monthly rent for rentals) |
| `onlyAvailable` | Boolean | No | Off by default. Off keeps sold, reserved and rented listings with their `status`. |
| `sortBy` | String | No | `newest` (default), `price_asc`, `price_desc`, `area_asc`, `area_desc` |
| `startUrls` | Array | No | comprarcasa.pt search URLs or listing URLs. Max 50. |
| `maxItems` | Integer | No | Maximum listings to save. Default 5000 (the whole site), hard cap 10,000. |
| `proxyConfiguration` | Object | No | Apify automatic proxy is enough. |

Every filter is off by default. An empty filter never narrows the results.

### Output

Each listing is one row. Fields the site does not show for a listing are `null`, never invented.

| Field | Type | Example |
|-------|------|---------|
| `listingId` | Integer | `111522` |
| `reference` | String | `"408/A/00030"` |
| `title` | String | `"Apartamento T2 no centro de Alter do Chão"` |
| `url` | String | Listing URL on comprarcasa.pt |
| `transactionType` | String | `"sale"`, `"rent"`, `"transfer"` or `"sale_or_rent"` |
| `transactionTypeLocal` | String | `"Venda"` |
| `propertyType` | String | `"apartment"` |
| `propertyTypeLocal` | String | `"Apartamento"` |
| `typology` | String | `"T2"` |
| `bedrooms` / `bathrooms` | Number | `2` / `1` |
| `price` | Number or null | `130000` |
| `pricePeriod` | String or null | `"month"` for rentals |
| `priceOnRequest` | Boolean | `true` when no price is published |
| `currency` | String or null | `"EUR"`, always next to `price` |
| `areaM2` | Number | Useful area, else gross, else land |
| `livingAreaM2` | Number | Área útil |
| `grossAreaM2` | Number | Área bruta |
| `landAreaM2` | Number | Área terreno |
| `condition` | String | `"Usado"` |
| `constructionYear` | Integer | `1998` |
| `energyLabel` | String | `"C"`, `"Isento"` or `"Em curso"` |
| `status` | String | `"available"`, `"reserved"`, `"sold"`, `"rented"` or `"closed"` |
| `statusLocal` | String or null | `"Vendido"` |
| `labels` | Array | Other stamps, e.g. `"Visita Virtual"` |
| `listedDate` | null | The site publishes no listing date |
| `description` | String | Full description with line breaks |
| `country` | String | `"PT"` or `"ES"` |
| `district` / `municipality` / `parish` | String | `"Portalegre"` / `"Alter do Chão"` / `"Alter do Chão"` |
| `locationLabel` | String | Location as the site prints it |
| `latitude` / `longitude` | Number or null | `39.1968366`, `-7.6606952` |
| `imageUrl` / `imageUrls` / `imageCount` | String / Array / Integer | Full-size photos |
| `videoUrl` / `virtualTourUrl` | String or null | YouTube, Matterport |
| `features` | Array | `["Garagem", "Ar condicionado"]` |
| `characteristics` | Object | Every label and value on the page |
| `agentName` / `agentPhone` / `agentEmail` / `agentId` | String / Integer | Consultant |
| `agencyName` / `agencyCompany` | String | `"ComprarCasa XP Braga"` / `"Famagui - Mediação Imobiliária, Lda."` |
| `agencyLicenseAmi` | String | AMI licence number |
| `agencyPhone` / `agencyEmail` / `agencyStoreId` | String / Integer | Store contact |
| `scrapedAt` | String | ISO timestamp |

### Example output

```json
{
    "listingId": 111502,
    "reference": "336/M/02105",
    "title": "Moradia T2 com terreno em Candoso",
    "url": "https://www.comprarcasa.pt/imovel/moradia/t2-2-quartos/venda/guimaraes-candoso-sao-martinho-braga/por-recuperar?id=111502",
    "transactionType": "sale",
    "transactionTypeLocal": "Venda",
    "propertyType": "house",
    "propertyTypeLocal": "Moradia",
    "typology": "T2",
    "bedrooms": 2,
    "bathrooms": 1,
    "price": 110000,
    "pricePeriod": null,
    "priceOnRequest": false,
    "currency": "EUR",
    "areaM2": 29,
    "livingAreaM2": 29,
    "grossAreaM2": 53,
    "landAreaM2": 129,
    "condition": "Por recuperar",
    "energyLabel": "Isento",
    "status": "available",
    "country": "PT",
    "district": "Braga",
    "municipality": "Guimarães",
    "parish": "Candoso (São Martinho)",
    "imageCount": 15,
    "agentName": "Patrícia Ribeiro",
    "agencyName": "ComprarCasa Guimarães",
    "agencyLicenseAmi": "10736",
    "agencyStoreId": 32,
    "scrapedAt": "2026-11-09T21:44:33.956Z"
}
```

### Cost estimate

The actor charges **$0.002 per saved listing** plus **$0.005 per run start** (lower per-listing prices on higher Apify plans). The whole site (about 1,900 listings including the Spain feed) costs about $3.80 and takes about 15 minutes. A run of 20 listings costs about $0.045.

The run's usage cost only settles once the run reports SUCCEEDED. A dataset read during a run, or from a run that later failed, shows a cost far below the real total.

### What comprarcasa.pt does not publish

- **Listing date and last-update date.** The site only shows a "Novidade" stamp. `listedDate` is always `null`. Use `scrapedAt` and compare runs to see new and removed listings.
- **Street address.** Only the parish and the store address.
- **Coordinates** for listings where the consultant hides the map (roughly 4 in 10). `latitude` and `longitude` are `null` there.
- **Spain feed.** The site's counter for Spain is higher than the number of listings it actually shows on its result pages. The actor returns every listing the site shows.

### Typology

The typology comes from the listing header (`Moradia T3`). When the header has none and the listing is a home, the actor uses the Portuguese convention T + number of bedrooms. Land, shops, garages and other non-residential listings have no typology.

### Limitations

- comprarcasa.pt shows at most 32 listings per results page and one detail page per listing, so a run makes about one request per listing. The whole site still runs in minutes.
- Sold, reserved and rented listings stay on the site with a stamp. They are included by default, with `status` set. Use **Only available listings** to drop them.
- Location filters only accept places where comprarcasa.pt currently has listings.
- Data is taken from the public website and can change without notice.

### Related Scrapers

- [Hall Portugal Scraper](https://apify.com/studio-amba/hall-pt-scraper) - listings from hall.pt
- [RE/MAX Portugal Scraper](https://apify.com/studio-amba/remax-pt-scraper) - listings from remax.pt
- [Supercasa Scraper](https://apify.com/studio-amba/supercasa-scraper) - Portuguese property portal
- [Imovirtual Scraper](https://apify.com/studio-amba/imovirtual-scraper) - Portugal's large property portal
- [Idealista Scraper](https://apify.com/studio-amba/idealista-scraper) - Spain, Portugal and Italy

### Maintained by Studio Amba

We run 700+ scrapers for European websites, and the priority is keeping
every one of them working. Automated runs test this actor against the live
site and verify the output is complete. When the website changes, the
scraper usually gets repaired the same day, without you having to report
anything. Questions and issues go straight to the people who built it, and
most get an answer the same day.

If this actor works for you, a review on its Store page helps other people
find it.

# Actor input Schema

## `country` (type: `string`):

comprarcasa.pt lists Portugal by default. The network also has a small Spain feed. ALL reads both in one run.

## `transactionTypes` (type: `array`):

Sale, rent, business transfer and the other business types the site offers. Leave empty for all of them.

## `propertyTypes` (type: `array`):

Only these property types. Leave empty for all types.

## `district` (type: `string`):

Portuguese district, e.g. Braga, Porto, Lisboa, Évora, Leiria. Accents optional. The run fails with the list of districts that have listings if comprarcasa.pt has none there.

## `municipality` (type: `string`):

Municipality, e.g. Guimarães, Vila Nova de Gaia, Caldas da Rainha. Accents optional.

## `parish` (type: `string`):

Parish exactly as the site writes it, e.g. Cedofeita, Santo Ildefonso, Sé, Miragaia, São Nicolau e Vitória. Set the municipality too for a faster lookup.

## `bedrooms` (type: `array`):

Number of bedrooms as a JSON list, e.g. \[2, 3] (T0 = 0, T1 = 1, 10 means T10 or more). Leave empty for any.

## `minPrice` (type: `integer`):

Minimum asking price or monthly rent in EUR.

## `maxPrice` (type: `integer`):

Maximum asking price or monthly rent in EUR.

## `onlyAvailable` (type: `boolean`):

comprarcasa.pt keeps sold, reserved and rented listings online with a stamp. Off (default): you get them too, with the status field set. On: only listings without such a stamp.

## `sortBy` (type: `string`):

Order in which listings are collected. Matters when Max items is lower than the number of matching listings.

## `startUrls` (type: `array`):

Optional comprarcasa.pt search URLs (https://www.comprarcasa.pt/imoveis/...) or listing URLs (https://www.comprarcasa.pt/imovel/...?id=...). When set, the filters above are only used to check the results. Max 50.

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

Maximum number of listings to save. comprarcasa.pt has about 1,700 listings in Portugal, so the default 5000 covers the whole site.

## `proxyConfiguration` (type: `object`):

comprarcasa.pt has no anti-bot wall (see recon), so Apify's automatic proxy is enough.

## Actor input object example

```json
{
  "country": "PT",
  "transactionTypes": [
    "sale"
  ],
  "district": "Braga",
  "onlyAvailable": false,
  "sortBy": "newest",
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

# 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 = {
    "transactionTypes": [
        "sale"
    ],
    "district": "Braga",
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("studio-amba/comprarcasa-pt-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 = {
    "transactionTypes": ["sale"],
    "district": "Braga",
    "maxItems": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("studio-amba/comprarcasa-pt-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 '{
  "transactionTypes": [
    "sale"
  ],
  "district": "Braga",
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call studio-amba/comprarcasa-pt-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,studio-amba/comprarcasa-pt-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/CZ0sFHWbEVMvTRGid/builds/1BysOVHUpCOZKaRU7/openapi.json
