Skip to content

Repository files navigation

@meterapp/vehicle-db

npm license playground

An offline, international vehicle make/model catalog for Node.js and TypeScript. The package combines U.S. model-year data, the UK registered fleet, the European Union's new car and van registration register, the daily-updated Dutch vehicle register, Asian-origin vehicles registered in New Zealand, Malaysian registration transactions, an Indian manufacturer catalog, the Brazil-exclusive Hyundai HB20 family, recent U.S. model configurations from FuelEconomy.gov, and reviewed manufacturer body derivatives and Saudi model-year evidence into one small, zero-dependency API. It never makes runtime network requests.

The current snapshot spans 1990–2027 and includes 1,607 makes, 38,831 model names, and 215,446 deduplicated model-year entries from 11 data sources.

The catalog covers seven vehicle types: Motorcycle, Passenger Car, Truck, Bus, Multipurpose Passenger Vehicle (MPV), Auto Rickshaw, and Other Vehicle. The European source adds continental models from Dacia, Cupra, DS, Lynk & Co, Alpine, and the Chinese brands entering Europe such as BYD, MG, Omoda, Xpeng, and Nio, as sold in the EU rather than the UK or U.S. The Dutch register keeps that coverage current: vehicles first registered this year appear within days, so 2026 models such as the BYD Atto 2 and Renault 5 E-Tech are already listed. The Asia-Pacific sources add Japanese domestic and kei models, Chinese EVs, Indian and Korean vehicles, Southeast Asian makes such as Perodua and Proton, and additional motorcycles and commercial vehicles.

Demo and playground

This catalog is the backbone of the Car Image API — an AI-native API that renders studio-quality, transparent-background images of every vehicle listed here (six camera angles, 15 colors, PNG/WebP/JPG, $1 per 1,000 images). Explore the data in the interactive playground or browse vehicles at carimage.dev/cars.

Missing a vehicle? Add its source-backed identity here; downstream image support and asset sharing are validated separately — see CONTRIBUTING.md.

Install

npm install @meterapp/vehicle-db

Requires Node.js 18 or newer.

Usage

import {
  getDataSources,
  getVehicleTypes,
  getMakes,
  getModels,
  getAvailableYears,
} from "@meterapp/vehicle-db";

// Inspect provenance and coverage before querying.
const sources = getDataSources();

// All seven categories, including Motorcycle (1) and Bus (5).
const types = getVehicleTypes();

// All makes with a 2024 motorcycle in the international UK fleet source.
const motorcycleMakes = getMakes({
  year: 2024,
  vehicleTypeId: 1,
  sourceId: "uk-dft-vehicle-licensing",
});

// Honda motorcycle models manufactured in 2024.
const honda = motorcycleMakes.find((make) => make.makeName === "HONDA");
const hondaMotorcycles = getModels({
  makeId: honda!.makeId,
  year: 2024,
  vehicleTypeId: 1,
  sourceId: "uk-dft-vehicle-licensing",
});

// Coach and transit bus makes/models use vehicle type 5.
const busMakes = getMakes({ year: 2024, vehicleTypeId: 5 });
const alexanderDennis = busMakes.find((make) => make.makeName === "ALEXANDER DENNIS");
const buses = getModels({
  makeId: alexanderDennis!.makeId,
  year: 2024,
  vehicleTypeId: 5,
});

// Japanese domestic and kei models from the Asian-origin NZTA slice.
const nztaAsiaMakes = getMakes({
  year: 2022,
  sourceId: "nzta-asia-pacific-mvr",
});
const hondaAsia = nztaAsiaMakes.find((make) => make.makeName === "HONDA");
const hondaAsiaModels = getModels({
  makeId: hondaAsia!.makeId,
  year: 2022,
  sourceId: "nzta-asia-pacific-mvr",
}); // Includes N-BOX.

// Southeast Asian market models such as Perodua Myvi and Proton S70.
const malaysiaMakes = getMakes({
  year: 2026,
  sourceId: "malaysia-jpj-registrations",
});

// Models registered as new in the EU, Iceland, and Norway, e.g. BYD Seal U.
const euMakes = getMakes({ year: 2024, sourceId: "eea-co2-monitoring" });
const bydEu = euMakes.find((make) => make.makeName === "BYD");
const bydEuModels = getModels({
  makeId: bydEu!.makeId,
  year: 2024,
  sourceId: "eea-co2-monitoring",
});

// Current-year European registrations from the Dutch register, e.g. BYD Atto 2.
const bydNl = getMakes({ year: 2026, sourceId: "rdw-nl-vehicle-register" }).find(
  (make) => make.makeName === "BYD",
);
const bydNlModels = getModels({
  makeId: bydNl!.makeId,
  year: 2026,
  sourceId: "rdw-nl-vehicle-register",
});

// Existing queries remain valid.
const toyota = getMakes({ year: 2024 }).find((make) => make.makeName === "TOYOTA");
const toyotaModels = getModels({ makeId: toyota!.makeId, year: 2024 });
const years = getAvailableYears({
  makeId: toyota!.makeId,
  vehicleTypeId: 2,
  sourceId: "nhtsa-vpic",
});

Driver search and autocomplete

The optional, zero-dependency search entry point turns free-form driver input into canonical catalog candidates. Its index is built lazily on the first search, and matching runs entirely in memory without network requests.

import { searchVehicles } from "@meterapp/vehicle-db/search";

const suggestions = searchVehicles("2020 toy cam", {
  sourceId: "nhtsa-vpic",
  vehicleTypeId: 2,
  limit: 10,
});

const camry = suggestions.find(
  (result) => result.kind === "model" && result.modelName === "Camry",
);

if (camry?.kind === "model") {
  // A query containing a year has one directly selectable variant.
  const selection = camry.variants[0];
  // Persist year, makeId, modelId, and vehicleTypeId — not display text alone.
}

Search accepts year, make, and model tokens in any order. It recognizes common punctuation variants such as F-150/f150 and CR-V/crv, a small set of make aliases such as VW and Chevy, and conservative misspellings. Results are ranked deterministically by exact, prefix, token, substring, then fuzzy match. Fuzzy matching is only used when no lexical result exists.

Queries without a year group a canonical make/model/type across all available years rather than returning duplicate suggestions for every year. Each model result contains variants, which provides the preferred catalog modelId for every selectable year.

For the simplest driver experience:

  1. Infer the relevant market and pass its sourceId; year semantics differ by source.
  2. Offer one field labelled “Search year, make, or model” and begin suggesting after two characters.
  3. If the driver enters only a year, use getMakes({ year, ... }) for the next step; a year-only search intentionally returns no arbitrary alphabetical suggestions.
  4. On empty input, show application-owned recent vehicles. The catalog intentionally does not pretend that record frequency is vehicle popularity.
  5. Use the manual fallback Year → Make → Model. getAvailableYears(options) supports every step.

Applications with regional telemetry can request more candidates and rerank within the same matchKind. Text quality and market compatibility should remain ahead of behavioral popularity so an exact result never loses to an unrelated popular vehicle.

Conservative identity resolution

@meterapp/vehicle-db/resolve is an optional, offline entry point separate from autocomplete:

import { resolveVehicle } from "@meterapp/vehicle-db/resolve";

const result = resolveVehicle("2024 BMW 4 Series Gran Coupé", {
  market: "US",
  yearBasis: "model-year",
  depth: "visual",
});
if (result.status === "MATCHED") {
  // Identity is established; the application must still find an appropriate asset.
  console.log(result.selection.lineage, result.selection.visualIdentityIds);
}

Queries use an optional leading year, followed by make and full model phrase. With makeId, the make can be omitted. Only exact normalized phrases and reviewed aliases resolve; autocomplete/fuzzy candidates never silently become resolved identities. Unknown suffixes remain UNRESOLVED_TOKENS. Options also include year, vehicleTypeId, and sourceId.

depth defaults to catalog: a match at this depth establishes catalog presence only, with the source's documented year semantics. Request generation, derivative, or visual for stricter evidence. The curated identity graph is intentionally sparse: most catalog rows return GENERATION_UNRESOLVED at visual depth. MATCHED includes a selection; all results include candidates, unresolvedTokens, and the identity revision. Missing market/year context cannot satisfy restricted evidence, and overlapping generations remain ambiguous. No nearby year is substituted.

The graph uses make → line → generation → derivative → specification, with visual identities for bodies and appearance revisions. BMW Coupe, Convertible and Gran Coupe remain distinct; the 2014 generation and 2024/2025 appearance revisions do not share images implicitly. Aliases such as Prado and the reviewed Macan misspelling resolve only the line, not a generation or render.

@meterapp/vehicle-db/identity exports the graph types and evaluateVisualCompatibility. The latter evaluates direct, directional, scoped allow/deny rules: missing rules return unknown, an applicable deny wins, and approvals are never reversed or chained. It is a portable fact evaluator, not an asset database. Applications own reviewed asset bindings and final sharing policy. No asset-sharing approvals are bundled in this release.

Raw configuration and homologation evidence stays in build-time sidecars under data/evidence/, outside the npm bundle. See the implementation plan and source investigation.

API

getDataSources(): DataSource[]

Returns the provenance, license, region, retrieval date, year range, vehicle types, and record counts for every source.

interface DataSource {
  sourceId: string;
  sourceName: string;
  sourceUrl: string;
  license: string;
  licenseUrl?: string;
  region: string;
  description: string;
  retrievedAt: string;
  vehicleTypeIds: number[];
  yearFrom: number;
  yearTo: number;
  makeCount: number;
  modelCount: number;
}

getVehicleTypes(): VehicleType[]

Returns every vehicle category in the bundled catalog.

interface VehicleType {
  vehicleTypeId: number;
  vehicleTypeName: string;
}

getMakes(options?): Make[]

Returns makes, optionally filtered by year, vehicleTypeId, and/or sourceId.

getMakes();
getMakes({ year: 2024 });
getMakes({ year: 2024, vehicleTypeId: 5 });
getMakes({ sourceId: "uk-dft-vehicle-licensing" });
interface Make {
  makeId: number;
  makeName: string;
}

getModels(options?): Model[]

Returns models, optionally filtered by year, vehicleTypeId, makeId, modelId, and/or sourceId. sourceIds preserves provenance when equivalent records appear in more than one source.

getModels({ makeId: 474, year: 2024 });
getModels({ modelId: 2469, year: 2024 });
getModels({ year: 2024, vehicleTypeId: 1 });
getModels({ year: 2024, vehicleTypeId: 5, sourceId: "uk-dft-vehicle-licensing" });
interface Model {
  modelId: number;
  modelName: string;
  makeId: number;
  makeName: string;
  vehicleTypeId: number;
  vehicleTypeName: string;
  sourceIds: string[];
}

getAvailableYears(options?): number[]

Returns years present in the combined catalog, optionally filtered by makeId, modelId, vehicleTypeId, and/or sourceId. Results are sorted ascending.

getAvailableYears();
getAvailableYears({ makeId: 448, vehicleTypeId: 2, sourceId: "nhtsa-vpic" });
getAvailableYears({ modelId: 2469, sourceId: "nhtsa-vpic" });

searchVehicles(query, options?): VehicleSearchResult[]

Import from @meterapp/vehicle-db/search. Returns deterministic make and grouped model candidates for free-form input. Options include year, vehicleTypeId, sourceId, limit (default 10, maximum 100), and fuzzy (default true).

Model results contain years and a year-specific variants array. Make results intentionally omit models, allowing applications to transition into the existing getModels flow after the driver chooses a make.

Data sources

Source Coverage in this snapshot Terms
NHTSA vPIC U.S. passenger cars, trucks, and MPVs; model years 1990–2027 U.S. government public data
UK DfT/DVLA vehicle licensing statistics 701 normalized makes across cars, motorcycles, goods vehicles, buses and coaches, and other vehicles; manufacture years 1990–2025 Open Government Licence v3.0
Atul Auto product catalog Current Indian passenger and cargo auto-rickshaw range; catalog years 2024–2026 Source attribution; factual product names only
NZTA Motor Vehicle Register 30,431 Asian-origin car, truck, bus, motorcycle, and moped model-year records from 12 countries of origin; vehicle years 1990–2026 CC BY 4.0
Malaysia JPJ registration transactions 6,678 passenger car, MPV, jeep, pickup, and window-van model/registration-year records; 2015–2026 CC BY 4.0
EEA CO2 monitoring of new passenger cars and vans 29,939 passenger car (M1) and van (N1) model/registration-year records from 235 makes reported by EU member states, Iceland, and Norway; 2010–2025 CC BY 4.0
Netherlands RDW vehicle register 73,299 passenger car, commercial vehicle, bus, and motorcycle model/first-admission-year records from 627 makes licensed in the Netherlands; 1990–2026 Public domain (RDW Open Data)
Hyundai Motor Brasil line-up The Brazil-exclusive HB20 family (HB20 hatchback, HB20S sedan, HB20X crossover), 40 model-year records; Brazilian model years 2013–2027 Source attribution; factual product names only
FuelEconomy.gov (U.S. DOE/EPA) U.S. models the fuel-economy catalog lists as distinct models but vPIC does not list under any model year: the 2026 Maserati GT2 Stradale and MCPURA Spyder, 2 model-year records U.S. government public data

Year means the source’s model year for NHTSA, year of manufacture for DfT/DVLA (falling back to year of first use when manufacture year is unavailable), catalog year for Atul Auto, vehicle year for NZTA, registration year for Malaysia JPJ, the reporting (registration) year for the EEA register, the year of first admission (first registration anywhere, so imported used vehicles keep their original year) for the Dutch RDW register, the Brazilian model year (ano/modelo) for the Hyundai Motor Brasil line-up, and the U.S. model year for FuelEconomy.gov. From 2007 onward, NZTA vehicle year means the year of first registration in New Zealand or overseas. Registration sources are evidence that a make/model was present in that market and do not guarantee a factory model-year designation. Source filters let applications choose the semantics appropriate for their workflow.

UK source attribution: Contains public sector information licensed under the Open Government Licence v3.0. Source: Department for Transport and Driver and Vehicle Licensing Agency.

NZTA and Malaysia source attribution: Licensed under Creative Commons Attribution 4.0 International. Sources: New Zealand Transport Agency Waka Kotahi and Malaysia Road Transport Department/data.gov.my.

EEA source attribution: Licensed under Creative Commons Attribution 4.0 International. Source: European Environment Agency, Monitoring of CO2 emissions from passenger cars and Monitoring of CO2 emissions from vans, Regulation (EU) 2019/631. Member states report the make and commercial name inconsistently (multi-brand strings, legal entities, and trim-level names), so the importer merges brand spellings, drops engine and gearbox suffixes, keeps a make/model/year only when at least two countries report it or one country reports it more than 1,000 times, and uses the most reported spelling of each model name. The latest year is provisional data. EU vehicle categories map to the catalog as M1/M1G → Passenger Car and N1/N1G/N2 → Truck.

Hyundai Motor Brasil attribution: HB20, HB20S and HB20X are factual product names from Hyundai Motor Brasil's published line-up; launch (September 2012, January and April 2013) and discontinuation (HB20X, January 2022) dates come from Hyundai's announcements. No registration source in this catalog covers Brazil.

FuelEconomy.gov attribution: GT2 Stradale and MCPURA Spyder are factual 2026 model names from the U.S. Department of Energy and EPA fuel-economy catalog (vehicle records 50273 and 50274), which lists them as distinct models while vPIC files neither name for any model year. The 2026 MCPura itself comes from vPIC. Contributed in #20.

RDW source attribution: Open Data RDW (Dienst Wegverkeer), public domain. The register only contains vehicles currently licensed in the Netherlands, is republished daily, and is the freshest European source in the catalog. The same brand and model-name normalization as the EEA source is applied, plus a minimum of three vehicles per make/model/year to drop typos; RDW vehicle kinds map as Personenauto → Passenger Car, Bedrijfsauto → Truck, Bus → Bus, and Motorfiets → Motorcycle.

New sources in 2.13.0:

  • FuelEconomy.gov bulk feed: 2022–2027 model-year configurations; U.S. government public data. The legacy Maserati source remains independently addressable. Configuration suffixes are preserved, with a reviewed separator-only normalization for Mercedes-Benz AMG G63.
  • Reviewed manufacturer evidence: eight model-year records for Saudi Kia Pegas and U.S. BMW body derivatives / Lamborghini STO. Factual names only, with per-record URLs and market/year rationale in data/evidence/manufacturer-reviewed.json. GSO/SASO bulk data is not bundled; access/permission dependencies are documented in the source investigation.

Factory colors

Factory paint availability is not included. The NZTA and Malaysia records contain the observed basic color of each registered vehicle, not the manufacturer’s stock colors for a make/model/year. Treating those fields as factory availability would produce false positives from repaints, imports, and broad color categories, so the importers intentionally omit them. A future color API should require manufacturer-backed paint options with explicit market and model-year provenance.

Snapshot stats

Years 1990–2027
Sources 11
Vehicle types 7
Makes 1,607
Model names 38,831
Deduplicated model-year entries 215,446
Bundled TypeScript data 7.46 MB

Refreshing and rebuilding

The committed source snapshots make the package build deterministic and offline:

npm run build:data
npm test
npm run typecheck
npm run build

Refresh either network source independently, then rebuild the combined catalog:

npm run refresh:uk-dft
npm run refresh:nhtsa -- --start-year 2025 --end-year 2027 --merge --cache-dir .cache/nhtsa
npm run refresh:nzta-asia-pacific -- --start-year 1990 --end-year 2027
npm run refresh:malaysia-jpj -- --start-year 2015 --end-year 2026
npm run refresh:eea-co2 -- --start-year 2010 --end-year 2026
npm run refresh:rdw-nl -- --start-year 1990 --end-year 2026
npm run refresh:fueleconomy-us -- --start-year 2022 --end-year 2027
npm run refresh:reviewed
npm run build:data

A refresh only adds. Registers drop scrapped vehicles, count thresholds move between releases, and manufacturers re-file model years in vPIC (the 2026 Maserati MC20 became the MCPura in September 2026), but an application may already store a year/make/model this package published. Every importer therefore keeps the entries its previous snapshot published and the source no longer reports, and logs how many it kept; pass --prune to drop them deliberately, for example to remove a source error. Model-year sources run a year ahead of the calendar, so the NHTSA and NZTA importers default to ending next year; registration sources end with the current year.

The NHTSA API rate-limits aggressively: past a few requests a second its CDN answers HTTP 403 to every request from the address for an hour or more. The importer spaces requests (--concurrency 2, --interval-ms 500 by default), stops at the first sustained 403 instead of retrying into the block, and with --cache-dir keeps every answer it already received, so rerunning the same command later resumes where it stopped. A full NHTSA refresh can take hours; to refresh recent model years, fetch only those years and merge them into the existing snapshot with --merge, as above. The UK importer downloads the two official VEH0124 CSV files. The NZTA importer discovers the current official ArcGIS service and requests distinct records for supported vehicle types and Asian countries of origin. The Malaysia importer downloads annual JPJ CSVs and aggregates individual transactions into unique model/registration-year records. The EEA importer discovers the current final and provisional register tables from the EEA DiscoData catalogue and asks its public SQL endpoint for make/commercial-name counts grouped by reporting country and year, so it never downloads the individual registration records; --min-countries and --min-count tune the noise filter. The RDW importer asks the Socrata API for make/commercial-name counts per year of first admission, one request per year, so a refresh takes about ten minutes and can be run any day to pick up the latest registrations. Importers assign deterministic numeric IDs, write normalized snapshots, and discard temporary raw downloads.

Evidence and regression checks

npm run refresh:rdw-nl -- --start-year 2026 --end-year 2026 --evidence-out .cache/rdw-evidence.json
npm run refresh:eea-co2 -- --start-year 2024 --end-year 2024 --evidence-out .cache/eea-evidence.json
npx tsx scripts/reconcile-source.ts
npm run check:compatibility -- <prior-release-git-ref>
npm run replay
npm run replay -- /private/replay.json /private/report.json

Replay cases contain query (or make, model, year), cohort (customer, synthetic, haraj-sweep), optional n, resolver options, expectedStatus, and forbiddenModelNames. Reports record catalog, fixture and resolver hashes, commit/version, and separate cohort totals. Unreviewed matches measure resolution coverage only; they do not establish render correctness. Synthetic cohorts have zero demand weight. Never commit customer exports.

License

The package code is ISC licensed. Upstream data remains subject to the terms listed above.

About

Offline international vehicle DB: 1,599 makes, 36,998 models, and 210,424 model-year entries across cars, motorcycles, trucks, buses, MPVs, auto rickshaws, and more.

Topics

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages