Skip to content
On this page

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

Module: api/endpoints/GetModelsForMakeYear

Table of contents

Type Aliases

Functions

Type Aliases

GetModelsForMakeYearResults

Ƭ GetModelsForMakeYearResults: Object

Objects found in the Results array of GetModelsForMakeYear endpoint response.

Type declaration

NameType
Make_IDnumber
Make_Namestring
Model_IDnumber
Model_Namestring

Defined in

api/endpoints/GetModelsForMakeYear.ts:133

Functions

GetModelsForMakeYear

GetModelsForMakeYear(params, doFetch?): Promise<NhtsaResponse<GetModelsForMakeYearResults>>

💡 More Information

See: GetModelsForMakeYear Documentation

GetModelsForMakeYear returns the Models in the vPIC dataset for a specified Model Year and Make whose name is LIKE the Make in the vPIC Dataset.

params.make is required. It can be a partial, or a full name for more specificity, e.g., "Harley", "Harley Davidson", etc.

A minimum of one of the following are also required (or a combination of both):

  • params.modelYear year you want to search for (years >= 1995 are supported according to NHTSA docs)
  • params.vehicleType can be a partial name, or a full name for more specificity, e.g., "Vehicle", "Moto", "Low Speed Vehicle", etc.

NOTE: This endpoint requires special handling of the params object, such that none of the params are used in the query string and are instead used as part of the URL path for the endpoint. To account for this, we pass the params object to the createUrl function as the path, after encoding the params object key:values into a url path string.

Parameters

NameTypeDescription
paramsObjectObject of Query Search names and values to append to the URL as a query string
doFetch?trueWhether to fetch the data or just return the URL (default: true)

Returns

Promise<NhtsaResponse<GetModelsForMakeYearResults>>

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

Defined in

api/endpoints/GetModelsForMakeYear.ts:47

GetModelsForMakeYear(params, doFetch): Promise<string>

Parameters

NameType
paramsObject
doFetchfalse

Returns

Promise<string>

Defined in

api/endpoints/GetModelsForMakeYear.ts:57

Released under the MIT License.