# Yaencontre Search

Searches sale, rental, vacation rental, new construction and transfer stock. This is also the agency-pages surface: pass real_estate_agency_id and the response carries both the agency stock and the agency profile. Geography can be scoped with an autocomplete location token or with a lat_min/lat_max/lon_min/lon_max box.

- **Documentation:** [https://scrappa.co/docs/yaencontre-api/yaencontre_search](https://scrappa.co/docs/yaencontre-api/yaencontre_search)
- **API group:** Yaencontre API
- **Endpoint:** `GET https://scrappa.co/api/yaencontre/search`

## 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 |
| --- | --- | --- | --- |
| `operation` | string | No | BUY, RENT, or TRANSFER. Default BUY. |
| `family` | string | No | FLAT, HOUSE, GARAGE, LAND, NEW_CONSTRUCTION, OFFICE, HOME, BUILDING, or BUSINESS. Default FLAT. BUSINESS requires operation=TRANSFER. Under RENT, HOME returns both long-term and seasonal stock unless rental_type narrows it. |
| `location` | string | No | Location token from the autocomplete endpoint, for example madrid. |
| `real_estate_agency_id` | integer | No | Agency identifier from the autocomplete agencies bucket, for example 40524. |
| `min_price` | integer | No | Lower price bound in euros. Valid only with operation=BUY. |
| `max_price` | integer | No | Upper price bound in euros. Valid only with operation=BUY. |
| `rooms` | integer | No | Minimum number of rooms, from 1 to 4. Values outside that range return 422. |
| `bathrooms` | integer | No | Minimum number of bathrooms, from 1 to 4. Values outside that range return 422. |
| `rental_type` | string | No | LONG_TERM_RENT or SEASONAL_RENT. Valid only with operation=RENT. |
| `lat_min` | number | No | South edge of the map box. Send with lat_max, lon_min and lon_max. |
| `lat_max` | number | No | North edge of the map box. |
| `lon_min` | number | No | West edge of the map box. |
| `lon_max` | number | No | East edge of the map box. |
| `size` | integer | No | Map size hint sent with a bounds box. Default 200. |
| `page_number` | integer | No | 1-based page number. |
| `page_size` | integer | No | Results per page, 1 to 50. Default 50. |

## Example request

```bash
#!/bin/bash

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

## Example response

```json
{
    "success": true,
    "data": {
        "total_items": 17912,
        "num_pages": 896,
        "current_page": 1,
        "title": "17.912 Pisos y viviendas en venta en Madrid",
        "location": {
            "name": "Madrid",
            "value": "madrid"
        },
        "items": [
            {
                "reference": "66504-112724772",
                "title": "Piso en venta, Palos de Moguer en Arganzuela en Madrid",
                "price": 549000,
                "area": 105,
                "rooms": 2,
                "bathrooms": 2,
                "available": true,
                "advertiser_type": "agency"
            }
        ]
    }
}
```

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