# Motors.co.uk Scraper (`dadhalfdev/motors-scraper`) Actor

Scrape used cars and vans from motors.co.uk. Paste a search URL from your browser, or use filters (make, model, price, mileage, fuel, body, transmission). Returns price, mileage, year, specs, dealer, and listing URL.

- **URL**: https://apify.com/dadhalfdev/motors-scraper.md
- **Developed by:** [Marco Rodrigues](https://apify.com/dadhalfdev) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 83.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🚗 Motors.co.uk Scraper

Want to find the perfect used car or van, or analyze the UK automotive market? This scraper makes it super easy!

Paste an **`input_url`** from your browser once you've already filtered on Motors, **or** use **structured filters** (make, model, price, mileage, fuel, body, transmission, etc.) — structured filters work better for AI agents. When `input_url` is set it overrides the filters. Either way, you get up to 1000 used **car** or **van** listings from [motors.co.uk](https://www.motors.co.uk/) with pricing, specs, and dealer details as CSV or JSON.

### 💡 Perfect for...

- **Car & Van Buyers:** Monitor the market for the best deals on your next vehicle in the UK.
- **Dealerships:** Keep an eye on competitors' pricing and inventory to stay competitive.
- **Market Research:** Analyze trends in the UK used car and van market (average prices, popular models, mileage vs. price).
- **Data Analysts:** Download clean, structured data for visualizations, dashboards, or predictive pricing models.
- **🤖 AI Agents:** Power your autonomous agents with real-time Motors listings. Perfect for OpenClaw workflows and bots tracking specific vehicles.
- **📚 RAG Systems:** Feed detailed vehicle specifications and pricing into Retrieval-Augmented Generation pipelines to answer complex queries about the automotive market.
- **🔗 AI Workflows:** Integrate seamlessly with LangChain, AutoGPT, CrewAI, and other AI frameworks that need structured automotive data.

### ✨ Why you'll love this scraper

- 🔗 **Input URL or Filters:** Paste a Motors search URL (`input_url`) if you already filtered in the browser, or use structured filters (better for AI agents). `input_url` always wins when set.
- 🎯 **Website-Matched Filters:** Make, model, fuel, body, transmission, colour, price, mileage, and age use the **same option values as motors.co.uk**.
- 🚚 **Cars and Vans:** Switch `vehicle_type` between used cars and used vans.
- ⚙️ **Rich Listings:** Extracts price, year, mileage, fuel, body, transmission, colour, dealer, and images out of the box.
- ⏱️ **Sorting Options:** Traverse results by distance, price, age, mileage, MPG, or newest ads — same sort ids as on the site.
- 🇬🇧 **Built for the UK:** Motors requires a postcode; use Distance = **National** for a nationwide scrape.

### 📦 What's inside the data?

For every single listing, you will get:

- **Core Details:** `id`, `title`, `url`, `image`, `variant`
- **Technical Specs:** `make`, `model`, `fuel_type`, `body_style`, `transmission`, `colour`, `engine_size_litres`, `mileage`, `year`, `registration`
- **Pricing:** `price`, `price_text`, `reduced`
- **Dealer:** `dealer_name`, `dealer_id`, `dealer_town`, `dealer_county`, `dealer_postcode`
- **Context:** `vehicle_type` (`cars` / `vans`), `distance_miles`, `sold`

### 🛠️ Sort options

You can tell the scraper what order to read the listings in using the `sort_by` parameter (same values as Motors):

- **`0`** – Sort by distance *(default)*
- **`1`** – Lowest price
- **`2`** – Highest price
- **`3`** – Most recently added
- **`7`** – Greatest price reduction
- **`14` / `15`** – Mileage low–high / high–low
- **`16` / `17`** – Age low–high / high–low
- **`18`** – Best MPG

### 🚀 Quick start

**Option A — Input URL**

1. Open [Motors](https://www.motors.co.uk/), apply filters in the browser (include a postcode), copy the results URL — ideally `https://www.motors.co.uk/search/car/?make=...&PostCode=...` or `/search/van/...`.
2. Paste it into `input_url`.
3. Set `max_cars` and click **Start**.

**Option B — Structured filters (better for AI agents)**

1. Leave `input_url` empty.
2. Choose **Used cars** or **Used vans**.
3. Set `postcode` (required by Motors; use Distance = National for nationwide).
4. Pick make/model and optional filters from the dropdowns (same lists as on Motors).
5. Choose `sort_by`, set `max_cars` (up to 1000).
6. Click **Start** and export CSV, Excel, or JSON when done.

***

#### Tech details for developers 🧑‍💻

**Input Example (structured filters):**

```json
{
  "vehicle_type": "cars",
  "postcode": "SW1A1AA",
  "make": "BMW",
  "model": "BMW::3 Series",
  "max_price": "15000",
  "fuel_type": "diesel",
  "transmission": "Automatic",
  "distance": "1000",
  "sort_by": "1",
  "max_cars": 100
}
```

**Input Example (URL override):**

```json
{
  "input_url": "https://www.motors.co.uk/search/car/?make=BMW&model=3%20Series&PostCode=SW1A1AA&Distance=1000",
  "max_cars": 500
}
```

**Input Example (used vans):**

```json
{
  "vehicle_type": "vans",
  "postcode": "SW1A1AA",
  "make": "Ford",
  "model": "Ford::Transit Custom",
  "distance": "1000",
  "max_cars": 100
}
```

**Output Example:**

```json
{
  "id": 78115419,
  "title": "2016 (66) - 3.0 335d M Sport Touring Auto xDrive Euro 6 (s/s) 5dr",
  "url": "https://www.motors.co.uk/car-78115419",
  "image": "https://cdn.images.autoexposure.co.uk/AETA32645/AETV64713674_1e.jpg",
  "make": "BMW",
  "model": "3 Series",
  "variant": "2016 (66) - 3.0 335d M Sport Touring Auto xDrive Euro 6 (s/s) 5dr",
  "price": 12985,
  "price_text": "£12,985",
  "mileage": 100000,
  "mileage_text": "100,000",
  "year": "2016",
  "registration": "LN66DFJ",
  "fuel_type": "Diesel",
  "body_style": "Estate",
  "transmission": "Automatic",
  "colour": "White",
  "engine_size_litres": "3",
  "distance_miles": 99,
  "vehicle_type": "cars",
  "sold": false,
  "reduced": true,
  "dealer_name": "Digbeth Motor Sales Ltd",
  "dealer_id": 98994,
  "dealer_town": null,
  "dealer_county": null,
  "dealer_postcode": null
}
```

### 📋 Input reference (detailed)

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `input_url` | string | No | — | Paste a Motors search URL; overrides all filters below when set. Leave empty to use filters (better for AI agents). Prefer `/search/car/` or `/search/van/` URLs with query params. |
| `vehicle_type` | string enum | No | `cars` | `cars` (Used cars) or `vans` (Used vans). |
| `postcode` | string | No\* | `SW1A1AA` | UK postcode required by Motors search. \*Required unless provided inside `input_url`. Pair with Distance = National for a nationwide scrape. |
| `make` | string enum | No | any | Vehicle make from Motors (e.g. `BMW`, `Ford`, `Volkswagen`). |
| `model` | string enum | No | any | Make + model as `Make::Model` (e.g. `BMW::3 Series`, `Ford::Transit Custom`). Pick a row that matches your Make. |
| `min_price` / `max_price` | string enum | No | any | Price ladder values from the Motors search panel (e.g. `5000`, `15000`). |
| `max_mileage` | string enum | No | any | Max mileage ladder (e.g. `50000` = up to 50,000 miles). |
| `max_age` | string enum | No | any | Max age ladder (e.g. `5` = up to 5 years old). |
| `fuel_type` | string enum | No | any | Site fuel values (e.g. `diesel`, `petrol`, `full electric`, `hybrid - petrol/electric`). |
| `body_style` | string enum | No | any | Body style from Motors (cars: `hatchback`, `suv`, …; vans: `van`, `luton`, `tipper`, …). |
| `transmission` | string enum | No | any | `Automatic` or `Manual`. |
| `colour` | string enum | No | any | Exterior colour from Motors (e.g. `black`, `white`, `grey`). |
| `distance` | string enum | No | `1000` | Search radius from postcode. `1000` = **National**. |
| `sort_by` | string enum | No | `0` | Result order (see sort options above). |
| `max_cars` | integer | No | `50` | Maximum listings to return (`1`–`1000`). |

#### Notes on filters

- Prefer exact enum strings from the Apify input dropdowns (same values as motors.co.uk).
- `model` uses `Make::Model` (double colon), e.g. `BMW::3 Series`.
- Motors search **requires a UK postcode**. Use `distance: "1000"` (National) for countrywide results.
- Prefer `/search/car/` or `/search/van/` URLs with query params. Brand SEO paths under `/used-cars/for-sale/{make}/` may redirect away from Motors.
- `input_url` always wins over filters when provided.

# Actor input Schema

## `input_url` (type: `string`):

Paste a Motors search URL (e.g. https://www.motors.co.uk/search/car/?make=BMW\&PostCode=SW1A1AA) to use instead of the filters below — overrides all structured filters when set. Leave empty to use the filters below (better for AI agents).

## `vehicle_type` (type: `string`):

Search used cars or used vans.

## `postcode` (type: `string`):

UK postcode required by Motors search. Pair with Distance = National for a nationwide search.

## `make` (type: `string`):

Vehicle make (same values as on motors.co.uk).

## `model` (type: `string`):

Make + model (same values as on motors.co.uk). Choose a row matching your Make.

## `min_price` (type: `string`):

Minimum price ladder from the Motors search panel.

## `max_price` (type: `string`):

Maximum price ladder from the Motors search panel.

## `max_mileage` (type: `string`):

Maximum mileage ladder from the Motors search panel.

## `max_age` (type: `string`):

Maximum vehicle age ladder from the Motors search panel.

## `fuel_type` (type: `string`):

Fuel type values from motors.co.uk.

## `body_style` (type: `string`):

Body style values from motors.co.uk.

## `transmission` (type: `string`):

Transmission values from motors.co.uk.

## `colour` (type: `string`):

Colour values from motors.co.uk.

## `distance` (type: `string`):

Search radius from postcode. National = 1000.

## `sort_by` (type: `string`):

Sort order from the Motors results page.

## `max_cars` (type: `integer`):

Maximum number of listings to scrape (capped at 1000).

## Actor input object example

```json
{
  "vehicle_type": "cars",
  "postcode": "SW1A1AA",
  "make": "",
  "model": "",
  "min_price": "",
  "max_price": "",
  "max_mileage": "",
  "max_age": "",
  "fuel_type": "",
  "body_style": "",
  "transmission": "",
  "colour": "",
  "distance": "1000",
  "sort_by": "0",
  "max_cars": 50
}
```

# Actor output Schema

## `overview` (type: `string`):

Table view of scraped listings using the dataset 'overview' view.

## `results` (type: `string`):

All scraped listings from the default dataset without view transformation.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("dadhalfdev/motors-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("dadhalfdev/motors-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call dadhalfdev/motors-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dadhalfdev/motors-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/KB9IMaEKzmlEFtmTV/builds/NfCQtl5U71zOHmae3/openapi.json
