@shaggytools/nhtsa-api-wrapper
Version:
Universal javascript wrapper for the NHTSA.dot.gov VPIC 'vehicles' API, useful for VIN decoding, etc.
49 lines • 1.94 kB
TypeScript
/**
* @module api/endpoints/GetModelsForMakeId
* @category API Endpoints
*/
import type { NhtsaResponse } from '../../types';
/**
* ::: tip :bulb: More Information
* See: [GetModelsForMakeId Documentation](/api/endpoints/get-models-for-make-id)
* :::
*
* `GetModelsForMakeId` returns the Models in the vPIC dataset for a specified Make whose ID is
* equal to the `makeID` in the vPIC Dataset.
*
* You can get `makeID`s via `MAKE_ID` key in Results objects of the following endpoints:
* - `GetAllMakes` endpoint
* - `GetMakeForManufacturer` endpoint
* - `GetModelsForMake` endpoint
* - `GetModelsForMakeYear` endpoint
*
* You can get `makeID`s via `MakeID` key in Results objects of the following endpoints:
* - `DecodeVinValues`
* - `DecodeVinValuesBatch`
*
* You can get `makeID`s via `ValueId` key in Results objects of the following endpoints.
* One of the objects in the `Results` array will contain both `Variable: "Make"` and
* `VariableId: 26`. The `ValueId` key in that same object is the `makeID` for use in this
* endpoint.
* - `DecodeVin`
* - `DecodeVinExtended`
*
* @param {(string|number)} makeId - Make ID to search
* @param {boolean} [doFetch=true] - Whether to fetch the data or just return the URL
* (default: `true`)
* @returns {(Promise<NhtsaResponse<GetModelsForMakeIdResults> | string>)} - Api Response `object`
* -or- url `string` if `doFetch = false`
*/
declare function GetModelsForMakeId(makeId: string | number, doFetch?: true): Promise<NhtsaResponse<GetModelsForMakeIdResults>>;
declare function GetModelsForMakeId(makeId: string | number, doFetch: false): Promise<string>;
export { GetModelsForMakeId };
/**
* Objects found in the `Results` array of `GetModelsForMakeId` endpoint response.
*/
export type GetModelsForMakeIdResults = {
Make_ID: number;
Make_Name: string;
Model_ID: number;
Model_Name: string;
};
//# sourceMappingURL=GetModelsForMakeId.d.ts.map