Skip to content

About

๐Ÿš— Automated car auction data scraper and analytics platform for New Zealand's Manheim auctions. Features daily data collection, trend analysis, and interactive dashboards.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

ย 

History

267 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš— FindCars NZ

Python 3.13+ License: MIT

FindCars NZ (this repo: CarAuction-Analytics-NZ) is a data platform tracking damaged-vehicle auction listings from Manheim New Zealand. Three years of daily scraping (1,131 days and 660,000+ raw records) served as an interactive dashboard, open datasets, and a free static JSON API.

๐Ÿ”— Live site: findcars.prasanthsasikumar.com ๐Ÿ“– The story: a three-part blog series: the data ยท the analytics ยท the prediction model ๐Ÿ”ฎ Price predictor: nz-car-auction.streamlit.app

โœจ Features

  • ๐Ÿ“Š Interactive Analytics Dashboard - Visualize price trends, manufacturer statistics, and damage patterns
  • ๐Ÿ“ˆ Real-Time Listings - View latest vehicle auction data with interactive filtering
  • ๐Ÿ”Œ RESTful API - Programmatic access to all data with multiple endpoints
  • ๐Ÿงน Data Cleaning Pipeline - Automated processing of raw scraper data
  • ๐Ÿ“ฅ Multiple Export Formats - CSV, Parquet, and SQLite database exports
  • ๐Ÿค– Daily Automated Scraping - Fresh data collected every day

๐Ÿ“Š Dataset Overview

Metric Value
Time Period May 27, 2023 - present (updated daily)
Total Days 1,131+ days
Missing Days 8 (99%+ coverage)
Total Records 660,000+ raw / 460,000+ cleaned
Manufacturers 500+
Data Fields 20+ attributes per vehicle

Missing Dates

  • 2023-05-30
  • 2023-07-19
  • 2024-02-28 through 2024-03-04 (6 consecutive days)

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.13 or higher
  • pip package manager
  • Virtual environment (recommended)

Installation

  1. Clone the repository
git clone https://github.com/prasanthsasikumar/CarAuction-Analytics-NZ.git
cd CarAuction-Analytics-NZ
  1. Create and activate virtual environment
# Windows
python -m venv .venv
.venv\Scripts\activate

# Linux/Mac
python3 -m venv .venv
source .venv/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Run the application
# Development server
python app_main.py

# Production server with Gunicorn (Linux/Mac)
gunicorn -c gunicorn_config.py app_main:app
  1. Access the application
http://localhost:8000

๐Ÿ“ Project Structure

CarAuction-Analytics-NZ/
โ”œโ”€โ”€ app_main.py                 # Main Flask application
โ”œโ”€โ”€ clean_data.py               # Data cleaning pipeline
โ”œโ”€โ”€ main.py                     # Web scraper (daily job)
โ”œโ”€โ”€ requirements.txt            # Python dependencies
โ”œโ”€โ”€ gunicorn_config.py          # Production server config
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ raw/                    # Daily CSV files (1,131+)
โ”‚   โ”œโ”€โ”€ processed/              # Cleaned datasets
โ”‚   โ”‚   โ”œโ”€โ”€ car_auction_public.csv
โ”‚   โ”‚   โ”œโ”€โ”€ car_auction_public.parquet
โ”‚   โ”‚   โ””โ”€โ”€ car_auction_data.db
โ”‚   โ””โ”€โ”€ *.csv                   # Additional data files
โ”œโ”€โ”€ templates/                  # HTML templates
โ”‚   โ”œโ”€โ”€ index_main.html         # Landing page
โ”‚   โ”œโ”€โ”€ today.html              # Listings view
โ”‚   โ”œโ”€โ”€ analytics.html          # Analytics dashboard
โ”‚   โ”œโ”€โ”€ api_docs.html           # API documentation
โ”‚   โ””โ”€โ”€ about.html              # About page
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ scrapers/               # Scraper modules
โ”‚   โ””โ”€โ”€ utils/                  # Utility functions
โ””โ”€โ”€ docs/                       # Documentation

๐Ÿ”Œ API Documentation

Base URL

