# Imovirtual Scraper 💰 $1/1K – Portugal Homes for Sale & Rent (`lukass/imovirtual-mp-actor`) Actor

Scrape Imovirtual.com listings across Portugal: apartments, houses, rooms, land, shops and new developments for sale or rent. Price, €/m², area, rooms, description, GPS, parish, agency and phone numbers. Search by place, URL or map. No result cap.

- **URL**: https://apify.com/lukass/imovirtual-mp-actor.md
- **Developed by:** [Lukáš Širhal](https://apify.com/lukass) (community)
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 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.
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

## Imovirtual Scraper - Portugal Homes for Sale & Rent

Scrape listings from [Imovirtual](https://www.imovirtual.com), one of Portugal's largest property
portals: apartments, houses, rooms, land, shops, warehouses, garages and new developments, for sale
or for rent, anywhere in Portugal including Madeira and the Azores.

### How to use

- **Type places**: a city or council (`Lisboa`, `Porto`, `Cascais`), a parish or neighbourhood
  (`Cascais e Estoril, Cascais, Lisboa`), or a location id (`lisboa/cascais`). The run log shows what
  each name was matched to. Or
- **Paste URLs** from imovirtual.com: a search page or a single listing. Or
- **Draw a map area**: a rectangle (`south,west,north,east`) or a GeoJSON polygon. Or
- Tick **Whole of Portugal**.

Then narrow with filters: buy or rent, property type, price, area, rooms, new builds or resale,
agency / developer / private owner, house type, keyword.

There is **no 1,000-result cap**: every listing of a search can be scraped, even all of Portugal.

### Output

Each listing comes with price, price per m², area, rooms, floor, the **full description**, street,
district / council / parish / neighbourhood, **GPS coordinates**, the advertiser (agency, developer
or private owner), **contact phone numbers**, the assigned agent, new-development details, listing
dates and all photos.

Turn on **Fetch listing details** to also get bathrooms, build year, energy certificate, plot area,
features (garage, balcony, air conditioning, ...), Imovirtual's AI-extracted attributes (heating,
availability date, ...), deposit and the agency's licence number (AMI), phone and office address.
That costs one extra request per listing.

```json
{
    "id": "19363148",
    "url": "https://www.imovirtual.com/pt/anuncio/moradia-t3-para-arrendamento-ID1jfeQ",
    "title": "Moradia T3 para arrendamento",
    "operation": "rent",
    "propertyType": "house",
    "price": 1900,
    "currency": "EUR",
    "area": 141.5,
    "rooms": 4,
    "district": "Porto",
    "council": "Vila Nova de Gaia",
    "parish": "Serzedo e Perosinho",
    "latitude": 41.0604,
    "longitude": -8.599431,
    "agencyName": "RE/MAX + Grupo Vantagem",
    "phones": ["+351223746650"],
    "buildYear": 1997,
    "energyCertificate": "c"
}
```

`rooms` counts rooms including the living room (assoalhadas): a T1 has 2, a T2 has 3. District,
council, parish and neighbourhood come from the listing's GPS position, so near a border they can
name the neighbouring parish of the one you searched.

### Pricing

Pay only for results. Platform usage and proxies are included.

| What you get | Free plan | Bronze | Silver | Gold+ |
|---|---|---|---|---|
| Listing | $1.00 / 1,000 | $0.90 | $0.80 | $0.70 |
| + listing details (`Fetch listing details` on) | +$0.50 / 1,000 | +$0.45 | +$0.40 | +$0.35 |
| Run start | $0.005 | $0.005 | $0.004 | $0.003 |

Set **Maximum listings**, or a maximum cost per run, to cap a run: the scraper stops as soon as the
budget is spent.

### Live API

Need one answer right now instead of a dataset? The Actor also runs as a live HTTP API (Apify
Server mode): each call returns JSON within seconds.

```bash
## One page (36 listings) of a search - any filter of the input works as a query parameter
curl "https://<actor-server-url>/search?location=Cascais&operation=rent&maxPrice=2000&page=1" \
  -H "Authorization: Bearer <APIFY_TOKEN>"

## One listing with full details
curl "https://<actor-server-url>/listing?id=19363148" -H "Authorization: Bearer <APIFY_TOKEN>"

## Place names and ids for the location parameter
curl "https://<actor-server-url>/locations?query=porto" -H "Authorization: Bearer <APIFY_TOKEN>"
```

`GET /` lists every parameter.

| API event | Free plan | Bronze | Silver | Gold+ |
|---|---|---|---|---|
| API request (any answered call) | $4.00 / 1,000 | $3.70 | $3.30 | $3.00 |
| API listing (per listing a `/search` returns) | $1.00 / 1,000 | $0.90 | $0.80 | $0.70 |
| API listing details (per `/listing`) | $1.50 / 1,000 | $1.35 | $1.20 | $1.05 |

Failed calls are never billed, and a search page asked for again within 2 minutes costs no request
fee.

# Actor input Schema

## `locations` (type: `array`):

Places in Portugal, one per line: a city or council (Lisboa, Porto, Cascais), a parish or neighbourhood ("Cascais e Estoril, Cascais, Lisboa"), or a location id in lowercase (lisboa/cascais; faro = the whole Faro district). A bare name picks Imovirtual's top suggestion ("Porto" = the city); add the parent places to pin an exact one. The run log shows what each name resolved to.

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

Search pages (https://www.imovirtual.com/pt/resultados/comprar/apartamento/lisboa/cascais) or single listings (https://www.imovirtual.com/pt/anuncio/...-ID1jfeQ). Operation, property type, location, price, area, rooms and sort are read from a search URL; the filters below fill in the rest.

## `mapArea` (type: `string`):

A rectangle as "south,west,north,east" in degrees (e.g. 38.69,-9.23,38.80,-9.09 for central Lisbon), or a GeoJSON Polygon / Feature drawn on geojson.io.

## `wholeCountry` (type: `boolean`):

Search all of Portugal (with the filters below). There is no 1,000-result cap: every listing can be reached.

## `operation` (type: `string`):

Used for locations, map area and whole country. Pasted URLs keep their own (comprar / arrendar).

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

One search per type. Empty = apartments.

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

Asking price, or monthly rent

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

Asking price, or monthly rent

## `minArea` (type: `integer`):

Usable area in m²

## `maxArea` (type: `integer`):

Usable area in m²

## `rooms` (type: `array`):

Number of rooms (assoalhadas) including the living room: a T1 has 2, a T2 has 3. Leave empty for any.

## `market` (type: `string`):

New builds (from developers) or resale homes

## `ownerType` (type: `string`):

Who placed the listing

## `buildingTypes` (type: `array`):

Houses only. Leave empty for any.

## `keyword` (type: `string`):

Only listings mentioning this text, e.g. piscina

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

Order within each search. Lowest price lists listings without a public price first.

## `fetchDetails` (type: `boolean`):

One extra request per listing for bathrooms, build year, energy certificate, plot area, features (garage, balcony, air conditioning, ...), AI-extracted attributes, deposit, agency licence (AMI), phone and office address.

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

Stop after this many listings. Leave empty for everything.

## `proxy` (type: `object`):

Apify Proxy (default group) is enough; the API has shown no bot protection.

## `debugLog` (type: `boolean`):

Log every request the Actor makes

## Actor input object example

```json
{
  "locations": [
    "Cascais"
  ],
  "wholeCountry": false,
  "operation": "sale",
  "propertyTypes": [
    "flat"
  ],
  "market": "all",
  "ownerType": "all",
  "sortBy": "newest",
  "fetchDetails": false,
  "maxItems": 100,
  "proxy": {
    "useApifyProxy": true
  },
  "debugLog": false
}
```

# Actor output Schema

## `overview` (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 = {
    "locations": [
        "Cascais"
    ],
    "propertyTypes": [
        "flat"
    ],
    "maxItems": 100,
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("lukass/imovirtual-mp-actor").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 = {
    "locations": ["Cascais"],
    "propertyTypes": ["flat"],
    "maxItems": 100,
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("lukass/imovirtual-mp-actor").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 '{
  "locations": [
    "Cascais"
  ],
  "propertyTypes": [
    "flat"
  ],
  "maxItems": 100,
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call lukass/imovirtual-mp-actor --silent --output-dataset

```

## MCP server setup

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

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/Dvq6gzSWeMACfyLwQ/builds/2WgO42ziur3bw9CSF/openapi.json
