# VivaReal Location Autocomplete API Documentation

Scrappa's `GET /api/vivareal/location-autocomplete` resolves a place name into the `location_id` that the search, count and map-pins endpoints filter on. Each location has its `type` (neighborhood, city, zone, street), `name`, coordinates, the portal's site-relative `url` and the address parts.

This is the only source of a working location filter. Pass `location_id` to the search endpoint exactly as returned. A valid answer is billed, including an empty page. Failures never consume credits.

- **Documentation:** [https://scrappa.co/docs/vivareal-api/vivareal_location_autocomplete](https://scrappa.co/docs/vivareal-api/vivareal_location_autocomplete)
- **API group:** VivaReal & ZAP Imoveis API
- **Endpoint:** `GET https://scrappa.co/api/vivareal/location-autocomplete`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `portal` | string | No | ZAP (default) for ZAP Imoveis or VIVAREAL for VivaReal. Both use the same fields and filters. |
| `q` | string | Yes | Place name, for example Pinheiros. |
| `size` | integer | No | Maximum locations, 1-50 (default 10). |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/vivareal/location-autocomplete?portal=ZAP&q=Pinheiros"
```

## Example response

```json
{
    "success": true,
    "query": "Pinheiros",
    "returned": 1,
    "locations": [
        {
            "type": "neighborhood",
            "name": "Pinheiros",
            "url": "/venda/imoveis/sp+sao-paulo+zona-oeste+pinheiros/",
            "location_id": "BR>Sao Paulo>NULL>Sao Paulo>Zona Oeste>Pinheiros",
            "street": null,
            "neighborhood": "Pinheiros",
            "zone": "Zona Oeste",
            "city": "Sao Paulo",
            "state": "Sao Paulo",
            "state_code": "SP",
            "lat": -23.563579,
            "lon": -46.691607
        }
    ],
    "meta": {
        "billable": true,
        "endpoint_family": "location-autocomplete",
        "portal": "ZAP",
        "attempts": 1
    }
}
```

## Frequently asked questions

### Is this the official VivaReal or ZAP API?

No. Scrappa is an independent service and is not affiliated with VivaReal, ZAP Imoveis or their owners. Neither portal publishes a developer API.

### Are failed requests charged?

A valid answer is billed, including an empty page. Failures never consume credits.

## Related endpoints

- [Property Search](https://scrappa.co/docs/vivareal-api/vivareal_search)

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
