# Milanuncios Search API Documentation

Search live Milanuncios ads. category defaults to 13 (cars); use 131 for flats for sale and 132 for flats for rent, or any id from /categories. Filter by text, province (id from /locations), price range, seller type, bedrooms and surface (real estate) or brand, model, fuel and year (cars). Paginate with limit and offset; the upstream window ends at 10,000 results, so offset + limit may not exceed 10000 and total_hits is a lower bound when total_hits_is_lower_bound is true. sort newest and oldest are not available for real estate categories. A search without matches returns an empty ads array, which is a successful, billable response. Prices are in EUR.

- **Documentation:** [https://scrappa.co/docs/milanuncios-api/milanuncios_search](https://scrappa.co/docs/milanuncios-api/milanuncios_search)
- **API group:** Milanuncios API
- **Endpoint:** `GET https://scrappa.co/api/milanuncios/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 |
| --- | --- | --- | --- |
| `category` | integer | No | Category id from /categories. 13 cars (default), 131 flats for sale, 132 flats for rent. |
| `query` | string | No | Free text, up to 100 characters. |
| `province` | integer | No | Province id from /locations, for example 28 for Madrid. |
| `min_price` | integer | No | Minimum price in EUR. |
| `max_price` | integer | No | Maximum price in EUR. |
| `seller_type` | string | No | professional or private. |
| `bedrooms_from` | integer | No | Minimum bedrooms (real estate). |
| `surface_from` | integer | No | Minimum surface in square metres (real estate). |
| `brand_id` | integer | No | Car make id from /car-makes, for example 7 for BMW (cars). |
| `model_id` | integer | No | Car model id from /car-models. Requires brand_id. |
| `fuel` | string | No | Fuel slug, for example diesel or hybrid (cars). |
| `year_from` | integer | No | Minimum registration year (cars). |
| `sort` | string | No | relevance (default), newest, oldest, cheap, expensive or surface. newest and oldest are rejected for real estate categories. |
| `limit` | integer | No | Ads per page, 1 to 100. Defaults to 30. |
| `offset` | integer | No | Ads to skip. offset + limit may not exceed 10000. Defaults to 0. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/milanuncios/search?category=13&query=bmw&limit=3&offset=0&sort=newest"
```

## Example response

```json
{
    "success": true,
    "data": {
        "ads": [
            {
                "id": "614870125",
                "title": "BMW Serie 1 120d",
                "url": "https://www.milanuncios.com/bmw-de-segunda-mano/bmw-serie-1-120d-614870125.htm",
                "category_ids": [
                    1,
                    13,
                    805
                ],
                "category_names": [
                    "Motor",
                    "Coches",
                    "BMW"
                ],
                "price": {
                    "value": 30900,
                    "label": "30.900 \u20ac"
                },
                "attributes": {
                    "kilometers": 9000,
                    "year": 2026,
                    "fuel": "hybrid",
                    "transmission": "AUTOMATIC",
                    "hp": 163,
                    "doors": 5,
                    "color": "blanco"
                },
                "location": {
                    "city": "Ponferrada",
                    "province": "Le\u00f3n",
                    "region": "Castilla y Le\u00f3n"
                },
                "seller_type": "professional",
                "published_at": "2026-09-15T10:02:37Z",
                "updated_at": "2026-10-15T15:29:08Z",
                "images": [
                    "https://images.milanuncios.com/api/v1/ma-ad-media-pro/images/e51e3b1f-2c23-4c97-8b80-b3d99a14d5a5?rule=original"
                ]
            }
        ],
        "total_hits": 10000,
        "total_hits_is_lower_bound": true,
        "offset": 0,
        "limit": 3,
        "has_more": true
    },
    "meta": {
        "endpoint_family": "search",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The requested ad or car make was not found or has expired. This response is not billable. |
| 422 | Validation Error | A parameter is invalid, including a sort newest or oldest on a real estate category or an offset + limit above 10000. This response is not billable. |
| 503 | Service Unavailable | The service could not obtain a complete result from Milanuncios. 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)
