Skip to content
On this page

@shaggytools/nhtsa-api-wrapper - v3.0.4 / Exports / api/endpoints/GetMakesForManufacturerAndYear

Module: api/endpoints/GetMakesForManufacturerAndYear

Table of contents

Type Aliases

Functions

Type Aliases

GetMakesForManufacturerAndYearResults

Ƭ GetMakesForManufacturerAndYearResults: Object

Objects found in the Results array of GetMakesForManufacturerAndYear endpoint response.

Type declaration

NameType
MakeIdnumber
MakeNamestring
MfrIdnumber
MfrNamestring

Defined in

api/endpoints/GetMakesForManufacturerAndYear.ts:105

Functions

GetMakesForManufacturerAndYear

GetMakesForManufacturerAndYear(manufacturer, params, doFetch?): Promise<NhtsaResponse<GetMakesForManufacturerAndYearResults>>

GetMakesForManufacturerAndYear returns all the Makes in the vPIC dataset for a specified manufacturer, and whose "Year From" and "Year To" range cover the specified year. Multiple results are returned in case of multiple matches.

Both manufacturer and params.year are required.

manufacturer name can be a partial name, or a full name for more specificity, e.g. "988", "honda", "HONDA OF CANADA MFG., INC.", etc.

  • If supplied manufacturer is a number - method will do exact match on Manufacturer's Id.
  • If supplied manufacturer is a string - it will look for manufacturers whose name is LIKE the provided name. It accepts a partial manufacturer name as an input.

params.year must be a number > 2016, years prior to 2016 are not supported according to the NHTSA API. During testing it was found that the API still returns data for years prior to 2016.

❗ Required Parameters

Both manufacturer and params.year are required.

Parameters

NameTypeDescription
manufacturerstring | numberManufacturer Name (string) or Manufacturer ID (number)
paramsObjectObject of Query Search names and values to append to the URL as a query string
params.yearstring | numberModel year of the vehicle - Number, >= 2016
doFetch?trueWhether to fetch the data or just return the URL (default: true)

Returns

Promise<NhtsaResponse<GetMakesForManufacturerAndYearResults>>

  • Api Response object -or- url string if doFetch = false

Defined in

api/endpoints/GetMakesForManufacturerAndYear.ts:43

GetMakesForManufacturerAndYear(manufacturer, params, doFetch): Promise<string>

Parameters

NameType
manufacturerstring | number
paramsObject
params.yearstring | number
doFetchfalse

Returns

Promise<string>

Defined in

api/endpoints/GetMakesForManufacturerAndYear.ts:49

Released under the MIT License.