# Urbania Peru Real Estate Scraper | Property Listings & API (`scrapers_lat/urbania-scraper`) Actor

Scrape Urbania.pe real estate listings for sale or rent across Peru: Lima, Arequipa, Cusco. Get price in USD and PEN, maintenance fee, bedrooms, bathrooms, area, district, coordinates, agent phone, WhatsApp, agency and image galleries. Filter by price, area, beds. Export JSON, CSV, Excel.

- **URL**: https://apify.com/scrapers_lat/urbania-scraper.md
- **Developed by:** [Scrapers Lat](https://apify.com/scrapers_lat) (community)
- **Categories:** Business, E-commerce, Automation
- **Features:** Limited permissions
- **Stats:** 18 total users, 6 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

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

[![Urbania Peru Real Estate Scraper](https://scrapers.lat/banners/urbania-scraper.png)](https://console.apify.com/actors/MujEhXd6zsbQhvMVO/input)

## Urbania Peru Real Estate Scraper: Property Listings Data and API

Scrape **Urbania.pe**, Peru's largest real estate portal, and get clean, structured **property listings data** for sale and rent across Lima, Arequipa, Cusco, Trujillo, Piura and every other market on the site. This is the most complete **Urbania scraper** available: it returns every field the listing and detail pages expose, including **agent phone and WhatsApp**, the full **image gallery**, **amenities**, **map coordinates**, prices in **both USD and PEN**, and derived analytics like **price per square meter**.

Here is one real result (image gallery trimmed to 3 of 17 real URLs):

```json
{
  "imageUrl": "https://img10.naventcdn.com/avisos/111/00/14/96/61/43/720x532/1614231298.jpg",
  "title": "Venta de Departamento Amoblado Primer Piso en San Miguel con Patio Privado",
  "price": 438406,
  "currency": "PEN",
  "priceUsd": 129000,
  "pricePen": 438406,
  "pricePerM2": 5768.5,
  "pricePerM2Currency": "PEN",
  "operationType": "venta",
  "propertyType": "Departamento",
  "bedrooms": 2,
  "bathrooms": 2,
  "totalAreaM2": 76,
  "builtAreaM2": 76,
  "maintenanceFee": 200,
  "maintenanceFeeCurrency": "PEN",
  "location": "San Miguel, Lima",
  "address": "San Miguel",
  "district": "San Miguel",
  "city": "Lima",
  "province": "Lima",
  "status": "ONLINE",
  "reserved": false,
  "age": "2",
  "postingCode": "7985584"
}
```

The example above shows the first 25 of 40 fields.

### What it does

The actor opens one or more Urbania.pe search result URLs, paginates through the matching property listings, and writes one normalized record per listing to the run's dataset. Card data (price in both currencies, maintenance fee, bedrooms, bathrooms, area, location, agency logo and a description snippet) is captured for every listing. When `withDetails` is enabled, each listing's detail page is fetched to add the full description, complete amenities list, full image gallery, publisher and agent contacts with phone and WhatsApp, the exact street address and map coordinates.

### Quickstart

Open the actor, paste this into the input, and press Run. It returns 10 apartment-for-sale listings with full detail pages.

```json
{
  "maxListings": 10,
  "withDetails": true,
  "startUrl": "https://urbania.pe/buscar/venta-de-departamentos",
  "priceCurrency": "USD"
}
```

### Billing and limits

- **Pay per result.** You are charged per record returned (`result` event). See the [pricing tab](https://apify.com/scrapers_lat/urbania-scraper/pricing) for the current per-result price.
- **Detail add-on.** With `withDetails` on, each enriched record adds one `details` charge, billed only after the row is delivered and only on a genuine detail success. It runs on paid plans only.
- **No charge on failure.** If a run errors, the actor writes a single item with a populated `error` field and does not charge for it. Empty runs cost nothing.
- **Spend cap respected.** Set `maxTotalChargeUsd` on the run; once reached, the actor stops emitting and charging further billable results.
- **Free Apify plans** are capped at 10 records per run and list-only output. Upgrade for the full result set and detail pages.

### FAQ and troubleshooting

**A run returned 0 records. Why?**
The search URL matched nothing, or your Min/Max filters removed everything. Loosen the filters or widen the search URL. Zero-result runs are not charged.

**Is this an official Urbania tool?**
No. This actor is independent and has no affiliation with Urbania. It reads only data that is publicly available on urbania.pe.

***

***

## Urbania Peru Scraper de Inmuebles: Datos y API de Propiedades

Extrae datos de **Urbania.pe**, el portal inmobiliario mas grande del Peru, y obten **datos de propiedades** limpios y estructurados en venta y alquiler en Lima, Arequipa, Cusco, Trujillo, Piura y cualquier otro mercado del sitio. Este es el **scraper de Urbania** mas completo disponible: devuelve todos los campos que exponen las paginas de aviso y de detalle, incluido el **telefono del agente y WhatsApp**, la **galeria de imagenes** completa, las **comodidades**, las **coordenadas** en el mapa, precios en **dolares y soles**, y campos derivados como el **precio por metro cuadrado**.

Aqui tienes un resultado real (galeria de imagenes recortada a 3 de 17 URLs reales):

```json
{
  "imageUrl": "https://img10.naventcdn.com/avisos/111/00/14/96/61/43/720x532/1614231298.jpg",
  "title": "Venta de Departamento Amoblado Primer Piso en San Miguel con Patio Privado",
  "price": 438406,
  "currency": "PEN",
  "priceUsd": 129000,
  "pricePen": 438406,
  "pricePerM2": 5768.5,
  "pricePerM2Currency": "PEN",
  "operationType": "venta",
  "propertyType": "Departamento",
  "bedrooms": 2,
  "bathrooms": 2,
  "totalAreaM2": 76,
  "builtAreaM2": 76,
  "maintenanceFee": 200,
  "maintenanceFeeCurrency": "PEN",
  "location": "San Miguel, Lima",
  "address": "San Miguel",
  "district": "San Miguel",
  "city": "Lima",
  "province": "Lima",
  "status": "ONLINE",
  "reserved": false,
  "age": "2",
  "postingCode": "7985584"
}
```

El ejemplo muestra los primeros 25 de 40 campos.

### Que hace

El actor abre una o varias URLs de resultados de busqueda de Urbania.pe, recorre las paginas de avisos que coinciden y escribe un registro normalizado por aviso en el dataset de la ejecucion. Los datos de la tarjeta (precio en ambas monedas, mantenimiento, dormitorios, banos, area, ubicacion, logo de la inmobiliaria y un extracto de la descripcion) se capturan en cada aviso. Cuando `withDetails` esta activo, se descarga la pagina de detalle de cada aviso para agregar la descripcion completa, la lista completa de comodidades, la galeria completa de imagenes, los contactos de la inmobiliaria y del agente con telefono y WhatsApp, la direccion exacta y las coordenadas del mapa.

### Inicio rapido

Abre el actor, pega esto en la entrada y presiona Run. Devuelve 10 avisos de departamentos en venta con paginas de detalle completas.

```json
{
  "maxListings": 10,
  "withDetails": true,
  "startUrl": "https://urbania.pe/buscar/venta-de-departamentos",
  "priceCurrency": "USD"
}
```

### Facturacion y limites

- **Pago por resultado.** Se cobra por registro devuelto (evento `result`). Consulta la [pestana de precios](https://apify.com/scrapers_lat/urbania-scraper/pricing) para el precio por resultado vigente.
- **Complemento de detalle.** Con `withDetails` activo, cada registro enriquecido agrega un cargo `details`, facturado solo despues de entregar la fila y solo ante un exito genuino de detalle. Corre solo en planes de pago.
- **Sin cargo por fallo.** Si una ejecucion falla, el actor escribe un unico item con el campo `error` poblado y no lo cobra. Las ejecuciones vacias no cuestan nada.
- **Limite de gasto respetado.** Configura `maxTotalChargeUsd` en la ejecucion; al alcanzarlo, el actor deja de emitir y cobrar mas resultados facturables.
- **Los planes gratuitos de Apify** estan limitados a 10 registros por ejecucion y salida solo de tarjeta. Actualiza para el conjunto completo de resultados y paginas de detalle.

### Preguntas frecuentes

**Una ejecucion devolvio 0 registros. Por que?**
La URL de busqueda no coincidio con nada, o tus filtros Min/Max eliminaron todo. Afloja los filtros o amplia la URL de busqueda. Las ejecuciones con cero resultados no se cobran.

**Es esta una herramienta oficial de Urbania?**
No. Este actor es independiente y no tiene afiliacion con Urbania. Solo lee datos disponibles publicamente en urbania.pe.

# Actor input Schema

## `maxListings` (type: `integer`):

Maximum number of listings to collect. Optional.

## `withDetails` (type: `boolean`):

When enabled, each listing's detail page is fetched to add the full description, amenities, complete image gallery, publisher/agent contacts, maintenance fee, exact address and coordinates. This is a paid add-on (billed via the 'details' event) and runs on paid plans only.

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

An Urbania.pe search results URL. Apply any filters on urbania.pe and paste the resulting URL, for example https://urbania.pe/buscar/venta-de-departamentos-en-lima

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

Optional list of Urbania.pe search URLs to scrape in one run, in addition to Search URL. Accepts plain URL strings or {"url": "..."} objects. Results are de-duplicated across all URLs.

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

Keep only listings priced at or above this amount, in the currency set below. Optional.

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

Keep only listings priced at or below this amount, in the currency set below. Optional.

## `priceCurrency` (type: `string`):

Currency that the Min/Max price bounds apply to. Listings in the other currency are skipped only when a price bound is set.

## `minBedrooms` (type: `integer`):

Keep only listings with at least this many bedrooms. Optional.

## `maxBedrooms` (type: `integer`):

Keep only listings with at most this many bedrooms. Optional.

## `minBathrooms` (type: `integer`):

Keep only listings with at least this many bathrooms. Optional.

## `minAreaM2` (type: `integer`):

Keep only listings with total area at or above this many square meters. Optional.

## `maxAreaM2` (type: `integer`):

Keep only listings with total area at or below this many square meters. Optional.

## Actor input object example

```json
{
  "maxListings": 10,
  "withDetails": true,
  "startUrl": "https://urbania.pe/buscar/venta-de-departamentos",
  "startUrls": [],
  "priceCurrency": "USD"
}
```

# 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 = {
    "maxListings": 10,
    "startUrl": "https://urbania.pe/buscar/venta-de-departamentos",
    "startUrls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapers_lat/urbania-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 = {
    "maxListings": 10,
    "startUrl": "https://urbania.pe/buscar/venta-de-departamentos",
    "startUrls": [],
}

# Run the Actor and wait for it to finish
run = client.actor("scrapers_lat/urbania-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 '{
  "maxListings": 10,
  "startUrl": "https://urbania.pe/buscar/venta-de-departamentos",
  "startUrls": []
}' |
apify call scrapers_lat/urbania-scraper --silent --output-dataset

```

## MCP server setup

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