@shaggytools/nhtsa-api-wrapper / Exports / api/endpoints/GetCanadianVehicleSpecifications
Module: api/endpoints/GetCanadianVehicleSpecifications
Table of contents
Functions
Type Aliases
Functions
GetCanadianVehicleSpecifications
▸ GetCanadianVehicleSpecifications(params
, doFetch?
): Promise
<NhtsaResponse
<GetCanadianVehicleSpecificationsResults
>>
💡 More Information
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
Name | Type | Description |
---|---|---|
params | Object | Object of Query Search names and values to append to the URL as a query string |
params.make? | string | Vehicle's make, like "Honda", "Toyota", etc... |
params.model? | string | Vehicle'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.year | string | number | Model year of the vehicle - year >= 1971 |
doFetch? | true | Whether to fetch the data or just return the URL (default: true ) |
Returns
Promise
<NhtsaResponse
<GetCanadianVehicleSpecificationsResults
>>
- Api Response
object
-or- urlstring
ifdoFetch = false
Defined in
api/endpoints/GetCanadianVehicleSpecifications.ts:45
▸ GetCanadianVehicleSpecifications(params
, doFetch
): Promise
<string
>
Parameters
Name | Type |
---|---|
params | Object |
params.make? | string |
params.model? | string |
params.units? | string |
params.year | string | number |
doFetch | false |
Returns
Promise
<string
>
Defined in
api/endpoints/GetCanadianVehicleSpecifications.ts:55
Type Aliases
GetCanadianVehicleSpecificationsResults
Ƭ GetCanadianVehicleSpecificationsResults: Object
Objects found in the Results
array of GetCanadianVehicleSpecifications
endpoint response.
Type declaration
Name | Type |
---|---|
Specs | { Name : "Make" | "Model" | "MYR" | "OL" | "OW" | "OH" | "WB" | "CW" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "TWF" | "TWR" | "WD" ; Value : string }[] |