# Casa Sapo Locations API

<p>Look up Portuguese distritos, concelhos and freguesias by name. Each hit has its label, `slug`, `level` (distrito, concelho or freguesia) and the number of listings Casa Sapo reports for it. Use the `slug` as the `location` parameter of the search endpoint. A query without matches is a successful empty list. Casa Sapo publishes the content signal ai-train=no: do not use this data to train AI models.</p>

- **Documentation:** [https://scrappa.co/docs/casa-sapo-api/casa_sapo_locations](https://scrappa.co/docs/casa-sapo-api/casa_sapo_locations)
- **API group:** Casa Sapo API
- **Endpoint:** `GET https://scrappa.co/api/casa-sapo/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. lisb. |

## Example response

```json
{
    "data": {
        "locations": [
            {
                "slug": "lisboa",
                "label": "Lisboa, Distrito de Lisboa",
                "level": "concelho",
                "concelho_slug": "lisboa",
                "listing_count": 7839
            },
            {
                "slug": "distrito.lisboa",
                "label": "Distrito de Lisboa",
                "level": "distrito",
                "listing_count": 15483
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "locations"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
|  | The listing, agency or location does not exist. This response is not billable. |  |
|  | A parameter or filter is missing or invalid. This response is not billable. |  |
|  | Casa Sapo answered a page that no longer matches the documented contract. This response is not billable. |  |
|  | Casa Sapo is temporarily unavailable. Retry the request. 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)
