Miss any of our Open RFC calls?Watch the recordings here! »

nhtsa

1.2.7 • Public • Published

nhtsa CircleCInpm

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

More info
The Decode VIN API will decode the VIN and the decoded output will be made available in the format of Key-value pairs. The IDs (VariableID and ValueID) represent the unique ID associated with the Variable/Value. In case of text variables, the ValueID is not applicable. Model Year in the request allows for the decoding to specifically be done in the current, or older (pre-1980), model year ranges. It is recommended to always send in the model year. This API also supports partial VIN decoding (VINs that are less than 17 characters). In this case, the VIN will be decoded partially with the available characters. In case of partial VINs, a `*` could be used to indicate the unavailable characters. The 9th digit is not necessary.
const { data } = await nhtsa.decodeVin('WUAAU34248N006164');

Decode VIN (flat format)

More info
The Decode VIN Flat Format API will decode the VIN and the decoded output will be made available in a flat file format. Model Year in the request allows for the decoding to specifically be done in the current, or older (pre-1980), model year ranges. It is recommended to always send in the model year. This API also supports partial VIN decoding (VINs that are less than 17 characters). In this case, the VIN will be decoded partially with the available characters. In case of partial VINs, a `*` could be used to indicate the unavailable characters.
const { data } = await nhtsa.decodeVinFlatFormat('WUAAU34248N006164');

Decode VIN Extended

More info
This is exactly like the Decode VIN method but provides additional information on variables related to other nhtsa programs like NCSA, Artemis etc.
const { data } = await nhtsa.decodeVinExtended('WUAAU34248N006164');

Decode VIN Extended (flat format)

More info
This is exactly like the Decode VIN (flat format) method but provides additional information on variables related to other nhtsa programs like NCSA, Artemis etc.
const { data } = await nhtsa.decodeVinExtendedFlatFormat('WUAAU34248N006164');

Decode WMI

More info
This provides information on the World Manufacturer Identifier for a specific WMI code. WMIs may be put in as either 3 characters representing VIN position 1-3 or 6 characters representing VIN positions 1-3 & 12-14. Example "JTD", "1T9131".
const { data } = await nhtsa.decodeWmi('1FD');

Decode SAE WMI

More info
This provides information on the World Manufacturer Identifier for a specific WMI code. WMIs may be put in as either 3 characters representing VIN position 1-3 or 6 characters representing VIN positions 1-3 & 12-14. Example "JTD", "1T9131".
const { data } = await nhtsa.decodeSaeWmi('1FD');

Get WMIs for Manufacturer

More info
Provides information on the all World Manufacturer Identifier (WMI) for a specified Manufacturer. Only WMI registered in vPICList are displayed. For a list of all WMIs for a specified Manufacturer see GetSAEWMIsForManufacturer.
const { data } = await nhtsa.getWmisForManufacturer('hon');

Get SAE WMIs for Manufacturer

More info
Provides information on the all World Manufacturer Identifier (WMI) for a specified Manufacturer. All WMI registered with SAE are displayed. For a list of WMIs registered with vPICList see GetWMIsForManufacturer.
const { data } = await nhtsa.getSaeWmisForManufacturer('hon');

Get All Makes

More info
This provides a list of all the Makes available in vPIC Dataset.
const { data } = await nhtsa.getAllMakes();

Get Parts

More info
This provides a list of ORGs with letter date in the given range of the dates and with specified Type of ORG. Up to 1000 results will be returned at a time.
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

More info
This provides a list of all the Manufacturers available in vPIC Dataset. Results are provided in pages of 100 items, use parameter"page" to specify 1-st (default, 2nd, 3rd, ...Nth ... page.)
const { data } = await nhtsa.getAllManufacturers();

Get Manufacturer Details

More info
This provides the details for a specific manufacturer that is requested. This gives the results of all the manufacturers whose name is LIKE the manufacturer name. It accepts a partial manufacturer name as an input. Multiple results are returned in case of multiple matches.
const { data } = await nhtsa.getManufacturerDetails('volkswagen');

Get Makes for Manufacturer by Manufacturer Name

More info
This returns all the Makes in the vPIC dataset for a specified manufacturer whose name is LIKE the manufacturer name in vPIC Dataset. Manufacturer name can be a partial name, or a full name for more specificity (e.g., "HONDA", "HONDA OF CANADA MFG., INC.", etc.)
const { data } = await nhtsa.getMakesForManufacturer('volkswagen');

Try it out in your browser!

Install

npm i nhtsa

DownloadsWeekly Downloads

28

Version

1.2.7

License

MIT

Unpacked Size

894 kB

Total Files

43

Last publish

Collaborators

  • avatar