# VivaReal & ZAP Imóveis Scraper (`gio21/vivareal-zap-scraper`) Actor

Scrape property listings from VivaReal and ZAP Imóveis — Brazil's top real estate portals. Extract price, address, bedrooms, bathrooms, area, amenities, images and contact info. Pay per property scraped.

- **URL**: https://apify.com/gio21/vivareal-zap-scraper.md
- **Developed by:** [Gio](https://apify.com/gio21) (community)
- **Categories:** Real estate, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 324 total users, 49 monthly users, 99.9% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.50 / 1,000 property scrapeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## VivaReal & ZAP Imóveis Scraper

Extrai listagens de imóveis do **VivaReal** e do **ZAP Imóveis**, os dois maiores portais imobiliários do Brasil.

Faz chamadas diretas à API GLUE (a mesma API que o site usa internamente) com TLS fingerprint de Chrome. Sem browser, sem Cloudflare, sem proxy obrigatório. Resultado: ~100 imóveis em poucos segundos com 100% dos campos preenchidos.

### O que extrai

| Campo | Descrição |
|---|---|
| `id` / `externalId` | IDs do imóvel |
| `title` | Título do anúncio (o do portal quando disponível; senão montado a partir dos dados do imóvel) |
| `description` | Descrição. Vem completa quando o anúncio é buscado por `listingUrls`; na busca costuma vir `null`, porque o portal não a entrega na listagem |
| `listingType` | `SALE` (venda) ou `RENTAL` (aluguel) |
| `unitType` | Tipo real do imóvel: `APARTMENT`, `HOME`, `CONDOMINIUM`, `PENTHOUSE`, `FLAT`, `KITNET`, `OFFICE` etc |
| `unitTypeLabel` | Tipo em português: Apartamento, Casa, Cobertura etc |
| `unitSubTypes` | Subtipos informados pelo anunciante (`DUPLEX`, `PENTHOUSE`, `SINGLE_STOREY_HOUSE` etc) |
| `usageType` | `RESIDENTIAL` ou `COMMERCIAL` |
| `propertyType` | Campo bruto do portal (quase sempre `UNIT`); use `unitType` |
| `price` | Preço em BRL |
| `condoFee` | Condomínio mensal |
| `iptu` | IPTU anual |
| `usableArea` / `totalArea` | Área útil e total em m² |
| `bedrooms` / `bathrooms` | Quartos e banheiros |
| `parkingSpaces` | Vagas de garagem |
| `suites` | Suítes |
| `street` / `neighborhood` / `city` / `state` / `zipCode` | Endereço completo |
| `lat` / `lng` | Coordenadas geográficas |
| `amenities` | Lista de comodidades |
| `images` | URLs das imagens (ver nota abaixo) |
| `advertiserName` / `advertiserPhones` | Dados do anunciante |
| `whatsapp` | WhatsApp do anunciante |
| `url` | Link do imóvel no portal |
| `createdAt` / `updatedAt` | Datas de publicação e atualização |
| `source` | `api` (busca, resultado completo e paginado), `ssr` (só a primeira página, quando a API do portal bloqueia o run) ou `detail` (anúncio buscado por `listingUrls`) |

> **Nota sobre imagens:** a API de listagem do portal não expõe as imagens. Na busca, o Actor as recupera da primeira página de resultados, então os imóveis das páginas seguintes podem vir com `images` vazio. Um imóvel buscado por `listingUrls` vem com todas as imagens. Todos os outros campos (preço, condomínio, IPTU, área, quartos, endereço, coordenadas, telefones e WhatsApp do anunciante) são retornados normalmente.

> **Proxy:** este Actor usa **proxy residencial** por padrão para evitar o bloqueio anti-bot (Cloudflare) do portal. Mantenha essa configuração. Se você informar outro proxy e ele for bloqueado (HTTP 403), o Actor troca sozinho para o residencial padrão no restante do run.

> **Resultado parcial:** se a API do portal bloquear o run mesmo assim, o Actor devolve a primeira página de resultados lida da própria página de busca (com coordenadas, endereço, IPTU, condomínio e anunciante). Nesse caso os itens vêm com `source: "ssr"` e a mensagem de status do run começa com `SSR fallback, partial data`. Rode de novo para obter o resultado completo.

### Como usar

#### Parâmetros de entrada

| Parâmetro | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| `location` | string | ✅ (ou `listingUrls`) | Cidade, URL de busca do VivaReal ou URL de busca do ZAP Imóveis |
| `listingUrls` | array | ❌ | Anúncios específicos: URL do anúncio ou só o ID, um por item. Pode ser usado sozinho ou junto com `location` |
| `unitTypes` | array | ❌ | Filtra por tipo de imóvel, ex.: `["HOME"]` ou `["APARTMENT", "PENTHOUSE"]`. Vale para qualquer `location` e tem prioridade sobre o tipo da URL |
| `maxItems` | number | ❌ | Máximo de imóveis da busca (padrão: 100). Não limita `listingUrls` |

#### Exemplos de `location`

```
São Paulo
sao-paulo
https://www.vivareal.com.br/venda/sp/sao-paulo/
https://www.vivareal.com.br/aluguel/rj/rio-de-janeiro/apartamento_residencial/
https://www.zapimoveis.com.br/venda/imoveis/sp+sao-paulo/
https://www.vivareal.com.br/venda/ceara/fortaleza/bairros/meireles/casa_residencial/
https://www.vivareal.com.br/venda/ceara/fortaleza/bairros/meireles/rua-coronel-juca/
https://www.zapimoveis.com.br/venda/casas/ce+fortaleza++meireles/
```

#### Filtro por tipo de imóvel

O tipo pode vir da URL (`/casa_residencial/` no VivaReal, `/casas/` no ZAP) ou do parâmetro `unitTypes`. O resultado traz só imóveis do tipo pedido. Se o portal não aplicar o filtro, o Actor não devolve (nem cobra) imóveis de outro tipo e avisa na mensagem de status do run.

URLs de bairro e de rua também são respeitadas: uma URL de rua retorna só os imóveis daquela rua.

#### Filtros de preço, área e cômodos

Os filtros que o portal coloca na URL da busca são aplicados: `precoMinimo`, `precoMaximo`, `areaMinima`, `areaMaxima`, `quartos`, `banheiros`, `vagas`, `precoMinimoCondo`, `precoMaximoCondo` e `precoTotal`. Exemplo:

```
https://www.vivareal.com.br/venda/sp/sao-paulo/apartamento_residencial/?precoMinimo=500000&precoMaximo=600000&areaMinima=60&areaMaxima=80&quartos=2
```

Filtros da URL que o Actor não aplica (por exemplo `amenities`) aparecem em um aviso no log do run.

#### Anúncios específicos (`listingUrls`)

Para buscar um ou mais anúncios pelo link ou pelo ID:

```json
{
  "listingUrls": [
    "https://www.vivareal.com.br/imovel/apartamento-3-quartos-coco-bairros-fortaleza-com-garagem-194m2-venda-RS2400000-id-2895350242/",
    "2899301004"
  ]
}
```

Cada anúncio volta com rua e número, coordenadas, preço, condomínio, IPTU, área, todas as imagens, anunciante, descrição completa e datas de publicação e atualização, com `source: "detail"`. Uma URL de anúncio colada no campo `location` funciona do mesmo jeito. Anúncio removido ou ID inválido não gera item (e não é cobrado): ele aparece na mensagem de status do run.

#### Exemplo de input

```json
{
  "location": "https://www.vivareal.com.br/venda/sp/sao-paulo/",
  "unitTypes": ["HOME"],
  "maxItems": 200
}
```

### Preços

Modelo **Pay Per Event**: você paga pelo que extrair.

- **US$ 0,0025 por imóvel** extraído (US$ 2,50 por 1.000 imóveis), seja da busca ou de `listingUrls`
- **US$ 0,00005 por início de run** (uma vez por run, por GB de memória)

Imóvel que não é retornado (anúncio removido, ID inválido, item fora do filtro) não é cobrado.

### Portais suportados

- ✅ VivaReal (`vivareal.com.br`)
- ✅ ZAP Imóveis (`zapimoveis.com.br`)

### Notas

- Requer proxy residencial brasileiro para melhor performance (Apify Residential Proxy)
- Dados reais diretos da API interna dos portais
- Taxa de sucesso: ~100% com proxy ativo

# Actor input Schema

## `location` (type: `string`):

City name (e.g. 'São Paulo'), or a full VivaReal/ZAP search URL. Type, neighborhood and street URLs are supported, and so are the price, area, bedroom, bathroom and parking filters of the URL (e.g. ?precoMinimo=500000\&precoMaximo=800000\&areaMinima=60\&quartos=2). Examples: https://www.vivareal.com.br/venda/ceara/fortaleza/bairros/meireles/casa_residencial/ or https://www.zapimoveis.com.br/venda/casas/ce+fortaleza++meireles/. Optional when Listing URLs is filled.

## `listingUrls` (type: `array`):

Optional. Fetch specific listings instead of (or in addition to) a search: one VivaReal/ZAP listing URL or listing ID per line (e.g. https://www.vivareal.com.br/imovel/...-id-2895350242/ or just 2895350242). Each listing comes back with street, coordinates, price, area, full description and publication dates.

## `unitTypes` (type: `array`):

Optional. Return only these property types (e.g. HOME for houses, APARTMENT, PENTHOUSE). Works with any location or URL and overrides a type segment in the URL (such as /casa_residencial/). Leave empty for all types.

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

Maximum number of properties to scrape from the search (default: 100). Does not limit Listing URLs.

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

Leave empty (recommended): the actor uses Brazilian residential IPs by default, which is what VivaReal/ZAP accept. Set your own proxy only if you need to.

## Actor input object example

```json
{
  "location": "https://www.vivareal.com.br/venda/sp/sao-paulo/",
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "BR"
  }
}
```

# 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 = {
    "location": "https://www.vivareal.com.br/venda/sp/sao-paulo/",
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "BR"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("gio21/vivareal-zap-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 = {
    "location": "https://www.vivareal.com.br/venda/sp/sao-paulo/",
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "BR",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("gio21/vivareal-zap-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 '{
  "location": "https://www.vivareal.com.br/venda/sp/sao-paulo/",
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "BR"
  }
}' |
apify call gio21/vivareal-zap-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gio21/vivareal-zap-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/MCjGMuaHn9oWR3gTA/builds/e94bBnTGYGJxxDpEh/openapi.json
