nhtsa
v1.2.7
Published
Fetch and parse vehicle data from the NHTSA Vehicle API
Downloads
110
Maintainers
Readme
nhtsa
A NPM package for fetching and parsing vehicle data from the NHTSA Vehicle API
Basic usage
const nhtsa = require('nhtsa');
// Example using async/await
(async () => {
const { data } = await nhtsa.decodeVin('WUAAU34248N006164');
console.log(data);
})();
// Example using a promise
nhtsa.decodeVin('WUAAU34248N006164').then(
({ data }) => console.log(data),
error => console.log(error)
);
API Actions
Decode Vin
const { data } = await nhtsa.decodeVin('WUAAU34248N006164');
Decode VIN (flat format)
const { data } = await nhtsa.decodeVinFlatFormat('WUAAU34248N006164');
Decode VIN Extended
const { data } = await nhtsa.decodeVinExtended('WUAAU34248N006164');
Decode VIN Extended (flat format)
const { data } = await nhtsa.decodeVinExtendedFlatFormat('WUAAU34248N006164');
Decode WMI
const { data } = await nhtsa.decodeWmi('1FD');
Decode SAE WMI
const { data } = await nhtsa.decodeSaeWmi('1FD');
Get WMIs for Manufacturer
const { data } = await nhtsa.getWmisForManufacturer('hon');
Get SAE WMIs for Manufacturer
const { data } = await nhtsa.getSaeWmisForManufacturer('hon');
Get All Makes
const { data } = await nhtsa.getAllMakes();
Get Parts
const type = 565;
const fromDate = '3/2/2018';
const toDate = '3/10/2018';
const page = 2;
const { data } = await nhtsa.getParts(type, fromDate, toDate, page);
Get All Manufacturers
const { data } = await nhtsa.getAllManufacturers();
Get Manufacturer Details
const { data } = await nhtsa.getManufacturerDetails('volkswagen');
Get Makes for Manufacturer by Manufacturer Name
const { data } = await nhtsa.getMakesForManufacturer('volkswagen');
Try it out in your browser!