@meterapp/vehicle-db 2.7.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @meterapp/vehicle-db
2
2
 
3
- An offline, international vehicle make/model catalog for Node.js and TypeScript. The package combines U.S. model-year data, the UK registered fleet, Asian-origin vehicles registered in New Zealand, Malaysian registration transactions, and an Indian manufacturer catalog into one small, zero-dependency API. It never makes runtime network requests.
3
+ 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, and an Indian manufacturer catalog into one small, zero-dependency API. It never makes runtime network requests.
4
4
 
5
- The current snapshot spans **1990–2026** and includes **1,145 makes**, **14,841 model names**, and **132,491 deduplicated model-year entries** from **5 data sources**.
5
+ The current snapshot spans **1990–2027** and includes **1,580 makes**, **36,870 model names**, and **207,953 deduplicated model-year entries** from **7 data sources**.
6
6
 
7
- The catalog covers seven vehicle types: **Motorcycle**, **Passenger Car**, **Truck**, **Bus**, **Multipurpose Passenger Vehicle (MPV)**, **Auto Rickshaw**, and **Other Vehicle**. 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.
7
+ 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.
8
8
 
9
9
  ## Demo and playground
10
10
 
@@ -29,10 +29,6 @@ import {
29
29
  getMakes,
30
30
  getModels,
31
31
  getAvailableYears,
32
- getAvailableYearRanges,
33
- getModelAppearanceRanges,
34
- getModelRenderGroups,
35
- getRepresentativeYear,
36
32
  } from "@meterapp/vehicle-db";
37
33
 
38
34
  // Inspect provenance and coverage before querying.
@@ -84,6 +80,25 @@ const malaysiaMakes = getMakes({
84
80
  sourceId: "malaysia-jpj-registrations",
85
81
  });
86
82
 
83
+ // Models registered as new in the EU, Iceland, and Norway, e.g. BYD Seal U.
84
+ const euMakes = getMakes({ year: 2024, sourceId: "eea-co2-monitoring" });
85
+ const bydEu = euMakes.find((make) => make.makeName === "BYD");
86
+ const bydEuModels = getModels({
87
+ makeId: bydEu!.makeId,
88
+ year: 2024,
89
+ sourceId: "eea-co2-monitoring",
90
+ });
91
+
92
+ // Current-year European registrations from the Dutch register, e.g. BYD Atto 2.
93
+ const bydNl = getMakes({ year: 2026, sourceId: "rdw-nl-vehicle-register" }).find(
94
+ (make) => make.makeName === "BYD",
95
+ );
96
+ const bydNlModels = getModels({
97
+ makeId: bydNl!.makeId,
98
+ year: 2026,
99
+ sourceId: "rdw-nl-vehicle-register",
100
+ });
101
+
87
102
  // Existing queries remain valid.
88
103
  const toyota = getMakes({ year: 2024 }).find((make) => make.makeName === "TOYOTA");
89
104
  const toyotaModels = getModels({ makeId: toyota!.makeId, year: 2024 });
@@ -92,55 +107,6 @@ const years = getAvailableYears({
92
107
  vehicleTypeId: 2,
93
108
  sourceId: "nhtsa-vpic",
94
109
  });
