# AutoTrader UK Real-Time Scraper (Fast & Filter-Ready) (`ahmed_jasarevic/autotrader-scraper`) Actor

High-performance scraper for AutoTrader.co.uk. Extract car listings, high-res images, and seller contact details using real-time GraphQL filtering. Supports price range, postcode proximity, and advanced sorting. Designed to bypass Cloudflare and handle 'Similar Results' bloat.

- **URL**: https://apify.com/ahmed\_jasarevic/autotrader-scraper.md
- **Developed by:** [Ahmed Jasarevic](https://apify.com/ahmed_jasarevic) (community)
- **Categories:** Developer tools, E-commerce, Real estate
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 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.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## AutoTrader UK Scraper

A powerful AutoTrader UK scraper designed to extract detailed information from car listings. It features smart GraphQL filtering, price validation, and multi-tier user limits (Free/Paid).

### Features
- **Smart Filtering:** Automatically extracts `postcode`, `price-from`, `price-to`, and `sort` directly from the URL.
- **Detailed Data:** Scrapes titles, prices, images (high resolution), and seller contact details.
- **Cloudflare Bypass:** Built with `got-scraping` to mimic real browser behavior.
- **Dynamic Limits:** Built-in logic to handle Free vs. Paid user tiers.

### Input Parameters

The actor accepts a JSON input with the following structure:

| Field | Type | Description |
|-------|------|-------------|
| `url` | String | (Required) The full AutoTrader search URL including searchId and filters. |
| `limit` | Integer | (Optional) Maximum number of items to scrape. |
| `proxyConfiguration` | Object | (Optional) Proxy settings (Residential proxies recommended). |

#### Example Input
```json
{
  "url": "[https://www.autotrader.co.uk/car-search?postcode=E17DJ&price-from=2000000&sort=relevance](https://www.autotrader.co.uk/car-search?postcode=E17DJ&price-from=2000000&sort=relevance)",
  "limit": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "groups": ["RESIDENTIAL"]
  }
}
````

### Output Data Structure

The scraper saves results in the default Dataset. Each item will have the following structure:

```json
{
	"id": "202603271060066",
	"title": "2015 Porsche 918",
	"price": "£2,250,000",
	"contactDetails": {
		"email": "jeremy@jeremycottingham.com",
		"phoneNumberOne": "(07441) 939291",
		"advertiserName": "Jeremy Cottingham",
		"advertiserTown": "WESTMINSTER",
		"advertiserPostcode": "SW1X 0BD"
	},
	"images": [
		"https://m.atcdn.co.uk/a/media/1600x1200/d034a790964943c6a11350df94bd9128.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/17532fddabac4106ae9ffc3f0d106a29.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/d41d61d3fe594418b5a5d539f61931b1.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/2ab9076943684ed9abe170152da84e65.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/e638f9228f4c4a9b9cfc3e17c36d6250.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/b351de071ec44484a60cba19518729bb.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/c91c08970fa147d59607e3b3b824670b.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/a36d45f0c3ee4c5baca89b23f7782389.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/259d124fcd74499aa17368c821c16f21.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/f07b15c3e55f47f9b7993ca97a06f0f1.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/1cd525d8215c47d8bb34b402664ff29c.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/dbbdb219f76842a6b10ca361e0c3ed19.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/1b0eec4b776e4cd7bdfae1b63666ec52.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/6ff785212a384a6f926c9a61704f3649.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/e3b34e03dbf44edfbe8ffcdca00315fa.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/6f7c1af6f433442dbde432d9539d3dab.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/6d875b127021487a8c56b391f52545c5.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/7047e8d50069460b9bbdc9218df56380.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/32d29fb1119f4017acba29c2d9fedb94.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/12e3a601e22549648acf64c194609b78.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/d73bb86895da4f6c9fbac41142b71da9.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/edaf1fa147ca427bbe8ac927878fca17.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/2c49f6c47c664afb9f6c4ebe6c42da2e.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/9236887060cc42e4aa4d00394935201c.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/8ac51f70bb87489fada6621f60eda048.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/8f8fc8aa497a45ce894b02fa0a9de5b5.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/94a187568aa8476483e39f69413423bd.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/7bf7f7293c984c2f84c4d66bab7fc22e.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/a50c52c48dd24b05953c3b364981a753.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/0ea8a1ac48684f929c082a09dea80a08.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/9711b5c5c3244e0cb374907b192eaa86.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/c32a15b3c105424e8315c76f5be819a8.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/ecd4e8de637544fd8494ba08f3642dfa.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/7f88eb15dd6b4ceda69c36341210676d.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/55dc953a343b4b2b9a4ee983ac44545c.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/79ad8c8008994e67867e38560ff86514.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/8d0bc9bffbcc435d8454d0a5ebc87b60.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/a17ee1b38eaa44de83ac662524544aa4.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/e874665c5f734abfaa4114714a3ae691.jpg",
		"https://m.atcdn.co.uk/a/media/1600x1200/b0276824e77b41cc8dd858c5b4bb30ee.jpg"
	]
}
```

### How to use

1. **Get the URL:** Go to AutoTrader.co.uk, perform your search, and copy the full URL from the address bar.
2. **Fresh Cookies:** For best results, extract the latest cookies from your browser session and update the `main.js` configuration.
3. **Run the Actor:** Paste the URL into the input field and set your desired limit.

### Troubleshooting

- **Empty results:** This usually means the `searchId` in the URL has expired or the Cloudflare cookie needs refreshing.
- **Just a moment (HTML):** Cloudflare has flagged the request. Try reducing the `CHUNK_SIZE` or using better Residential Proxies.
- **Inaccurate results:** If you see cheap cars in a luxury search, the scraper has reached the end of genuine results and is seeing "Similar results" promoted by AutoTrader. The built-in price validator will automatically attempt to skip these.

# Actor input Schema

## `url` (type: `string`):

Paste full AutoTrader search URL (must contain postcode).

## `limit` (type: `integer`):

Maximum number of listings to collect (Free users are limited to 5).

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

Recommended: Residential Proxy to avoid Cloudflare block.

## Actor input object example

```json
{
  "url": "https://www.autotrader.co.uk/car-search?postcode=E17DJ&price-from=2000000",
  "limit": 10
}
```

# 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 = {
    "url": "https://www.autotrader.co.uk/car-search?postcode=E17DJ&price-from=2000000"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ahmed_jasarevic/autotrader-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 = { "url": "https://www.autotrader.co.uk/car-search?postcode=E17DJ&price-from=2000000" }

# Run the Actor and wait for it to finish
run = client.actor("ahmed_jasarevic/autotrader-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 '{
  "url": "https://www.autotrader.co.uk/car-search?postcode=E17DJ&price-from=2000000"
}' |
apify call ahmed_jasarevic/autotrader-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "AutoTrader UK Real-Time Scraper (Fast & Filter-Ready)",
        "description": "High-performance scraper for AutoTrader.co.uk. Extract car listings, high-res images, and seller contact details using real-time GraphQL filtering. Supports price range, postcode proximity, and advanced sorting. Designed to bypass Cloudflare and handle 'Similar Results' bloat.",
        "version": "0.0",
        "x-build-id": "OC94Hp5Pz51skKgas"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ahmed_jasarevic~autotrader-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ahmed_jasarevic-autotrader-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/ahmed_jasarevic~autotrader-scraper/runs": {
            "post": {
                "operationId": "runs-sync-ahmed_jasarevic-autotrader-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/ahmed_jasarevic~autotrader-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-ahmed_jasarevic-autotrader-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "url"
                ],
                "properties": {
                    "url": {
                        "title": "Start URL",
                        "type": "string",
                        "description": "Paste full AutoTrader search URL (must contain postcode)."
                    },
                    "limit": {
                        "title": "Max Items",
                        "type": "integer",
                        "description": "Maximum number of listings to collect (Free users are limited to 5).",
                        "default": 10
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Recommended: Residential Proxy to avoid Cloudflare block."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
