A Node.js web application that decodes BMW Vehicle Identification Numbers (VINs) using the NHTSA public API and BMW-specific VIN structure knowledge. Features SQLite caching for improved performance and a modern web interface.
- π BMW VIN Decoding: Decode 17-character BMW VINs to extract vehicle information
- ποΈ NHTSA API Integration: Uses the official NHTSA Vehicle Product Information Catalog (vPIC) API
- π§ BMW-Specific Decoding: Custom BMW VIN structure parsing for series, plant, model year, and more
- πΎ SQLite Caching: Automatic caching of results to reduce API calls and improve response times
- π Statistics Dashboard: Track usage statistics including cache hits and API calls
- π¨ Modern UI: Clean, responsive web interface with real-time feedback
- β‘ Fast Performance: Cached results load instantly
- Make, Model, Model Year
- Vehicle Type, Body Class
- Engine specifications (cylinders, horsepower, displacement)
- Transmission type, Drive type
- Fuel type
- Manufacturing plant information
- Series and trim information
- World Manufacturer Identifier (WMI) validation
- BMW series identification (1 Series, 3 Series, X5, etc.)
- Body style (Sedan, Coupe, SUV, etc.)
- Generation codes (F30, G20, etc.)
- Assembly plant location
- Model year decoding
- Serial number extraction
- Check digit validation
- BMW option codes (requires proprietary database access)
- Additional BMW-specific APIs
- Historical recall information
- Maintenance records (if available)
- Clone the repository
git clone <repository-url>
cd bmw-vin-decoder- Install dependencies
npm install- Start the application
npm startOr for development with auto-restart:
npm run dev- Open your browser
Navigate to
http://localhost:3000
- Enter a 17-character BMW VIN in the input field
- Click "Decode VIN" or press Enter
- View the decoded information including NHTSA data and BMW-specific details
- Results are automatically cached for faster future lookups
WBAWC73549PD05618(BMW 3 Series)5UXWX7C59BA123456(BMW X5 - Spartanburg)WBA3B54XF5S123456(BMW 3 Series - Germany)
Decode a VIN and return comprehensive vehicle information.
Request:
{
"vin": "WBAWC73549PD05618"
}Response:
{
"vin": "WBAWC73549PD05618",
"cached": false,
"data": {
"nhtsa": {
"make": "BMW",
"model": "3 Series",
"modelYear": "2009",
// ... more NHTSA data
},
"bmw_basic": {
"isBMW": true,
"wmi": {
"code": "WBA",
"manufacturer": "BMW AG",
"region": "Germany"
},
// ... more BMW data
},
"bmw_options": null
},
"timestamp": "2024-01-15T10:30:00.000Z"
}Get caching and usage statistics.
Search cached VINs by partial VIN or pattern.
bmw-vin-decoder/
βββ app.js # Main Express application
βββ package.json # Dependencies and scripts
βββ services/
β βββ database.js # SQLite operations
β βββ vinDecoder.js # Main VIN decoding logic
β βββ bmwDecoder.js # BMW-specific VIN parsing
βββ public/
β βββ index.html # Web interface
βββ vin_cache.db # SQLite database (auto-created)
βββ README.md
BMW VINs follow the standard 17-character format with specific patterns:
WBA: BMW AG (Germany)WBS: BMW M Division (Germany)4US/5UX: BMW Manufacturing Corp (Spartanburg, USA)WBY: BMW Motorrad (Motorcycles)
Contains model series, body style, and engine information (BMW proprietary codes)
- Position 9: Check digit
- Position 10: Model year
- Position 11: Assembly plant
- Positions 12-17: Serial number
This application uses the NHTSA Vehicle Product Information Catalog (vPIC) API:
- Base URL:
https://vpic.nhtsa.dot.gov/api/vehicles - Endpoint:
/DecodeVinValues/{vin}?format=json - Rate Limiting: Automatically controlled by NHTSA
- Documentation: NHTSA vPIC API
CREATE TABLE vin_cache (
id INTEGER PRIMARY KEY AUTOINCREMENT,
vin TEXT UNIQUE NOT NULL,
nhtsa_data TEXT, -- JSON string
bmw_basic_data TEXT, -- JSON string
bmw_options_data TEXT, -- JSON string (future use)
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);CREATE TABLE cache_stats (
id INTEGER PRIMARY KEY AUTOINCREMENT,
total_requests INTEGER DEFAULT 0,
cache_hits INTEGER DEFAULT 0,
api_calls INTEGER DEFAULT 0,
last_updated DATETIME DEFAULT CURRENT_TIMESTAMP
);BMW option codes provide detailed information about factory-installed equipment and packages. Currently, this feature is not implemented due to the proprietary nature of BMW's option code databases. Potential sources for future implementation:
- BMW ETK (Electronic Parts Catalog) - Dealer access required
- BMW TIS (Technical Information System) - Dealer access required
- Third-party services - Paid APIs like BimmerCode or similar
- BMW ConnectedDrive API - Requires BMW developer partnership
- Fork the repository
- Create a feature branch (
git checkout -b feature/option-codes) - Commit your changes (
git commit -am 'Add option codes support') - Push to the branch (
git push origin feature/option-codes) - Create a Pull Request
PORT: Server port (default: 3000)NODE_ENV: Environment (development/production)
The application includes comprehensive error handling:
- VIN format validation
- BMW VIN verification
- API timeout handling
- Database error recovery
- User-friendly error messages
- SQLite caching reduces API calls
- Efficient database indexing on VIN column
- Concurrent API requests using Promise.allSettled
- Request timeouts to prevent hanging
- Optimized client-side rendering
MIT License - see LICENSE file for details
For issues, questions, or contributions:
- Check existing issues
- Create a new issue with detailed description
- Provide example VINs for testing (if applicable)
Note: This application is for educational and informational purposes. Always verify critical vehicle information through official BMW dealers or certified sources.