# PistonHeads Scraper: UK Used, Classic & Performance Cars (`fayoussef/pistonheads`) Actor

Our pistonheads.com scraper effortlessly gathers URLs from all pages and extracts detailed information from each listing card.

- **URL**: https://apify.com/fayoussef/pistonheads.md
- **Developed by:** [youssef farhan](https://apify.com/fayoussef) (community)
- **Categories:** Automation, Developer tools, Other
- **Stats:** 11 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 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/actors/running/actors-in-store.md#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

## PistonHeads Scraper: UK Used, Classic & Performance Cars

Scrape PistonHeads.com car listings at scale with this actor that reads the site's own pagination API and extracts 30+ structured fields per vehicle, including GBP price, engine specs, CO2 emissions, fuel consumption, seller phone, and location data. Built for UK car dealerships, automotive data teams, and market researchers who need comprehensive classified ad data from one of the UK's most active enthusiast car marketplaces.

### What you get

**Listing info**

- `url`: direct link to the listing on PistonHeads.com
- `condition`: New or Used
- `status`: active/sold

**Vehicle specs**

- `manufacturer`, `model`, `version`
- `registration_year`
- `body_type`, `transmission`, `fuel_type`
- `engine_size`, `engine_power`
- `co2_emissions`, `fuel_consumption`
- `doors`, `seats`
- `exterior_colour`
- `number_of_owners`

**Pricing**

- `price`: numeric GBP value
- `formatted_price`: display string (e.g., "£24,995")
- `currency`: GBP

**Mileage**

- `mileage`: odometer reading

**Location**

- `city`, `county`, `postcode`, `country`

**Seller**

- `seller_name`
- `seller_type`: Private or Dealer
- `seller_phone`

### Sample output

```json
{
  "url": "https://www.pistonheads.com/buy/listing/12345678",
  "manufacturer": "Porsche",
  "model": "911",
  "version": "Carrera S",
  "registration_year": 2019,
  "condition": "Used",
  "price": 89995,
  "formatted_price": "£89,995",
  "currency": "GBP",
  "mileage": 22000,
  "body_type": "Coupe",
  "transmission": "Automatic",
  "fuel_type": "Petrol",
  "engine_size": "3.0L",
  "engine_power": "450bhp",
  "co2_emissions": "205g/km",
  "fuel_consumption": "30mpg",
  "doors": 2,
  "seats": 4,
  "exterior_colour": "Guards Red",
  "number_of_owners": 2,
  "city": "London",
  "county": "Greater London",
  "postcode": "SW1A 1AA",
  "country": "England",
  "seller_name": "Porsche Centre London",
  "seller_type": "Dealer",
  "seller_phone": "+44 20 1234 5678"
}
```

### Use cases

- UK car dealerships tracking competitor pricing for performance and prestige vehicles on PistonHeads
- Automotive market researchers building pricing indices for specialist and enthusiast vehicles in the UK
- Classic and performance car brokers monitoring market availability and price trends by make and model
- Data aggregators feeding specialist vehicle platforms with fresh PistonHeads listings
- Insurers and financiers tracking residual values for prestige vehicles by age and mileage band
- Individual buyers monitoring specific makes and models across the UK by price and location

### Pricing

Pay per result, plus a small monthly base fee. The current rates are shown on this Actor's Store page.

First results are free, so test before subscribing.

### How it works

- Input one or more PistonHeads.com search URLs (any make, model, price, or year filter)
- Every filter in the URL is honoured, because the Actor reads the exact filter set the search page itself resolved
- Listings are paged through the site's own results API, which reports the total number of matches
- `max_pages` caps the depth per search URL at 16 listings per page, and the run stops early once the search runs out of results
- Each listing is fetched and 30+ fields extracted from the page and API response
- Results are available in JSON, CSV, or Excel from the Apify dataset

### Why this scraper

- Uses PistonHeads' own results API for paging, so no page is missed and no page is fetched twice
- Extracts CO2 emissions and fuel consumption, fields most generic scrapers skip but valuable for fleet/tax analysis
- Returns seller phone number per listing, direct contact data that many alternatives omit
- Includes `number_of_owners`, a key value indicator for used car buyers and analysts
- No proxy configuration needed; Apify proxy handles rotation by default

### Input example

```json
{
  "start_urls": [
    { "url": "https://www.pistonheads.com/buy/search?distance=20&price=9000&price=10000&year=2021&year=2025" }
  ],
  "max_pages": 3
}
```

### FAQ

**Does the scraper handle all vehicle types on PistonHeads?**
Yes. Provide any PistonHeads search URL, whether cars, classic vehicles, or project cars.

**Does it include seller contact details?**
Yes. Seller name, type (private or dealer), and phone number are extracted per listing.

**What output formats are available?**
JSON, CSV, and Excel, available from the Apify dataset UI and via REST API.

**Can I limit how many pages it scrapes?**
Yes. `max_pages` caps the depth per search URL, one page being 16 listings. Set it high to take everything a search returns: the run stops as soon as the results are exhausted, so a large value never costs extra time.

**Does it support scheduling?**
Yes. Use Apify's built-in scheduler for daily or weekly automated runs.

**Can I use this via API or MCP?**
Yes. Callable via the Apify REST API and available as an MCP server for AI agents (Claude, ChatGPT, Cursor).

**What if the site structure changes?**
Contact via the Issues tab or reach out at [automationbyexperts.com](https://automationbyexperts.com).

### Use via API or MCP

Call this actor via the Apify REST API or as an MCP server for AI agents (Claude, ChatGPT, Cursor):

```
https://mcp.apify.com/actors/fayoussef/pistonheads
```

Full API docs: <https://docs.apify.com/api/v2>

### Need a custom scraper?

Need PistonHeads data combined with AutoTrader UK or Motors.co.uk, scheduled daily, or pushed to a database? Visit [automationbyexperts.com](https://automationbyexperts.com) for custom builds, retainers, and data-as-a-service.

# Actor input Schema

## `start_urls` (type: `array`):

PistonHeads search result URLs to scrape. Open a search on pistonheads.com, apply your filters, then paste the URL here. All filters in the URL are honoured.

## `max_pages` (type: `integer`):

How many result pages to collect per search URL. One page is 16 listings. The run stops early when the search runs out of results, so a high value never wastes time.

## Actor input object example

```json
{
  "start_urls": [
    {
      "url": "https://www.pistonheads.com/buy/search?price=9000&price=10000&transmission=MAN&year=2021&year=2025"
    }
  ],
  "max_pages": 3
}
```

# 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 = {
    "start_urls": [
        {
            "url": "https://www.pistonheads.com/buy/search?price=9000&price=10000&transmission=MAN&year=2021&year=2025"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fayoussef/pistonheads").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 = { "start_urls": [{ "url": "https://www.pistonheads.com/buy/search?price=9000&price=10000&transmission=MAN&year=2021&year=2025" }] }

# Run the Actor and wait for it to finish
run = client.actor("fayoussef/pistonheads").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 '{
  "start_urls": [
    {
      "url": "https://www.pistonheads.com/buy/search?price=9000&price=10000&transmission=MAN&year=2021&year=2025"
    }
  ]
}' |
apify call fayoussef/pistonheads --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fayoussef/pistonheads"
        }
    }
}

```

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/JCWJsNIoZhas0eEKp/builds/JiNUJNnU9ARDd1n20/openapi.json
