# Yaencontre Autocomplete

One call returns five buckets: municipalities, neighbourhoods, real_estate_agencies, pois and public_transports. Each entry carries a ready-made query object that can be replayed against search; agency entries carry the agency identifier used by real_estate_agency_id.

- **Documentation:** [https://scrappa.co/docs/yaencontre-api/yaencontre_autocomplete](https://scrappa.co/docs/yaencontre-api/yaencontre_autocomplete)
- **API group:** Yaencontre API
- **Endpoint:** `GET https://scrappa.co/api/yaencontre/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 |
| --- | --- | --- | --- |
| `search_term` | string | Yes | Free text such as madrid, Chamberí, or an agency name. |
| `operation` | string | No | Operation hint: BUY, RENT, or TRANSFER. Optional; defaults to BUY. The origin answers 400 without it, so it always goes upstream. |
| `family` | string | No | Property type hint. Optional; defaults to FLAT. The origin answers 400 without it, so it always goes upstream. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/yaencontre/autocomplete?search_term=madrid&operation=BUY&family=FLAT"
```

## Example response

```json
{
    "success": true,
    "data": {
        "municipalities": [
            {
                "name": "Madrid",
                "query": {
                    "operation": "BUY",
                    "family": "FLAT",
                    "location": "madrid"
                },
                "url": "/venta/pisos/madrid"
            }
        ],
        "neighbourhoods": [],
        "real_estate_agencies": [],
        "pois": [],
        "public_transports": []
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The requested listing reference does not exist. This response is not billable. |
| 422 | Validation Error | A public parameter is invalid, including rejected property types and transfer-only family pairings. This response is not billable and never reaches the origin. |
| 503 | Service Unavailable | The origin could not serve the request, or no usable network egress was available. This response is not billable; retry shortly. |

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