# Supercasa Location Autocomplete

Resolve a free-text Portuguese place name into the locations Supercasa actually indexes. An ambiguous name returns labelled options with an opaque selection token each; pass that token back as location_selection_token to search. An unambiguous name resolves straight to listings.

- **Documentation:** [https://scrappa.co/docs/supercasa-api/supercasa_autocomplete](https://scrappa.co/docs/supercasa-api/supercasa_autocomplete)
- **API group:** Supercasa API
- **Endpoint:** `GET https://scrappa.co/api/supercasa/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 |
| --- | --- | --- | --- |
| `location` | string | No | Free-text place name, e.g. Marvila or Lisboa. |
| `location_selection_token` | string | No | A selectionToken returned by an earlier ambiguous lookup. |
| `business` | string | No | sale (default) or rent. |
| `category` | string | No | Master category slug the options are drawn from. Defaults to property. |
| `location_level` | string | No | Accepted for parity with search and deliberately not sent: a name that exists at several levels resolves to no match instead of the disambiguation options. Leave it unset here. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/supercasa/autocomplete?location=Marvila&business=sale"
```

## Example response

```json
{
    "success": true,
    "query": "Marvila",
    "ambiguous": true,
    "locationOptions": [
        {
            "label": "Marvila \u2014 freguesia, concelho de Lisboa, distrito de Lisboa",
            "level": "neighborhood",
            "locationSelectionToken": "loc_HD_Qi-4_mcwcJOlfIwO_zUOBmcx6x2-lUSj6f0drmRm9XVOHb_fA8FqU-bOr8BsudBijpw"
        }
    ],
    "total": 0
}
```

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