# PistonHeads UK Car Classifieds Scraper (`bovi/pistonheads-scraper`) Actor

Scrape UK performance and enthusiast car listings from PistonHeads.com. Returns price, year, mileage, fuel, transmission, body type, engine, seller and photos. Filter by make, model, price, year, mileage, fuel, postcode or paste a search URL. No login.

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

## Pricing

from $1.50 / 1,000 pistonheads uk car classifieds scrapers

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Car Classifieds Scraper

**Scrape used-car listings from [PistonHeads.com](https://www.pistonheads.com), the UK's enthusiast car marketplace.** Every car comes back as one flat row with price, year, mileage, fuel type, transmission, body type, colour, engine power and size, seller details, location and photos. No login and no API key are needed.

PistonHeads lists hundreds of thousands of performance, classic and everyday cars. Browsing page by page and copying details into a spreadsheet is slow. This Actor reads the public PistonHeads search API (the same one the website uses) and returns the whole result set in one dataset you can export to JSON, CSV, Excel or XML.

### What it collects

| Field | Description |
|---|---|
| `id`, `url` | PistonHeads listing ID and the link to the listing page |
| `headline` | Listing title |
| `make`, `model`, `year` | Manufacturer, model and registration year |
| `price`, `currency`, `pricingModel` | Asking price in GBP (`null` when the price is on application), and the pricing type (Visible, OnApplication, OnlineAuction) |
| `isPriceOnApplication`, `isAuction`, `isVatOmitted`, `isFeatured` | Listing flags |
| `mileage`, `fuelType`, `transmission`, `bodyType`, `colour` | Specification (empty when the seller did not provide it) |
| `enginePower`, `engineSize` | Power in bhp and engine size in cc |
| `imageUrl`, `imageUrls` | Main photo and the gallery photos |
| `sellerId`, `sellerName`, `sellerType`, `sellerLocation`, `isOnlineRetailer` | Seller information (Trade or Private) |
| `distanceFromPostcode` | Distance to your postcode, only when a postcode search is used |
| `badges` | Listing badges, only when the listing has any |
| `auction` | Auction status, end time, highest bid, number of bids and reserve status, only for online auctions |
| `scrapedAt` | When the record was collected |

### Input

All fields are optional. With the defaults the Actor returns the first 50 cars from the whole used-car search.

- **Search URL** - paste a PistonHeads URL such as `https://www.pistonheads.com/buy/porsche/911` or `https://www.pistonheads.com/buy/search?keywords=gt3`. The make, model and query parameters in the URL override the filter fields.
- **Max results** - how many cars to collect (default 50).
- **Filters** - make (for example `porsche`, `aston-martin`), model text, keywords, price range, year range, mileage range, fuel type, transmission, body type, seller type, UK postcode with a search radius, and an option to include sold cars.
- **Sort by** - relevance, most recent, price, distance, mileage or year.
- **Proxy configuration** - optional. PistonHeads works without a proxy; turn on Apify Proxy if you get blocked.

Example input:

```json
{
  "makeUrlName": "porsche",
  "model": "911",
  "transmissions": ["MAN"],
  "priceMax": 90000,
  "yearMin": 1995,
  "sortOption": "PriceLowToHigh",
  "maxResults": 100
}
```

### Example output

```json
{
  "id": "21342997",
  "url": "https://www.pistonheads.com/buy/listing/21342997",
  "headline": "Volkswagen T-Roc 2.0 TSI 300 4MOTION R 5dr DSG",
  "make": "Volkswagen",
  "model": "T-Roc R",
  "year": 2023,
  "price": 27490,
  "currency": "GBP",
  "pricingModel": "Visible",
  "mileage": 44133,
  "fuelType": "Petrol",
  "transmission": "Auto",
  "bodyType": "Hatchback",
  "colour": "Grey",
  "enginePower": 296,
  "engineSize": 1984,
  "sellerName": "Oldham Volkswagen",
  "sellerType": "Trade",
  "sellerLocation": "Oldham , United Kingdom",
  "imageUrl": "https://img.pistonheads.com/Fullsize/volkswagen/t-roc/...-1.jpg"
}
```

### Pricing

This Actor uses pay-per-result pricing: you pay only for the car listings written to your dataset, and the platform bills each result itself. The price per result is shown on the Actor's pricing tab, and `maxResults` caps the cost of a run.

### Tips

- Use the make filter together with a model to narrow a large result set; one search can return up to hundreds of thousands of cars.
- Sort by **Most recent** and schedule the Actor to monitor new listings.
- Price on application listings have `price: null`.
- Specification fields such as fuel type or colour are `null` when the seller left them blank.

### Disclaimer

This Actor is unofficial and is not affiliated with, endorsed by or sponsored by PistonHeads. It collects only publicly available listing data. You are responsible for using the data in line with the site's terms and applicable data-protection laws.

# Actor input Schema

## `searchUrl` (type: `string`):

Optional. Paste a PistonHeads.com search URL, e.g. https://www.pistonheads.com/buy/porsche/911 or https://www.pistonheads.com/buy/search?keywords=gt3. The make, model and query parameters (keywords, postcode, distance, priceMin, priceMax, yearMin, yearMax, mileageMin, mileageMax, transmission, sortOption, sellerType) are applied and override the filter fields below.

## `maxResults` (type: `integer`):

Maximum number of car listings to collect.

## `makeUrlName` (type: `string`):

Manufacturer as written in PistonHeads URLs, e.g. porsche, aston-martin, bmw, alfa-romeo.

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

Model name or part of it (needs a make), e.g. 911, Cayenne, M3. Matches every variant that contains the text.

## `keywords` (type: `string`):

Free-text keywords searched in the listings, e.g. gt3 or manual v8.

## `priceMin` (type: `integer`):

Lowest asking price in pounds.

## `priceMax` (type: `integer`):

Highest asking price in pounds.

## `yearMin` (type: `integer`):

Earliest registration year.

## `yearMax` (type: `integer`):

Latest registration year.

## `mileageMin` (type: `integer`):

Lowest mileage.

## `mileageMax` (type: `integer`):

Highest mileage.

## `fuelTypes` (type: `array`):

Only these fuel types. Leave empty for all.

## `transmissions` (type: `array`):

Only these gearbox types. Leave empty for all.

## `bodyTypes` (type: `array`):

Only these body styles. Leave empty for all.

## `sellerType` (type: `string`):

Trade dealers, private sellers, or any.

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

Full UK postcode for a distance search, e.g. NN12 8TN. Used together with the distance below.

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

Search radius around the postcode. Ignored when no postcode is given.

## `includeSold` (type: `boolean`):

Also return listings that are already sold.

## `sortOption` (type: `string`):

Order of the results.

## `proxyConfiguration` (type: `object`):

Optional. PistonHeads is reachable without a proxy; enable Apify Proxy if you run into blocks. Without it the Actor connects directly.

## Actor input object example

```json
{
  "searchUrl": "https://www.pistonheads.com/buy/search",
  "maxResults": 50,
  "sellerType": "",
  "distance": "2147483647",
  "includeSold": false,
  "sortOption": "PHBrand",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Dataset with the scraped car listings.

# 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 = {
    "searchUrl": "https://www.pistonheads.com/buy/search",
    "maxResults": 50,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("bovi/pistonheads-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 = {
    "searchUrl": "https://www.pistonheads.com/buy/search",
    "maxResults": 50,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("bovi/pistonheads-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 '{
  "searchUrl": "https://www.pistonheads.com/buy/search",
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call bovi/pistonheads-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bovi/pistonheads-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/XhwfHxJEpMnwymIRo/builds/jDh14OHIjcLYpfLTq/openapi.json
