@shaggytools/nhtsa-api-wrapper
Version:
Universal javascript wrapper for the NHTSA.dot.gov VPIC 'vehicles' API, useful for VIN decoding, etc.
55 lines • 2.58 kB
TypeScript
/**
* @module api/endpoints/GetMakesForManufacturerAndYear
* @category API Endpoints
*/
import type { NhtsaResponse } from '../../types';
/**
* ::: tip :bulb: More Information
* See: [GetMakesForManufacturerAndYear Documentation](/api/endpoints/get-makes-for-manufacturer-and-year)
* :::
*
* `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.
*
* ::: warning :exclamation: Required Parameters
* Both `manufacturer` and `params.year` are required.
* :::
*
* @param {(string|number)} manufacturer - Manufacturer Name (string) or Manufacturer ID (number)
* @param params - Object of Query Search names and values to append to the URL as a query string
* @param {(string|number)} params.year - Model year of the vehicle - Number, >= 2016
* @param {boolean} [doFetch=true] - Whether to fetch the data or just return the URL
* (default: `true`)
* @returns {(Promise<NhtsaResponse<GetMakesForManufacturerAndYearResults> | string>)} - Api
* Response `object` -or- url `string` if `doFetch = false`
*/
declare function GetMakesForManufacturerAndYear(manufacturer: string | number, params: {
year: string | number;
}, doFetch?: true): Promise<NhtsaResponse<GetMakesForManufacturerAndYearResults>>;
declare function GetMakesForManufacturerAndYear(manufacturer: string | number, params: {
year: string | number;
}, doFetch: false): Promise<string>;
export { GetMakesForManufacturerAndYear };
/**
* Objects found in the `Results` array of `GetMakesForManufacturerAndYear` endpoint response.
*/
export type GetMakesForManufacturerAndYearResults = {
MakeId: number;
MakeName: string;
MfrId: number;
MfrName: string;
};
//# sourceMappingURL=GetMakesForManufacturerAndYear.d.ts.map