Skip to content
On this page

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

Module: api/endpoints/GetCanadianVehicleSpecifications

Table of contents

Type Aliases

Functions

Type Aliases

GetCanadianVehicleSpecificationsResults

Ƭ GetCanadianVehicleSpecificationsResults: Object

Objects found in the Results array of GetCanadianVehicleSpecifications endpoint response.

Type declaration

NameType
Specs{ Name: "Make" | "Model" | "MYR" | "OL" | "OW" | "OH" | "WB" | "CW" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "TWF" | "TWR" | "WD" ; Value: string }[]

Defined in

api/endpoints/GetCanadianVehicleSpecifications.ts:120

Functions

GetCanadianVehicleSpecifications

GetCanadianVehicleSpecifications(params, doFetch?): Promise<NhtsaResponse<GetCanadianVehicleSpecificationsResults>>

GetCanadianVehicleSpecifications returns data from the Canadian Vehicle Specifications (CVS). The CVS consists of a database of original vehicle dimensions, used primarily in collision investigation and reconstruction, combined with a search engine.

The CVS database is compiled annually by the Collision Investigation and Research Division of Transport Canada. Visit official Canadian Vehicle Specifications page for more details.

params.year is the only required query parameter, all others are optional but will still be included in the query string as blank values even if not provided by the user. See below Note for more details.

NOTE: This endpoint does not like missing query keys and will return a 404 error if any of them are omitted from the query string. Therefore, we must set default values to empty strings for any query keys that are not provided by the user. This means keys not provided by user will always show up as "something=" in the query string. year is the only key user must provide, no default value is set for it so that an error will be thrown if not provided by user.

Parameters

NameTypeDescription
paramsObjectObject of Query Search names and values to append to the URL as a query string
params.make?stringVehicle's make, like "Honda", "Toyota", etc...
params.model?stringVehicle's model, like "Pilot", "Focus". Can also include some other elements like Body Type, Engine Model/size, etc...
params.units?string"Metric" (default), or "US" for standard units
params.yearstring | numberModel year of the vehicle - year >= 1971
doFetch?trueWhether to fetch the data or just return the URL (default: true)

Returns

Promise<NhtsaResponse<GetCanadianVehicleSpecificationsResults>>

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

Defined in

api/endpoints/GetCanadianVehicleSpecifications.ts:45

GetCanadianVehicleSpecifications(params, doFetch): Promise<string>

Parameters

NameType
paramsObject
params.make?string
params.model?string
params.units?string
params.yearstring | number
doFetchfalse

Returns

Promise<string>

Defined in

api/endpoints/GetCanadianVehicleSpecifications.ts:55

Released under the MIT License.