# Wikicasa Property Search API Documentation

Scrappa's `GET /api/wikicasa/search` returns Wikicasa property for sale or rent in one Italian city.

## What you get

`data.count` is the number of matches, `data.items` holds up to 25 listings. Each item has `id`, `url`, `title`, `description`, `price`, `area_sqm`, `rooms`, `bathrooms`, `address`, `zone`, `city`, coordinates, `condition`, `energy_class`, `flags`, `auction`, `published_at`, the first `image`, the `agency` and the `agent`.

## How to use it

1. Call `GET /api/wikicasa/autocomplete` and take `city_id` and `slug` of a place with `searchable` true.
2. Pass them as `city_id` and `city_slug`, with `transaction` sale or rent.
3. Add filters. Use `GET /api/wikicasa/property-types` for `property_type`.

## Filters

Every filter is checked again on each item. Items that break a filter are removed and counted in `meta.filtered_out`. `data.count` is the total Wikicasa reports for the search. A price that Wikicasa hides is returned as `null` with `price_reserved` true, and such an item does not pass a price filter.

## Pagination

`page` is 1-based, 25 listings per page, up to page 2000. `meta.page` always equals the page you asked for. `meta.has_more` tells you whether a next page exists.

## Not supported

There is no bedrooms filter. Wikicasa filters rooms and bathrooms. Zone, province and region search are not available and answer 422.

- **Documentation:** [https://scrappa.co/docs/wikicasa-api/wikicasa_search](https://scrappa.co/docs/wikicasa-api/wikicasa_search)
- **API group:** Wikicasa API
- **Endpoint:** `GET https://scrappa.co/api/wikicasa/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 |
| --- | --- | --- | --- |
| `transaction` | string | Yes | sale or rent. The Italian words vendita and affitto also work. |
| `city_id` | integer | Yes | Numeric city id from the autocomplete endpoint, for example 15146 for Milano. |
| `city_slug` | string | Yes | City slug from the autocomplete endpoint, for example milano. |
| `page` | integer | No | Result page, 1 to 2000. A page holds up to 25 listings. Default: 1. |
| `price_min` | integer | No | Minimum price in EUR (monthly rent for rent). Checked on every item. |
| `price_max` | integer | No | Maximum price in EUR. Must not be below price_min. Checked on every item. |
| `area_min` | integer | No | Minimum area in m2. Checked on every item. |
| `area_max` | integer | No | Maximum area in m2. Checked on every item. |
| `rooms_min` | integer | No | Minimum number of rooms (locali). Checked on every item. |
| `rooms_max` | integer | No | Maximum number of rooms. Checked on every item. |
| `bathrooms_min` | integer | No | Minimum number of bathrooms. Checked on every item. |
| `bathrooms_max` | integer | No | Maximum number of bathrooms. Checked on every item. |
| `property_type` | string | No | Type id or key with searchable true from the property-types endpoint, for example appartamenti or 5. |
| `condition` | string | No | new, refurbished (refurbished or new) or to_refurbish. Checked on every item. |
| `sort` | string | No | most_recent (default), price_asc, price_desc or area_desc. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/wikicasa/search?transaction=sale&city_id=15146&city_slug=milano&price_max=400000&sort=price_asc"
```

## Example response

```json
{
    "success": true,
    "data": {
        "count": 2537,
        "items": [
            {
                "id": 31209219,
                "url": "https://www.wikicasa.it/annuncio/31209219",
                "title": "Bilocale in Viale Monte Nero, Milano",
                "description": "Montenero vendiamo in esclusiva ottimo bilocale piu servizi, ingresso soggiorno con cucinotto, camera da letto matrimoniale, bagno, cantina.",
                "transaction": "sale",
                "price": 460000,
                "price_sale": 460000,
                "price_rent": null,
                "original_price": null,
                "price_reserved": false,
                "currency": "EUR",
                "area_sqm": 55,
                "rooms": 2,
                "bathrooms": 1,
                "address": "Viale Monte Nero",
                "zone": "Porta Romana, Sabotino, Muratori, Cadore, Montenero, Cinque Giornate",
                "city": "Milano",
                "city_id": 15146,
                "latitude": 45.4569,
                "longitude": 9.2051,
                "typology_id": 1,
                "macro_typology_id": 1,
                "condition": "refurbished",
                "energy_class": "D",
                "flags": {
                    "garden": false,
                    "luxury": false,
                    "recent": true,
                    "opportunity": false,
                    "furnished": true,
                    "bare_ownership": false,
                    "short_rent": false
                },
                "auction": {
                    "is_auction": false,
                    "days_left": null,
                    "discount_percent": null
                },
                "published_at": "2026-10-26",
                "image": "https://images.wk-cdn.it/3790b1dec9e72e38f05336c59c9e3b34c36e2f0eb056e4682d5263cdf5e762a6//original",
                "floor_plan_count": 0,
                "virtual_tour_url": null,
                "project_units": 0,
                "agency": {
                    "id": 59246,
                    "name": "REIA Association of Italian Real Estate Agents",
                    "city": "Milano",
                    "latitude": 45.4563735,
                    "longitude": 9.1530444,
                    "premium": false,
                    "image_id": 1266737544
                },
                "agent": null
            }
        ]
    },
    "meta": {
        "endpoint_family": "search",
        "billable": true,
        "page": 1,
        "per_page": 25,
        "has_more": true,
        "filtered_out": 0
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 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 | Wikicasa could not be reached, refused the request or answered with data 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)
