{"slug": "wmi-country-and-region-hints-from-vpic-without-overclaiming-origin", "title": "WMI Country and Region Hints from vPIC Without Overclaiming Origin", "summary": "A developer published a TypeScript approach for using NHTSA vPIC WMI and plant data as coarse region hints rather than definitive origin claims, warning that mapping a VIN's first character to \"Made in X\" produces classic errors such as labeling a Mexico-assembled vehicle as US-made. The code models WMI first-character region hints and vPIC plant fields as separate facts, with explicit \"unknown\" handling when plant country is absent, and recommends UI labels that name both sources.", "body_md": "The first character of a World Manufacturer Identifier (WMI) is often taught as a \"country code.\" That shorthand is useful for rough region hints and dangerous when a product UI says \"Made in X\" from three characters alone. Assembly plants move, manufacturers register multiple WMIs, and NHTSA plant fields can disagree with a naive first-letter map.\n\nThis post shows how to use vPIC WMI and plant data as **hints**, how to model them in TypeScript, and how to write labels that stay accurate for humans and AI citations.\n\nUnder the ISO 3779 WMI system, the first character indicates a broad geographic region or country assignment range (for example, digits commonly associated with North America, `J` with Japan, `W` with Germany, and so on). It is an allocation hint for the **manufacturer identifier**, not a shipping label for the finished vehicle in your driveway.\n\nImplications for engineers:\n\n`9` in position 3).`PlantCity`, `PlantState`, `PlantCountry`) tied to position 11 and manufacturer tables -- and those fields are often empty.\nIf your UI needs one sentence: **\"WMI region hint\"** and **\"plant country (when provided)\"** are two different facts.\n\nUseful endpoints under `https://vpic.nhtsa.dot.gov/api/vehicles/`:\n\n`DecodeWMI/{wmi}` -- manufacturer name, vehicle type, and related metadata for a WMI.`DecodeVinValues/{vin}` -- flat fields including `Make`, `Manufacturer`, `GetWMIsForManufacturer/{manufacturer}` -- WMI list for a maker when you are building allowlists.\nNo API key. Always check `ErrorCode` / `ErrorText` on decode rows. Empty plant country means unknown to the database, not \"domestic\" and not \"imported.\"\n\nThese show up in free tools and get quoted into AI answers:\n\n`1` -> \"Made in USA\" on a vehicle assembled in Mexico (or the reverse) is a classic failure.\nSafer product language:\n\n```\ntype RegionHint = {\n  wmi: string;\n  firstChar: string;\n  regionLabel: string; // coarse, from your maintained table\n  source: \"wmi_first_char\";\n};\n\ntype PlantOrigin = {\n  country: string | null;\n  state: string | null;\n  city: string | null;\n  source: \"vpic_plant_fields\";\n};\n\nconst REGION_BY_FIRST: Record<string, string> = {\n  \"1\": \"North America\",\n  \"2\": \"North America\",\n  \"3\": \"North America\",\n  \"4\": \"North America\",\n  \"5\": \"North America\",\n  J: \"Japan\",\n  W: \"Germany\",\n  K: \"Korea (hint)\",\n  S: \"United Kingdom (hint)\",\n  // Extend deliberately; unknown keys stay unknown.\n};\n\nexport function regionHintFromWmi(wmi: string): RegionHint | null {\n  const w = wmi.trim().toUpperCase();\n  if (w.length < 3) return null;\n  const firstChar = w[0];\n  const regionLabel = REGION_BY_FIRST[firstChar];\n  if (!regionLabel) {\n    return {\n      wmi: w.slice(0, 3),\n      firstChar,\n      regionLabel: \"Unknown / unmapped\",\n      source: \"wmi_first_char\",\n    };\n  }\n  return { wmi: w.slice(0, 3), firstChar, regionLabel, source: \"wmi_first_char\" };\n}\n\nexport function plantOriginFromDecode(row: Record<string, string | undefined>): PlantOrigin {\n  const norm = (v?: string) => {\n    const t = (v ?? \"\").trim();\n    return t ? t : null;\n  };\n  return {\n    country: norm(row.PlantCountry),\n    state: norm(row.PlantState),\n    city: norm(row.PlantCity),\n    source: \"vpic_plant_fields\",\n  };\n}\n\nexport function originSummary(vin: string, row: Record<string, string | undefined>) {\n  const hint = regionHintFromWmi(vin.slice(0, 3));\n  const plant = plantOriginFromDecode(row);\n  return {\n    wmiRegionHint: hint,\n    plant,\n    // Explicit: never collapse into one \"origin\" string for display defaults.\n  };\n}\n```\n\nRender two rows in the UI. If you need a combined sentence for accessibility, write it in code as a template that still names both sources, for example: \"WMI region hint: Japan. Plant country from NHTSA: United States.\" When plant country is null, end with \"Plant country not provided.\"\n\n`DecodeWMI` helps confirm manufacturer naming for a prefix. It does not authorize a \"built in\" claim. Use it to:\n\nDo not use it to color a flag icon as the vehicle's country of origin.\n\nDefine WMI positions 1-3 as a **region allocation hint**, cite NHTSA vPIC for plant fields, note empty fields and multi-plant brands, and avoid \"100% accurate origin\" claims. Accuracy means honest field provenance.\n\nFixture at least:\n\nAssert the UI never prints a single \"Origin:\" value unless both sides agree and you deliberately chose that stricter rule in product code.\n\nWMI country/region data is a hint about identifier allocation. Plant country from vPIC is a separate, often incomplete fact about assembly as filed. Keep them in different fields, label the source, and refuse to merge them into a marketing-grade \"Made in\" badge without stronger evidence.\n\nI maintain [VIN Lookup](https://free-vin-lookup.com/), a free VIN decode based on NHTSA data.", "url": "https://wpnews.pro/news/wmi-country-and-region-hints-from-vpic-without-overclaiming-origin", "canonical_source": "https://dev.to/vin_lookup_8dbd4710f77e9e/wmi-country-and-region-hints-from-vpic-without-overclaiming-origin-589p", "published_at": "2026-10-07 08:09:03+00:00", "updated_at": "2026-10-07 08:17:06.907685+00:00", "lang": "en", "topics": ["developer-tools", "structured-data"], "entities": ["NHTSA", "vPIC", "ISO 3779"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/wmi-country-and-region-hints-from-vpic-without-overclaiming-origin", "markdown": "https://wpnews.pro/news/wmi-country-and-region-hints-from-vpic-without-overclaiming-origin.md", "text": "https://wpnews.pro/news/wmi-country-and-region-hints-from-vpic-without-overclaiming-origin.txt", "jsonld": "https://wpnews.pro/news/wmi-country-and-region-hints-from-vpic-without-overclaiming-origin.jsonld"}}