Skip to content

About

Transparent Canadian used-vehicle deal checker with VIN decode, matched comparables, and visible mileage modeling.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

85 Commits

Folders and files

Repository files navigation

AutoValue Canada

A transparent Canadian used-vehicle deal checker. It compares a seller's asking price with current Canadian dealer inventory, then adjusts the market estimate for mileage and user-reported condition.

Live demo · Calculation · CI

How it works

  1. Select a province, make, model and year, then enter the asking price and odometer.
  2. Optionally decode a VIN and pick a condition tier (below average, rough, average or better).
  3. Review the estimated value, range, difference from the asking price, evidence strength and unpriced factors.

The estimate combines:

  • a province × make × model × year median from Canadian dealer asking prices; and
  • a browser-based gradient-boosted model that applies relative mileage and condition adjustments.

VIN decoding uses the official NHTSA vPIC API. A VIN is sent only after the user clicks Decode VIN, is kept out of the URL and is not stored. The app has no licensed live listing feed. Asking price and odometer can optionally be prefilled from a pasted listing link and remain user-entered and editable; condition is selected by the user.

Data and limitations

The included market artifact contains 5,605 used-vehicle cells representing 180,833 vehicles from OmniaAuto's Canadian Vehicle Market Aggregates. These are dealer asking prices, not completed sales. Cells with fewer than 10 vehicles are excluded.

The adjustment model was trained on 91,278 historical US wholesale auction sales. On a later-year test set of 39,132 sales, it reached $1,198 MAE and 11.60% WAPE. The model runs locally in the browser; no prediction service or API key is required.

Results are market estimates, not certified appraisals, guaranteed offers or future-value forecasts. Trim, options, inspection findings, fees and the final negotiated price may not be captured. See the model card and data sources for methodology, provenance and full limitations.

Frontend

The centred valuation workspace pairs a tabbed listing editor with price scrubbing, model-based mileage exploration, provincial comparisons and pinned scenarios. It fits standard laptop screens at 100% zoom. An AutoTrader.ca, Kijiji.ca, Carpages.ca or Clutch.ca listing link can fill make, model, year, odometer and asking price where the listing site allows a fetch; imported values stay editable and anything it misses is entered by hand. Checks can be saved in the browser, restored later, or copied as a link that reopens the same inputs. Research pages include a provincial coverage explorer, a readable methodology and an interactive calculation breakdown. The palette uses J.D. Power blue. See the frontend review for design research, controls and browser verification.

Run locally

Requires Node.js 20.9 or later.

npm ci
npm run dev

Open http://localhost:3000. No credentials or environment variables are required.

Postgres warehouse (PostgreSQL 16, RDS-compatible)

The same CSVs also load into Postgres for SQL analytics. Local Docker matches AWS RDS (PostgreSQL 16), so queries run unchanged in both places.

cp .env.example .env  # edit DATABASE_URL for RDS when needed
docker compose up -d db
python -m pip install -r requirements.txt
python analysis/etl_to_postgres.py
python analysis/run_sql.py  # writes public/data/sql_summary.json

S3 raw zone (optional, same boto3 path): upload the two CSVs, then set S3_PRICE_STATS_URI / S3_INVENTORY_URI instead of using data/raw/. See analysis/market_insights.sql for the six warehouse queries (province-year medians, dispersion, depreciation proxy, DOM buckets, national KPI, thin-cell flags).

Verify

npm run build:data
npm test
npm run lint
npm run build
npm run test:e2e

Model training is optional and requires Python dependencies:

python -m pip install -r requirements.txt
npm run model:benchmark
npm run model:train-condition

The data build rejects schema changes, duplicate market cells, invalid values, samples below 10 and unordered price percentiles.

Project structure

app/          Pages and VIN decode route
components/   Valuation interface
lib/          Market, VIN and model logic
analysis/     Model training, Postgres ETL (etl_to_postgres.py),
              warehouse SQL (market_insights.sql) and runner (run_sql.py)
data/raw/     Attributed source snapshots
public/data/  Validated release artifacts (incl. sql_summary.json)
scripts/      Data preparation
docs/         Architecture, methodology and data notes

Deployment

Import the repository into Vercel with the default Next.js settings. The production build regenerates and validates the market artifact before compiling the app.

Licence

Application code is MIT licensed. The included market data retains its CC BY-NC 4.0 licence and is not licensed for commercial use.

About

Transparent Canadian used-vehicle deal checker with VIN decode, matched comparables, and visible mileage modeling.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages