Skip to content

Python scraper for AutoScout24 car marketplace powered by ScrapingAnt API

Notifications You must be signed in to change notification settings

kami4ka/AutoScout24Scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoScout24 Scraper

A Python scraper for AutoScout24, Europe's largest online car marketplace, powered by ScrapingAnt API.

Features

  • Scrape car listings from multiple European countries
  • Filter by make, fuel type, price range, year, and mileage
  • URL-based pagination support
  • Export to CSV and JSON formats
  • Automatic deduplication of listings
  • Configurable request delays

Requirements

Note: The ScrapingAnt free plan has a concurrency limit of 1 thread. For higher throughput, consider upgrading to a paid plan.

Installation

  1. Clone the repository:
git clone https://github.com/scrapingant/AutoScout24Scraper.git
cd AutoScout24Scraper
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set your ScrapingAnt API key:
export SCRAPINGANT_API_KEY="your_api_key_here"

Usage

Basic Usage

Scrape cars from Germany (default):

python main.py

Scrape Multiple Countries

python main.py -c germany austria netherlands

Filter by Make

python main.py --make bmw
python main.py --make mercedes

Filter by Price Range

python main.py --price-from 5000 --price-to 20000

Filter by Fuel Type

python main.py --fuel diesel
python main.py --fuel electric

Combined Filters

python main.py -c germany --make audi --fuel diesel --price-to 30000 --year-from 2018

Control Pagination

python main.py -p 5  # Scrape 5 pages

List Available Options

python main.py --list-countries    # List available countries
python main.py --list-makes        # List available makes

Export Options

python main.py -o results.csv      # Custom CSV filename
python main.py --json              # Also export to JSON

All Options

usage: main.py [-h] [-c COUNTRIES [COUNTRIES ...]] [-p PAGES] [-d DELAY]
               [-o OUTPUT] [--json] [--make MAKE] [--fuel FUEL]
               [--price-from PRICE_FROM] [--price-to PRICE_TO]
               [--year-from YEAR_FROM] [--year-to YEAR_TO]
               [--mileage-to MILEAGE_TO] [--list-countries] [--list-makes]
               [--api-key API_KEY]

Options:
  -c, --countries     Countries to scrape (default: germany)
  -p, --pages         Max pages per country (default: 2)
  -d, --delay         Delay between requests in seconds (default: 1.0)
  -o, --output        Output CSV filename
  --json              Also export to JSON format
  --make              Filter by car make
  --fuel              Filter by fuel type
  --price-from        Minimum price filter
  --price-to          Maximum price filter
  --year-from         Minimum year filter
  --year-to           Maximum year filter
  --mileage-to        Maximum mileage filter (km)
  --list-countries    List all available countries
  --list-makes        List all available makes
  --api-key           ScrapingAnt API key (or use SCRAPINGANT_API_KEY env var)

Available Countries

Country Code
germany D
austria A
belgium B
spain E
france F
italy I
luxembourg L
netherlands NL

Available Makes

Make API Value
audi audi
bmw bmw
mercedes mercedes-benz
volkswagen volkswagen
opel opel
ford ford
toyota toyota
honda honda
porsche porsche
ferrari ferrari
lamborghini lamborghini
tesla tesla

Output Format

CSV Fields

Field Description
title Full listing title
price Price in EUR
make Car manufacturer
model Car model
first_registration First registration date (MM/YYYY)
mileage Mileage in km
fuel_type Fuel type (Gasoline, Diesel, etc.)
power Engine power (kW and hp)
seller_name Seller/dealer name
seller_location Seller location (DE-XXXXX City)
listing_url Full URL to listing
country Country scraped
vehicle_type Vehicle condition (New, Used)
image_url Listing image URL
scraped_at Scraping timestamp

Project Structure

AutoScout24Scraper/
├── config.py          # Configuration settings
├── models.py          # Data models
├── scraper.py         # Main scraper logic
├── utils.py           # Utility functions
├── main.py            # CLI entry point
├── requirements.txt   # Dependencies
├── output/            # Output directory
│   └── .gitkeep
└── README.md

License

MIT License

About

Python scraper for AutoScout24 car marketplace powered by ScrapingAnt API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages