# Imovelweb Autocomplete API Documentation

<p><strong>Imovelweb Autocomplete API</strong> turns a place name into location ids. Each result has the <code>location</code> id to use in search and polygon, its level (<code>zone</code> for a neighborhood, <code>city</code>, <code>state</code>), the full name and the parent chain up to Brazil. Cities and neighborhoods are suggested. Street names are not: a street query returns an empty list, which is a valid, billed answer.</p>

- **Documentation:** [https://scrappa.co/docs/imovelweb-api/imovelweb_autocomplete](https://scrappa.co/docs/imovelweb-api/imovelweb_autocomplete)
- **API group:** Imovelweb API
- **Endpoint:** `GET https://scrappa.co/api/imovelweb/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 |
| --- | --- | --- | --- |
| `query` | string | Yes | Place name, 2 to 100 characters. Example: Pinheiros. |
| `limit` | integer | No | Number of results, 1 to 25, default 10. |

## Example response

```json
{
    "data": {
        "query": "Pinheiros",
        "results": [
            {
                "name": "Pinheiros",
                "type": "zone",
                "parents": [
                    {
                        "name": "S\u00e3o Paulo",
                        "type": "city",
                        "location": "V1-C-109668"
                    },
                    {
                        "name": "S\u00e3o Paulo",
                        "type": "state",
                        "location": "V1-B-265"
                    },
                    {
                        "name": "Brasil",
                        "type": "country",
                        "location": "V1-A-2"
                    }
                ],
                "location": "V1-Z-52",
                "full_name": "Pinheiros, S\u00e3o Paulo, S\u00e3o Paulo"
            },
            {
                "name": "Alto de Pinheiros",
                "type": "zone",
                "parents": [
                    {
                        "name": "S\u00e3o Paulo",
                        "type": "city",
                        "location": "V1-C-109668"
                    },
                    {
                        "name": "S\u00e3o Paulo",
                        "type": "state",
                        "location": "V1-B-265"
                    },
                    {
                        "name": "Brasil",
                        "type": "country",
                        "location": "V1-A-2"
                    }
                ],
                "location": "V1-Z-70",
                "full_name": "Alto de Pinheiros, S\u00e3o Paulo, S\u00e3o Paulo"
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "autocomplete"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing or outside its allowed values. This response is not billable. |
| 503 | Upstream Unavailable | Imovelweb could not be reached, or returned data that does not match the expected shape. Retry shortly. This response is not billable. |

## 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)
