# Auto Trader UK Search API Documentation

Search current car listings with postcode location, price, mileage, registration year, fuel, transmission, body type, colour, seller type, distance and sort filters. Returns natural and dealer stock listings with numeric prices, mileage, media, dealer links and a live pagination signal.

- **Documentation:** [https://scrappa.co/docs/autotrader-uk-api/autotrader_uk_search](https://scrappa.co/docs/autotrader-uk-api/autotrader_uk_search)
- **API group:** Auto Trader UK API
- **Endpoint:** `GET https://scrappa.co/api/autotrader-uk/v1/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 |
| --- | --- | --- | --- |
| `postcode` | string | Yes | UK postcode that scopes the search, e.g. SW1A1AA. |
| `price_search_type` | string | No | total or monthly. Defaults to total. |
| `make` | string | No | Vehicle make, e.g. BMW. |
| `model` | string | No | Vehicle model, e.g. 3 Series. |
| `min_price` | integer | No | Optional minimum price in GBP. |
| `max_price` | integer | No | Optional maximum price in GBP. |
| `min_year_manufactured` | integer | No | Optional minimum first registration year. |
| `max_year_manufactured` | integer | No | Optional maximum first registration year. |
| `min_mileage` | integer | No | Optional minimum mileage in miles. |
| `max_mileage` | integer | No | Optional maximum mileage in miles. |
| `fuel_type` | array | No | Repeatable fuel value, e.g. Petrol, Diesel, Electric, Hybrid. |
| `transmission` | string | No | Automatic or Manual. |
| `body_type` | string | No | e.g. Saloon, SUV, Hatchback, Coupe, Estate. |
| `colour` | string | No | e.g. Black, White, Silver. |
| `seller_type` | string | No | private or trade. |
| `distance` | integer | No | Search radius in miles from the postcode, 1 to 200. |
| `sort` | string | No | relevance, price_asc, price_desc, distance, mileage, year_dsc, year_asc or most_recent. |
| `page` | integer | No | Result page, 1 to 100. Defaults to 1. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/autotrader-uk/v1/search?postcode=SW1A1AA&price_search_type=total&make=BMW&page=1&sort=relevance"
```

## Example response

```json
{
    "success": true,
    "data": {
        "listings": [],
        "pagination": {
            "page": 1,
            "page_count": 2125,
            "total_results": 42498,
            "has_more": true
        }
    },
    "meta": {
        "endpoint_family": "search"
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Record Not Found | The requested listing or dealer 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 | Auto Trader UK 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)
