# PistonHeads UK Used Car Classifieds Scraper (`crawlyth-forge/pistonheads-uk-used-car-classifieds-scraper`) Actor

Search PistonHeads UK used-car listings by free text or by make and model, returning price, mileage, spec and seller details for each matching listing.

- **URL**: https://apify.com/crawlyth-forge/pistonheads-uk-used-car-classifieds-scraper.md
- **Developed by:** [crawlyth forge](https://apify.com/crawlyth-forge) (community)
- **Categories:** Automation, Lead generation, E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

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

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## PistonHeads UK Used Car Classifieds Scraper

[PistonHeads](https://www.pistonheads.com) is a UK car classifieds and enthusiast site with used-car listings by make and model. This actor reads PistonHeads' own listing data embedded in its search pages, so you get one structured record per car without visiting each listing individually.

### What this actor does

- Searches PistonHeads listings either by free text ("ford focus") or by a structured make + model pair
- Resolves a model name to PistonHeads' own generation slugs (e.g. "3 series" to several BMW 3 Series generations) and pulls listings across all matching generations
- Sorts results by date, price or mileage before trimming to your requested count
- Returns make, model, year, price, mileage, spec and seller details for every matched listing
- Omits any field PistonHeads didn't publish for that listing — no blank or placeholder values

### Output per listing

- `listingId` — PistonHeads' internal advert ID
- `listingUrl` — direct link to the listing
- `title` — listing headline
- `make`, `model`, `year`
- `price`, `priceCurrency` (GBP)
- `description` — listing summary text (up to 1000 characters)
- `imageCount` — number of photos on the listing (photo URLs are not included, see FAQ)
- `mileage`, `mileageUnit` (miles)
- `fuelType`, `transmission`, `bodyType`, `colour`
- `engineLitres`, `doors`
- `sellerName`, `sellerType`, `sellerLocation`
- `brandType` — PistonHeads' own listing category flag
- `isFeatured` — `true` for promoted listings
- `priceOnApplication` — `true` when no fixed price is published
- `recordType` (`"carListing"`), `sourceUrl`, `scrapedAt`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | select | `search` | `search` (free-text, first word treated as make) or `byMakeModel` (structured make/model) |
| `searchQuery` | string | `ford focus` | Free-text query used with `mode=search`; first word is the make, the rest is the model |
| `make` | string | – | Vehicle manufacturer, lowercase, used with `mode=byMakeModel` |
| `model` | string | – | Vehicle model, lowercase/hyphenated, used with `mode=byMakeModel` |
| `location` | string | – | Label attached to a record's `sellerLocation` only when PistonHeads doesn't publish a seller town for that listing; it does not filter results geographically |
| `sortOrder` | select | `date` | `date`, `price_asc`, `price_desc`, `relevance`, `mileage_asc` |
| `maxItems` | integer | `30` | Hard cap on emitted records |

#### Example: free-text search, cheapest first

```json
{
  "mode": "search",
  "searchQuery": "bmw 3 series",
  "sortOrder": "price_asc",
  "maxItems": 50
}
```

#### Example: structured make/model search

```json
{
  "mode": "byMakeModel",
  "make": "volkswagen",
  "model": "golf",
  "sortOrder": "date",
  "maxItems": 30
}
```

### Use cases

- **Used car price research** — compare asking prices for a make/model across current PistonHeads listings
- **Market monitoring** — track newly posted listings for a specific model on a schedule
- **Spec comparisons** — pull fuel type, transmission, engine size and mileage side by side for a shortlist
- **Dealer vs private analysis** — use `sellerType` to separate trade and private-seller listings

### FAQ

**Is this affiliated with PistonHeads?** No. This is an independent tool that reads PistonHeads' public listing pages; it is not operated by or affiliated with PistonHeads.

**What's the real difference between `search` and `byMakeModel`?** Both end up resolving the same make/model lookup internally — `search` just parses your free-text query into a make (first word) and model (remaining words) before running the identical search. Use whichever input shape is more convenient.

**Why is there no `imageUrl` field?** PistonHeads' image CDN blocks non-browser requests to its photo URLs, so photo links returned by this actor wouldn't actually load. `imageCount` tells you how many photos the listing has instead.

**Does `location` filter results by area?** No. PistonHeads' search here is organized by make/model, not postcode radius. `location` is only used to fill in `sellerLocation` on records where PistonHeads itself doesn't publish a seller town.

**Why do some listings have no `price`?** When a seller marks a listing "price on application" instead of a fixed figure, `price` is omitted and `priceOnApplication` is set to `true`.

**Do I need a login, proxy or API key?** No. PistonHeads' listing pages are public and the actor reads them directly.

**What happens if my `model` doesn't match any PistonHeads generation?** The actor logs a warning and falls back to a make-wide search instead of returning zero results.

**Can I sort by mileage?** Yes, set `sortOrder` to `mileage_asc` for lowest mileage first.

# Actor input Schema

## `mode` (type: `string`):

What to fetch.

## `searchQuery` (type: `string`):

Free-text search query (mode=search). First word is treated as the make, remaining words as the model. E.g. 'ford focus' or 'bmw 3-series'.

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

Vehicle manufacturer, e.g. ford, bmw, audi (lowercase).

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

Vehicle model, e.g. focus, 3-series, a4 (lowercase, hyphen-separated).

## `location` (type: `string`):

UK location label to attach to records as a fallback seller location (e.g. 'london', 'manchester').

## `sortOrder` (type: `string`):

How to sort results.

## `maxItems` (type: `integer`):

Hard cap on emitted records.

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "ford focus",
  "sortOrder": "date",
  "maxItems": 30
}
```

# Actor output Schema

## `listings` (type: `string`):

Dataset containing all scraped UK car listing records.

# 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 = {
    "mode": "search",
    "searchQuery": "ford focus",
    "sortOrder": "date",
    "maxItems": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlyth-forge/pistonheads-uk-used-car-classifieds-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 = {
    "mode": "search",
    "searchQuery": "ford focus",
    "sortOrder": "date",
    "maxItems": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlyth-forge/pistonheads-uk-used-car-classifieds-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "mode": "search",
  "searchQuery": "ford focus",
  "sortOrder": "date",
  "maxItems": 30
}' |
apify call crawlyth-forge/pistonheads-uk-used-car-classifieds-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlyth-forge/pistonheads-uk-used-car-classifieds-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/4JxZQOZvkuV5yOuyZ/builds/65MgT8uiH7GjQ1vVY/openapi.json
