# Immobiliare Search

Returns one page of live Italian listings plus the total number of matching listings. A location is required: pass city_id from the autocomplete endpoint, or province. Listing descriptions are only present on the listing detail endpoint.

- **Documentation:** [https://scrappa.co/docs/immobiliare-api/immobiliare_search](https://scrappa.co/docs/immobiliare-api/immobiliare_search)
- **API group:** Immobiliare API
- **Endpoint:** `GET https://scrappa.co/api/immobiliare/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 |
| --- | --- | --- | --- |
| `city_id` | integer | No | City identifier from the autocomplete endpoint, for example 8042 for Milan. |
| `province` | string | No | Province code, for example MI or RM. |
| `contract` | string | Yes | v for sale, a for rental. |
| `category` | integer | Yes | 1 homes and apartments, 4 rooms, 6 new builds, 20 buildings, 21 warehouses, 22 garages, 23 offices, 24 land, 25 sheds, 26 shops. |
| `typology` | integer | No | 4 apartment, 5 penthouse, 7 detached house, 12 villa, 54 new-build apartment. |
| `price_min` | integer | No | Lowest price in euro. |
| `price_max` | integer | No | Highest price in euro. |
| `surface_min` | integer | No | Smallest floor area in square metres. |
| `surface_max` | integer | No | Largest floor area in square metres. |
| `building_use` | integer | No | 1 residential, 3 office, 10 commercial. |
| `auctions` | boolean | No | true restricts results to auction listings. |
| `start` | integer | No | Result offset for the next page. Default 0. |
| `limit` | integer | No | Page size, 1 to 50. Default 20. |
| `sort` | string | No | price, price_desc, surface, surface_desc, or recent. Sorting is applied to the returned page, not to the whole result set. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/immobiliare/search?city_id=8042&province=MI&contract=v&category=1&limit=2"
```

## Example response

```json
{
    "success": true,
    "data": {
        "listings": [
            {
                "id": 5001234,
                "analytics": {
                    "price": 250000
                }
            }
        ],
        "meta": {
            "page": {
                "start": 0,
                "count": 2,
                "total_active": 18748
            },
            "sort": {
                "applied": false,
                "mode": "none",
                "value": null
            }
        }
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The requested listing or agency was not found. This response is not billable. |
| 422 | Validation Error | A public parameter is invalid, for example a category outside the supported values or a search without a location. This response is not billable. |
| 503 | Service Unavailable | The service could not obtain a complete result. This response is not billable. |

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