https://findcars.prasanthsasikumar.com/api/v1

Endpoints

Get Overview Statistics

GET /api/v1/stats/overview

Returns aggregated statistics from the most recent 30 days.

Response:

{
  "total_listings": 45000,
  "unique_vehicles": 12000,
  "manufacturers": 500,
  "avg_price": 2500.50,
  "median_price": 1800.00,
  "top_manufacturers": {
    "Toyota": 8500,
    "Mazda": 6200
  }
}

Get Price Trends

GET /api/v1/stats/price-trends

Returns weekly price trends (all days in each week) with average daily listing counts.

Search Vehicles

GET /api/v1/search?manufacturer=Toyota&max_price=5000

Parameters:

  • manufacturer - Filter by manufacturer
  • model - Filter by model
  • max_price - Maximum price
  • min_price - Minimum price

Download Data

GET /api/v1/download/latest      # Latest raw CSV
GET /api/v1/download/processed   # Cleaned dataset

For complete API documentation, visit: /api-docs

๐Ÿงน Data Cleaning

The project includes a comprehensive data cleaning pipeline that:

  1. Loads all 1,131+ daily CSV files
  2. Removes duplicates based on vehicle attributes
  3. Cleans price and mileage data
  4. Standardizes manufacturer and model names
  5. Adds derived features (vehicle age, price changes)
  6. Exports to multiple formats

Run the cleaning pipeline:

python clean_data.py

Output files:

  • data/processed/car_auction_public.csv - Cleaned CSV (460K records)
  • data/processed/car_auction_public.parquet - Parquet format
  • data/processed/car_auction_data.db - SQLite database
  • data/processed/DATA_SUMMARY.txt - Summary statistics

๐Ÿ•ท๏ธ Web Scraper

The scraper runs daily to collect fresh auction data.

Manual scraping:

python main.py

Schedule with cron (Linux/Mac):

# Add to crontab -e
0 2 * * * cd /path/to/CarAuction-Analytics-NZ && /path/to/.venv/bin/python main.py

๐Ÿ“Š Use Cases

  • Market Research - Analyze pricing trends and market dynamics
  • Price Prediction - Train ML models for vehicle valuation
  • Academic Research - Study depreciation patterns and damage types
  • Business Intelligence - Inform inventory decisions for dealerships
  • Personal Use - Track specific vehicles and get price alerts

๐Ÿ› ๏ธ Technology Stack

Backend:

  • Python 3.13
  • Flask (Web framework)
  • Pandas (Data processing)
  • BeautifulSoup4 (Web scraping)
  • Gunicorn (Production server)

Frontend:

  • Bootstrap 5
  • Chart.js (Visualizations)
  • DataTables (Interactive tables)
  • Font Awesome (Icons)

Data Storage:

  • SQLite
  • Parquet (PyArrow)
  • CSV

๐Ÿš€ Deployment

Production Setup

  1. Configure Gunicorn
# gunicorn_config.py
bind = '0.0.0.0:8000'
workers = 4
module = 'app_main:app'
  1. Start Gunicorn
gunicorn -c gunicorn_config.py app_main:app
  1. Setup Nginx (optional)
server {
    listen 80;
    server_name your-domain.com;

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

โš ๏ธ Disclaimer

This data is for informational and research purposes only. Prices and availability should be verified directly with Manheim NZ. This project follows ethical web scraping practices and respects robots.txt.

๐Ÿ”ฎ Future Plans

  • Implement XGBoost price prediction model, live at nz-car-auction.streamlit.app
  • Add email price alerts for tracked vehicles
  • Expand to other auction platforms
  • Build recommendation engine
  • Mobile app for iOS/Android
  • Export to Excel/Google Sheets

๐Ÿ“ง Contact

Prasanth Sasikumar - prasanthsasikumar.com

Project Link: https://github.com/prasanthsasikumar/CarAuction-Analytics-NZ


โญ If you find this project useful, please consider giving it a star!

About

๐Ÿš— Automated car auction data scraper and analytics platform for New Zealand's Manheim auctions. Features daily data collection, trend analysis, and interactive dashboards.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Contributors

Languages