# Bilbasen Search API Documentation

Search current Bilbasen vehicle listings with validated filters, sorting, and page pagination. Totals and next-page signals are live snapshots from the marketplace.

- **Documentation:** [https://scrappa.co/docs/bilbasen-api/bilbasen_search](https://scrappa.co/docs/bilbasen-api/bilbasen_search)
- **API group:** Bilbasen API
- **Endpoint:** `GET https://scrappa.co/api/bilbasen/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` | string | No | Vehicle category. v1 supports bil (car). |
| `make` | string | No | Make key from the metadata taxonomy without the trailing slash, for example vw or alfa_romeo. |
| `model` | string | No | Bilbasen model key: the model name as shown on listings in lowercase, spaces as underscores, for example golf_vii, id.3 or t-roc. Model series such as golf are not supported. An unknown make or model returns 422 UNKNOWN_MAKE_OR_MODEL. Requires make. |
| `sort` | string | No | price_asc, price_desc, date_desc, date_asc, kml_desc, distance_asc, mileage_asc, mileage_desc, year_desc, year_asc, make_asc, hk_desc, moth_asc, batterycapacity_asc, batterycapacity_desc, electricmotorrange_asc, or electricmotorrange_desc. |
| `year_to` | integer | No | Optional maximum first-registration year. |
| `price_from` | integer | No | Optional minimum price in DKK. |
| `price_to` | integer | No | Optional maximum price in DKK. |
| `mileage_from` | integer | No | Optional minimum mileage in kilometres. |
| `mileage_to` | integer | No | Optional maximum mileage in kilometres. |
| `fuel` | string | No | Fuel code from the metadata taxonomy: 1 Benzin, 2 Diesel, 3 El, 6 Hybrid (Benzin + El), 8 Hybrid (Diesel + El), 11 Plug-in hybrid Benzin, 12 Plug-in hybrid Diesel. |
| `body_type` | string | No | Body type key, for example SUV. |
| `horse_power_from` | integer | No | Optional minimum horsepower. |
| `horse_power_to` | integer | No | Optional maximum horsepower. |
| `consumption_from` | number | No | Optional minimum consumption in km/l. |
| `consumption_to` | number | No | Optional maximum consumption in km/l. |
| `photo_ads` | boolean | No | When true, only listings with photos are returned. |
| `page` | integer | No | One-based result page. Defaults to 1. |
| `page_size` | integer | No | Listings per page, from 1 to 30. Defaults to 30. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/bilbasen/search?category=bil&make=vw&model=tiguan&page=1&page_size=3"
```

## Example response

```json
{
    "success": true,
    "data": {
        "listings": [
            {
                "listing_id": "6934633",
                "title": "VW Passat 2,0 FSi Comfortline 4d",
                "make_model_line": "VW Passat",
                "variant_line": "2,0 FSi Comfortline 4d",
                "price": {
                    "amount": 19800,
                    "currency": "DKK",
                    "display_value": "19.800 kr."
                }
            }
        ],
        "pagination": {
            "page": 1,
            "page_size": 3,
            "total": 6983,
            "total_dealer_hits": 6388,
            "total_private_hits": 595,
            "next_page": 2,
            "live_snapshot": true
        }
    },
    "meta": {
        "endpoint_family": "search"
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Listing Not Found | The requested listing is no longer available. This response is not billable. |
| 422 | Validation Error | A public parameter or range is invalid. This response is not billable. |
| 502 | Invalid Source Response | The marketplace returned an invalid response. 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)
