How to Scrape Gumtree UK Car and Product Listings with Python
Description and use
The tutorial produces a working Python script that extracts Gumtree UK classified listings into structured JSON. A benchmark run configured with searchQueries: ['bmw'], category: 'cars', maxPrice: 5000, and maxItems: 200 extracted 200 vehicle listings in 141.0 seconds. The dataset includes listing title, asking price in GBP, location, vehicle attributes (year, mileage, engine displacement, fuel type), seller classification (Private vs Trade), photo count, and canonical URLs.
Problem
Extract Gumtree UK classified listings (second-hand vehicles, electronics, properties, jobs) into structured JSON for analysis, pricing, or market tracking.
Outcome
The tutorial produces a working Python script that extracts Gumtree UK classified listings into structured JSON. A benchmark run configured with searchQueries: ['bmw'], category: 'cars', maxPrice: 5000, and maxItems: 200 extracted 200 vehicle listings in 141.0 seconds. The dataset includes listing title, asking price in GBP, location, vehicle attributes (year, mileage, engine displacement, fuel type), seller classification (Private vs Trade), photo count, and canonical URLs.
Workflow
- Install Python 3.11+ locally and install the Apify API client via
pip install apify-client. - Set the
APIFY_API_TOKENenvironment variable with your Apify API token. - Navigate to the Gumtree Scraper Actor page on Apify Store (
https://apify.com/reventadata/gumtree-scraper) and inspect available input parameters. - Initialize the Apify client:
client = ApifyClient(os.environ['APIFY_API_TOKEN']). - Define extraction parameters in
run_input(e.g.,searchQueries,category,maxPrice,maxItems). - Configure optional filters (
sellerType,excludeDamaged,excludeAccessories,requireKeywordMatch,sortBy,minBatteryHealth,minStorageGb). - Trigger the Actor run:
run = client.actor('reventadata/gumtree-scraper').call(run_input=run_input). - Wait for execution to complete and verify status is 'SUCCEEDED'.
- Retrieve the resulting dataset from the completed run.
Evidence
By the end of this tutorial, you will have a working Python script that extracts Gumtree UK classified listings into structured JSON: listing title, asking price in GBP, location, vehicle attributes (year, mileage, engine size, fuel type, seller type), and search-card text (empty in this run's 200 car listings).
Scraping it manually is tedious, while unproxied requests were blocked after about five pages in August 2026 testing.
Our benchmark run (wLjjEPn8CAa3waRI5, configured with searchQueries: ['bmw'], category: 'cars', maxPrice: 5000, and maxItems: 200) took 141.0 seconds to extract 200 vehicle listings into a clean dataset.
To follow this tutorial, you will need: Python 3.11+ installed locally (apify-client 3.x requires it); the Apify API client for Python (pip install apify-client); an Apify account and API token.
Sign up for a free Apify account with email or GitHub ($5 monthly usage included). Copy your API token from API & Integrations in Apify Console.
In our Python script, we initialize the Apify client and define our parameters in run_input: { 'searchQueries': ['bmw'], 'category': 'cars', 'maxPrice': 5
- Record date: 2026-10-23T17:26:05.242Z