Official Node.js SDK for the VIN Decoder Vehicle API.
- TypeScript with full type definitions
- Zero runtime dependencies
- Native
fetch(Node.js 18+) - ESM-first
- All API endpoints supported
npm install @vindecodervehicle/sdkimport { VinDecoderClient, getVehicleFullName } from '@vindecodervehicle/sdk';
const client = VinDecoderClient.create('YOUR_USER', 'YOUR_API_KEY');
const vehicle = await client.decodeVin('WF0GXXGAJ69C71882');
console.log(getVehicleFullName(vehicle)); // BMW 3 Coupe (E92) 316 i
console.log(vehicle.make); // BMW
console.log(vehicle.carId); // 55565const vehicle = await client.decodeVin('WF0GXXGAJ69C71882');
const vehicles = await client.decodeVinAll('WF0GXXGAJ69C71882');
const engines = await client.getEngines('WF0GXXGAJ69C71882');const vehicle = await client.getVehicle(55565);
const fluids = await client.getFluidCapacities(55565);
const parts = await client.getOemParts(55565);
const repairs = await client.getRepairTimes(55565);const brands = await client.listBrands();
const models = await client.listModels('bmw');
const variants = await client.listVariants('bmw', '3-series');import {
ApiError,
AuthenticationError,
InvalidArgumentError,
} from '@vindecodervehicle/sdk';
try {
await client.decodeVin('INVALID');
} catch (error) {
if (error instanceof InvalidArgumentError) { /* invalid VIN */ }
if (error instanceof AuthenticationError) { /* bad credentials */ }
if (error instanceof ApiError) {
console.log(error.statusCode, error.responseBody);
}
}MIT