# Portal Inmobiliario Locations API Documentation

Look up regions, comunas and neighborhoods by name. Each row carries the label, the level (state, city or neighborhood), the portal ids and the ready-made slug for the location parameter of the search and projects endpoints. A valid empty result is a successful response.

- **Documentation:** [https://scrappa.co/docs/portal-inmobiliario-api/portal_inmobiliario_locations](https://scrappa.co/docs/portal-inmobiliario-api/portal_inmobiliario_locations)
- **API group:** Portal Inmobiliario API
- **Endpoint:** `GET https://scrappa.co/api/portal-inmobiliario/locations`

## 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, at least 2 characters, e.g. providencia. |
| `level` | string | No | Optional: state, city or neighborhood. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/portal-inmobiliario/locations?query=providencia"
```

## Example response

```json
{
    "success": true,
    "data": {
        "locations": [
            {
                "id": "TUxDQ1BST2NhYjU3",
                "label": "Providencia, RM (Metropolitana)",
                "name": "Providencia",
                "region": "RM (Metropolitana)",
                "level": "city",
                "slug": "providencia-metropolitana"
            }
        ],
        "total": 1
    },
    "meta": {
        "endpoint_family": "locations",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A public parameter or range is invalid. This response is not billable. |
| 404 | Not Found | The listing id or the location slug is unknown. This response is not billable. |
| 503 | Upstream Unavailable | Portal Inmobiliario blocked every route, did not answer or returned a page the API could not read. 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)
