# coches.net Search

Search the live coches.net catalogue for Spain. Filters use the platform's numeric ids: make_id 7 is BMW, province_id 28 is Madrid, fuel 2 is gasoline, seller_type 1 private and 2 professional, offer_type 1 is km 0. Pagination is 1-based on ?pg= with 35 items per page; has_more comes from the real totalPages signal. A valid query with zero items is a billable empty result.

- **Documentation:** [https://scrappa.co/docs/coches-net-api/coches_net_search](https://scrappa.co/docs/coches-net-api/coches_net_search)
- **API group:** coches.net API
- **Endpoint:** `GET https://scrappa.co/api/coches-net/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 |
| --- | --- | --- | --- |
| `q` | string | No | Free text search, for example bmw x5. |
| `make_id` | integer | No | Numeric MakeId, for example 7 (BMW). |
| `model_id` | integer | No | Numeric ModelId. Requires make_id. |
| `province_id` | integer | No | Numeric province id, for example 28 (Madrid). |
| `price_min / price_max` | integer | No | EUR bounds. |
| `mileage_min / mileage_max` | integer | No | Kilometre bounds. |
| `year_min / year_max` | integer | No | Year bounds. |
| `fuel` | integer | No | Numeric Fueltype2List, for example 2 (gasolina). |
| `body_type` | integer | No | Numeric ArrBodyType id. |
| `transmission` | integer | No | Numeric TransmissionTypeId: 1 automatic, 2 manual. |
| `seller_type` | integer | No | 1 private, 2 professional. |
| `offer_type` | integer | No | Numeric OfferType, for example 1 (km 0). |
| `certified` | boolean | No | Certified vehicles only. |
| `has_photo` | boolean | No | Vehicles with photos only. |
| `sort` | string | No | Price or Year. |
| `order` | integer | No | 1 ascending, 2 descending. Default 2. |
| `page` | integer | No | 1-based page number. Paginate on total_pages, not on the item count. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/coches-net/search?make_id=7&province_id=28"
```

## Example response

```json
{
    "success": true,
    "data": {
        "items": [
            {
                "id": "71235315",
                "title": "NISSAN X-TRAIL 5pl 1.5 e4ORCE 4x4 AT NConnecta",
                "url": "https://www.coches.net/nissan-x-trail-5pl-1-5-e4orce-4x4-at-nconnecta-2024-en-madrid-71235315-covo.aspx",
                "price": {
                    "amount": 23900,
                    "currency": "EUR"
                },
                "mileage": {
                    "value": 163720,
                    "unit": "km"
                },
                "first_registration": {
                    "year": 2024
                },
                "make": {
                    "id": 18,
                    "label": "NISSAN"
                },
                "model": {
                    "id": 1362,
                    "label": "X-TRAIL"
                },
                "fuel": {
                    "id": 2,
                    "label": "Gasolina"
                },
                "location": {
                    "province_ids": [
                        28
                    ],
                    "main_province": "Madrid",
                    "main_province_id": 28
                }
            }
        ],
        "pagination": {
            "page": 1,
            "page_size": 35,
            "total_items": 4683,
            "total_pages": 134,
            "has_more": true
        },
        "aggregations": []
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The requested listing or dealer was not found. This response is not billable. |
| 422 | Validation Error | A public parameter is invalid, including a listing path that is not a coches.net listing url. This response is not billable. |
| 503 | Service Unavailable | The service could not obtain a complete result from coches.net. 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)
