# Pisos.com Property Search API Documentation

Scrappa's `GET /api/pisos/search` returns Pisos.com property for sale or rent in one Spanish location as structured JSON.

## What you get

One request returns one page of up to 30 listings and Pisos.com's own match count in `pagination.total`. Each item has `id`, `listing_id`, `url`, `title`, `location`, `operation`, `property_type`, `price` in EUR, `price_period` (month for rent, day or week for holiday lets, null for sale), `bedrooms`, `bathrooms`, `area_m2`, `floor`, `description`, `photo_count`, `image`, `latitude`, `longitude`, `locality`, `region`, `agency` (none for private sellers), `is_new_development` and `is_promoted`. Call the listing endpoint for features, energy certificate and the whole photo gallery.

## Filters are honoured

Bedrooms, bathrooms, minimum size, minimum price, features and sort are applied by Pisos.com. Bedrooms, bathrooms and `min_size` mean "this many or more", verified live. Pisos.com treats the upper price bound loosely, so `min_price`, `max_price`, `bedrooms`, `bathrooms` and `min_size` are checked again on every item. A value that the item shows and that breaks the filter removes the item. An item that shows no value for that field is kept, because Pisos.com already filtered it. Features cannot be checked again, because items carry no feature list, so they rely on Pisos.com. Items that break a filter are removed and counted in `items_dropped`. Holiday lets priced per day or week cannot be compared with a range, so they are removed too when a price filter is set. `pagination.total` stays Pisos.com's count, and `total_includes_dropped` says when it contains removed items. A page can therefore hold fewer than 30 items. Unknown parameters and unknown values are rejected with `422`.

## Location and type

`location` is the `location` value from `/api/pisos/autocomplete`. `property_type` is one of pisos, casas, aticos, duplex, estudios, locales, garajes, terrenos, and habitaciones for rent only.

## Pagination

`page` is 1-based. A page past the last page returns an empty list with `has_next_page` false. It never returns another page's listings under that page number.

## Sort

relevance (default), newest, price_asc, price_desc, bedrooms_asc, bedrooms_desc, size_asc or size_desc.

- **Documentation:** [https://scrappa.co/docs/pisos-api/pisos_search](https://scrappa.co/docs/pisos-api/pisos_search)
- **API group:** Pisos.com API
- **Endpoint:** `GET https://scrappa.co/api/pisos/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 |
| --- | --- | --- | --- |
| `location` | string | Yes | Location name from the autocomplete endpoint, for example madrid or alcala_de_henares. |
| `operation` | string | No | sale (default) or rent. |
| `property_type` | string | No | pisos (default), casas, aticos, duplex, estudios, locales, garajes, terrenos or habitaciones (rent only). |
| `min_price` | integer | No | Minimum price in EUR (monthly rent for rent). |
| `max_price` | integer | No | Maximum price in EUR. Checked again on every item. |
| `bedrooms` | integer | No | Bedrooms, this many or more, 1 to 6. Checked on every item. |
| `bathrooms` | integer | No | Bathrooms, this many or more, 1 to 5. Checked on every item. |
| `min_size` | integer | No | Minimum area in m2. Checked on every item. |
| `features` | string | No | One or more of terrace, elevator, garden, pool, parking, heating, air_conditioning. Repeat as features[] or comma-separate. |
| `has_photo` | boolean | No | true to return listings with photos only. |
| `reduced_price` | boolean | No | true to return listings with a reduced price only. |
| `sort` | string | No | relevance (default), newest, price_asc, price_desc, bedrooms_asc, bedrooms_desc, size_asc or size_desc. |
| `page` | integer | No | Result page, 1-based. A page holds up to 30 listings. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc"
```

## Example response

```json
{
    "success": true,
    "data": {
        "items": [
            {
                "id": "65098413759",
                "listing_id": "65098413759.100500",
                "url": "https://www.pisos.com/comprar/piso-gaztambide-65098413759_100500/",
                "path": "/comprar/piso-gaztambide-65098413759_100500/",
                "title": "Piso en calle de la Princesa, 76",
                "location": "Gaztambide (Distrito Chamber\u00ed. Madrid Capital)",
                "operation": "sale",
                "property_type": "piso",
                "price": 1600000,
                "currency": "EUR",
                "price_period": null,
                "price_per_m2": null,
                "bedrooms": 3,
                "bathrooms": 3,
                "area_m2": 155,
                "floor": "4\u00aa planta",
                "description": "Espectacular propiedad de alta gama llave en mano...",
                "photo_count": 34,
                "image": "https://fotos.imghs.net/mm-wp/1005/101/photo.jpg",
                "latitude": 40.4325,
                "longitude": -3.71735,
                "locality": "Madrid Capital",
                "region": "Madrid",
                "agency": {
                    "id": "100500",
                    "slug": "princess_homes",
                    "url": "https://www.pisos.com/inmobiliaria-princess_homes/"
                },
                "is_new_development": false,
                "is_promoted": true,
                "tag": "Oportunidad",
                "listing_type": null
            }
        ],
        "pagination": {
            "page": 1,
            "per_page": 30,
            "total": 1402,
            "total_pages": 47,
            "has_next_page": true
        },
        "items_dropped": 0,
        "total_includes_dropped": false,
        "applied_filters": {
            "operation": "sale",
            "location": "madrid",
            "property_type": "pisos",
            "bedrooms": 3,
            "max_price": 400000,
            "sort": "price_asc"
        }
    },
    "meta": {
        "endpoint_family": "search",
        "billable": true,
        "attempts": 1,
        "items_dropped": 0
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | Pisos.com has no results page for that location, type or filter combination (`NOT_FOUND`). Non-billable. |
| 422 | Validation Error | A query parameter is missing, unknown or unusable. Unknown parameters and unknown values are rejected, never ignored. Non-billable. |
| 503 | Upstream Unavailable | Pisos.com could not be reached, refused the request or answered with a page this API could not read (`UPSTREAM_UNAVAILABLE`). Retryable and never billed. Clients are never rate limited. |

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