Legacy v1
Corgi VIN Decoder
Last updated:
Fast, offline VIN decoding for Node.js, browsers, and Cloudflare Workers. Community-extensible patterns.
Docs for the previous API generation. v1 endpoints keep working, but new work should target v2. See v2 VIN guide.
Corgi is Cardog's open-source VIN decoder. It is fast, runs offline, and accepts community-contributed patterns.
Quick Start
npm install @cardog/corgiCommunity Patterns
Corgi's base patterns cover US-market vehicles and miss many international manufacturers. Community patterns let anyone contribute VIN decoding rules for WMIs the base does not cover.
How It Works
- Create a YAML file defining the WMI and its patterns
- Add test VINs with expected decode results
- Submit a PR. CI validates the patterns
- On release, patterns merge into the published database
Example Pattern
wmi: XP7
manufacturer: Tesla
make: Tesla
country: Germany
vehicle_type: Passenger Car
years:
from: 2022
to: null
patterns:
- pattern: "Y*****"
element: Model
value: Model Y
- pattern: "*D****"
element: Drive Type
value: All-Wheel Drive
test_vins:
- vin: XP7YGCED3PB000001
expected:
make: Tesla
model: Model YCurrent Community Patterns
| WMI | Manufacturer | Region | Models |
|---|---|---|---|
| LRW | Tesla Shanghai | China | Model 3, Model Y |
| XP7 | Tesla Berlin | Germany | Model Y |
Contributing
Contributions are needed for:
- Chinese EVs: BYD, NIO, XPeng, Li Auto
- European variants: market-specific WMIs
- JDM vehicles: Japan-only models
See the contribution guide for full documentation.
Corgi vs Cardog API
| Feature | Corgi (OSS) | Cardog API |
|---|---|---|
| VIN Decoding | Basic specs | Full vehicle data |
| Offline | Yes | No |
| Market Values | No | Yes |
| Recalls | No | Yes |
| Listings | No | Yes |
| Price | Free | Usage-based |
Use Corgi for VIN validation and basic decoding. Use the Cardog API for full vehicle data.
Platform Support
- Node.js: native SQLite with better-sqlite3
- Browser: sql.js with gzipped database fetch
- Cloudflare Workers: D1 database adapter
- CLI:
npx @cardog/corgi decode <VIN>
Was this helpful?