# Trovacasa / Listings (`loykos/trovacasa-listings`) Actor

🏠 Just paste a Search URL. Clean and normalize all data automatically. Export to JSON/Excel. 🇮🇹 Incolla l'URL e ricevi dati già puliti e normalizzati

- **URL**: https://apify.com/loykos/trovacasa-listings.md
- **Developed by:** [Loykos](https://apify.com/loykos) (community)
- **Categories:** Real estate, Automation
- **Stats:** 7 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.99 / 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

## Trovacasa Scraper

Actor Apify per lo scraping di annunci immobiliari da [Trovacasa.it](https://www.trovacasa.it).

### Descrizione

Questo Actor estrae informazioni dettagliate sugli annunci immobiliari pubblicati su Trovacasa.it. L'Actor naviga automaticamente le pagine di ricerca (listing), identifica i link agli annunci e raccoglie tutti i dati disponibili per ciascun immobile.

### Funzionalità

- ✅ Scraping automatico di pagine di listing (ricerca)
- ✅ Estrazione dettagliata di informazioni per ogni annuncio
- ✅ Gestione automatica della paginazione (maxPages)
- ✅ Supporto per proxy (configurabile)
- ✅ Retry automatico con gestione errori
- ✅ Output strutturato in formato JSON

### Input

L'Actor accetta i seguenti parametri di input:

#### `startUrls` (obbligatorio)

Array di URL delle pagine di listing da cui iniziare lo scraping. **Importante**: devono essere pagine di ricerca/listing, non pagine di dettaglio singoli annunci.

**Esempio:**

```json
{
    "startUrls": [
        {
            "url": "https://www.trovacasa.it/case-in-vendita/milano"
        }
    ]
}
```

#### `maxPages` (opzionale)

Numero massimo di pagine di listing da processare. Se non specificato, verranno processate tutte le pagine disponibili.

**Default:** `1`

**Nota:** Gli utenti con account gratuito sono limitati a 1 pagina automaticamente.

#### `proxyConfiguration` (opzionale)

Configurazione proxy per la protezione anti-bot. Di default utilizza Apify Proxy residenziale per l'Italia.

**Default:**

```json
{
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "IT"
}
```

### Output

L'Actor salva i dati estratti nel dataset di Apify. Ogni record contiene le seguenti informazioni:

#### Struttura Dati

```typescript
{
    id: string;                    // ID univoco dell'annuncio
    url: string;                    // URL della pagina dell'annuncio
    titolo: string;                 // Titolo dell'annuncio
    prezzo: string;                 // Prezzo dell'immobile
    indirizzo: string;              // Indirizzo completo
    superficie: string;            // Superficie in metri quadri
    locali: string;                 // Numero di locali
    bagni: string;                 // Numero di bagni
    riferimento: string;           // Riferimento dell'annuncio
    codiceAnnuncio: string;        // Codice annuncio univoco
    descrizione: string;            // Descrizione completa
    caratteristiche: {
        tipologia: string;          // Tipo di immobile (Appartamento, Villa, ecc.)
        contratto: string;          // Tipo di contratto (Vendita, Affitto)
        comune: string;             // Comune dell'immobile
        classeEnergetica: string;   // Classe energetica (A-G)
        consumoEnergetico: string;  // Consumo energetico in kWh
    };
    tag: string[];                 // Tag e caratteristiche aggiuntive
    immagini: string[];            // URL delle immagini
    agenzia: {
        nome: string;              // Nome dell'agenzia
        logo: string;              // URL del logo
        indirizzo: string;          // Indirizzo dell'agenzia
        link: string;              // Link alla pagina dell'agenzia
    };
    telefoni: string[];            // Numeri di telefono dell'agenzia
}
```

#### Viste Dataset

Il dataset include due viste predefinite:

1. **Overview**: Vista compatta con i campi principali
2. **Dettagli Completi**: Vista completa con tutti i campi disponibili

#### Limitazioni Account Gratuito

Gli utenti con account gratuito sono automaticamente limitati a **1 pagina di listing**. Per rimuovere questa limitazione, è necessario un piano a pagamento.

# Actor input Schema

## `startUrl` (type: `string`):

URL to start with. Must be a LISTING page only (not a detail page).

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

Maximum number of listing pages to process (includes the start page). If empty, all pages will be processed.

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

Proxy settings for anti-bot protection. Default uses Apify residential proxy in Italy.

## Actor input object example

```json
{
  "startUrl": "https://www.trovacasa.it/case-in-vendita/milano",
  "maxPages": 1,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "IT"
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `dettagli` (type: `string`):

No description

## `dataset` (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 = {
    "startUrl": "https://www.trovacasa.it/case-in-vendita/milano",
    "maxPages": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("loykos/trovacasa-listings").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 = {
    "startUrl": "https://www.trovacasa.it/case-in-vendita/milano",
    "maxPages": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("loykos/trovacasa-listings").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "startUrl": "https://www.trovacasa.it/case-in-vendita/milano",
  "maxPages": 1
}' |
apify call loykos/trovacasa-listings --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=loykos/trovacasa-listings",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

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