95
-
96
- // Availability and exterior equivalence are intentionally separate.
97
- const availability = getAvailableYearRanges({ makeId: toyota!.makeId });
98
- const arteonAppearances = getModelAppearanceRanges({
99
- makeId: getMakes().find((make) => make.makeName === "VOLKSWAGEN")!.makeId,
100
- modelName: "Arteon",
101
- });
102
-
103
- // Safe cache identity: verified ranges share a representative year; unknown
104
- // and overlapping transition years return the requested year unchanged.
105
- const renderYear = getRepresentativeYear({
106
- makeId: arteonAppearances[0].makeId,
107
- modelName: "Arteon",
108
- year: 2018,
109
- }); // 2019
110
- ```
111
-
112
- ## Appearance ranges and image reuse
113
-
114
- A model being available in consecutive years does **not** prove that its exterior stayed the
115
- same. `getAvailableYearRanges()` only compresses catalog availability for display. Sourced
116
- generation/facelift facts live in `data/appearance-ranges.json` and are returned by
117
- `getModelAppearanceRanges()` with their body style, market, and evidence URL.
118
-
119
- `getModelRenderGroups()` turns those facts into a complete cache plan. It groups a year only when
120
- exactly one verified appearance range covers it. Years with no evidence, and transition years
121
- covered by two overlapping ranges, remain singleton exact-year groups. `getRepresentativeYear()`
122
- is the convenience lookup for storage/cache keys and has the same fail-closed behavior.
123
-
124
- This split is deliberate. NHTSA vPIC provides model-year and body-class data but no global
125
- generation identifier; Wikidata is CC0 but generation and facelift coverage is sparse. Broad
126
- third-party generation dumps commonly carry restrictive or share-alike terms and overlapping
127
- records, so they are useful for research but are not imported automatically. Verified ranges are
128
- small, reviewable facts linked to first-party or equivalently authoritative public evidence.
129
-
130
- NHTSA wheelbase, dimensions, doors, series, and truck cab/bed fields can rank possible body-family
131
- matches. They are candidate evidence only: related platforms and trims can still have visibly
132
- different bodywork. `appearanceId` is intentionally stricter than a derived `body_family_id` and
133
- is the only grouping allowed to drive render reuse. See CONTRIBUTING for the review criteria.
134
-
135
- ```typescript
136
- const volkswagen = getMakes().find((make) => make.makeName === "VOLKSWAGEN")!;
137
-
138
- getModelAppearanceRanges({ makeId: volkswagen.makeId, modelName: "Arteon" });
139
- // Original Arteon: 2017–2020, Fastback, with Volkswagen evidence
140
- // Updated Arteon: 2020–2026, Fastback, with Volkswagen evidence
141
-
142
- getModelRenderGroups({ makeId: volkswagen.makeId, modelName: "Arteon" });
143
- // 2017–2019 share one render; overlapping 2020 stays exact; 2021–2026 share one render.
144
110
  ```
145
111
 
146
112
  ## Driver search and autocomplete
@@ -267,17 +233,6 @@ getAvailableYears({ makeId: 448, vehicleTypeId: 2, sourceId: "nhtsa-vpic" });
267
233
  getAvailableYears({ modelId: 2469, sourceId: "nhtsa-vpic" });
268
234
  ```
269
235
 
270
- ### Appearance and year-range APIs
271
-
272
- - `getAvailableYearRanges(options?): VehicleYearRange[]` compresses consecutive availability
273
- years; it makes no exterior-equivalence claim.
274
- - `getModelAppearanceRanges({ makeId, modelName, year? }): VehicleAppearanceRange[]` returns
275
- verified generation/facelift periods and evidence. Overlap is preserved.
276
- - `getModelRenderGroups({ makeId, modelName, vehicleTypeId?, sourceId? }): VehicleRenderGroup[]`
277
- returns safe, non-overlapping cache groups for every available year.
278
- - `getRepresentativeYear({ makeId, modelName, year, ... }): number` returns the canonical cache
279
- year for an unambiguous verified group, otherwise the requested year.
280
-
281
236
  ### `searchVehicles(query, options?): VehicleSearchResult[]`
282
237
 
283
238
  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`).
@@ -288,18 +243,24 @@ Model results contain `years` and a year-specific `variants` array. Make results
288
243
 
289
244
  | Source | Coverage in this snapshot | Terms |
290
245
  |---|---|---|
291
- | [NHTSA vPIC](https://vpic.nhtsa.dot.gov/api/) | U.S. passenger cars, trucks, and MPVs; model years 1990–2026 | U.S. government public data |
246
+ | [NHTSA vPIC](https://vpic.nhtsa.dot.gov/api/) | U.S. passenger cars, trucks, and MPVs; model years 1990–2027 | U.S. government public data |
292
247
  | [UK DfT/DVLA vehicle licensing statistics](https://www.gov.uk/government/statistical-data-sets/vehicle-licensing-statistics-data-files) | 701 normalized makes across cars, motorcycles, goods vehicles, buses and coaches, and other vehicles; manufacture years 1990–2025 | [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/) |
293
248
  | [Atul Auto product catalog](https://atulauto.co.in/products/) | Current Indian passenger and cargo auto-rickshaw range; catalog years 2024–2026 | Source attribution; factual product names only |
294
249
  | [NZTA Motor Vehicle Register](https://www.nzta.govt.nz/resources/new-zealand-motor-vehicle-register-statistics/new-zealand-vehicle-fleet-open-data-sets) | 30,374 Asian-origin car, truck, bus, motorcycle, and moped model-year records from 12 countries of origin; vehicle years 1990–2026 | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) |
295
250
  | [Malaysia JPJ registration transactions](https://data.gov.my/data-catalogue/registration_transactions_car) | 1,756 passenger car, MPV, jeep, pickup, and window-van model/registration-year records; 2024–2026 | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) |
251
+ | [EEA CO2 monitoring of new passenger cars and vans](https://www.eea.europa.eu/en/datahub/datahubitem-view/fa8b1229-3db6-495d-b18e-9c9b3267c02b) | 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](https://creativecommons.org/licenses/by/4.0/) |
252
+ | [Netherlands RDW vehicle register](https://opendata.rdw.nl/Voertuigen/Open-Data-RDW-Gekentekende_voertuigen/m9d7-ebf2) | 73,190 passenger car, commercial vehicle, bus, and motorcycle model/first-admission-year records from 624 makes licensed in the Netherlands; 1990–2026 | [Public domain (RDW Open Data)](https://opendata.rdw.nl/) |
296
253
 
297
- 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, and registration year for Malaysia JPJ. 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.
254
+ 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, and the year of first admission (first registration anywhere, so imported used vehicles keep their original year) for the Dutch RDW register. 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.
298
255
 
299
256
  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.
300
257
 
301
258
  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.
302
259
 
260
+ 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.
261
+
262
+ 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.
263
+
303
264
  ## Factory colors
304
265
 
305
266
  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.
@@ -308,13 +269,13 @@ Factory paint availability is not included. The NZTA and Malaysia records contai
308
269
 
309
270
  | | |
310
271
  |---|---:|
311
- | Years | 1990–2026 |
312
- | Sources | 5 |
272
+ | Years | 1990–2027 |
273
+ | Sources | 7 |
313
274
  | Vehicle types | 7 |
314
- | Makes | 1,145 |
315
- | Model names | 14,841 |
316
- | Deduplicated model-year entries | 132,491 |
317
- | Bundled TypeScript data | 4.21 MB |
275
+ | Makes | 1,580 |
276
+ | Model names | 36,870 |
277
+ | Deduplicated model-year entries | 207,953 |
278
+ | Bundled TypeScript data | 7.17 MB |
318
279
 
319
280
  ## Refreshing and rebuilding
320
281
 
@@ -331,13 +292,15 @@ Refresh either network source independently, then rebuild the combined catalog:
331
292
 
332
293
  ```bash
333
294
  npm run refresh:uk-dft
334
- npm run refresh:nhtsa -- --start-year 1990 --end-year 2026
295
+ npm run refresh:nhtsa -- --start-year 1990 --end-year 2027
335
296
  npm run refresh:nzta-asia-pacific -- --start-year 1990 --end-year 2026
336
297
  npm run refresh:malaysia-jpj -- --start-year 2024 --end-year 2026
298
+ npm run refresh:eea-co2 -- --start-year 2010 --end-year 2026
299
+ npm run refresh:rdw-nl -- --start-year 1990 --end-year 2026
337
300
  npm run build:data
338
301
  ```
339
302
 
340
- The NHTSA API rate-limits aggressively, so a full NHTSA refresh can take time. 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. Importers assign deterministic numeric IDs, write normalized snapshots, and discard temporary raw downloads.
303
+ The NHTSA API rate-limits aggressively, so a full NHTSA refresh can take hours; to add a new model year, fetch only that year and merge it into the existing snapshot with `npm run refresh:nhtsa -- --start-year 2027 --end-year 2027 --merge`. 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.
341
304
 
342
305
  ## License
343
306
 
package/dist/data.d.ts CHANGED
@@ -24,20 +24,6 @@ interface CompactData {
24
24
  }[];
25
25
  modelNames: string[];
26
26
  models: [number, number, number, number, number, number][];
27
- appearanceRanges: {
28
- id: string;
29
- make_id: number;
30
- make_name: string;
31
- model_name: string;
32
- label: string;
33
- body_style: string;
34
- year_from: number;
35
- year_to: number;
36
- representative_year: number;
37
- regions: string[];
38
- source_name: string;
39
- source_url: string;
40
- }[];
41
27
  }
42
28
  declare const data: CompactData;
43
29
  export default data;