GithubHelp home page GithubHelp logo

redhatter / nhtsa Goto Github PK

View Code? Open in Web Editor NEW

This project forked from imears/nhtsa

0.0 2.0 0.0 181 KB

A NPM package for fetching and parsing vehicle data from the NHTSA Vehicle API

License: MIT License

JavaScript 100.00%

nhtsa's Introduction

nhtsa CircleCI

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!

nhtsa's People

Contributors

imears avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.