{"_id":"@acjlabs/google-taxonomy-verify","_rev":"3-fe78d68fe0da61f33f10d3017f6e35e9","name":"@acjlabs/google-taxonomy-verify","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@acjlabs/google-taxonomy-verify","version":"0.1.0","keywords":["google","product-taxonomy","google-shopping","category","taxonomy","llm","hallucination","validation"],"author":{"url":"https://acjlabs.com","name":"ACJ Labs","email":"contact@acjlabs.com"},"license":"MIT","_id":"@acjlabs/google-taxonomy-verify@0.1.0","maintainers":[{"name":"acjlabsdev","email":"npm@acjlabs.com"}],"homepage":"https://github.com/acjlabs/google-taxonomy-verify#readme","bugs":{"url":"https://github.com/acjlabs/google-taxonomy-verify/issues"},"dist":{"shasum":"9fb284c2a28fba21d97f30dceb03e67412fe26e9","tarball":"https://registry.npmjs.org/@acjlabs/google-taxonomy-verify/-/google-taxonomy-verify-0.1.0.tgz","fileCount":8,"integrity":"sha512-46AT3+ElqSGuMvI65AqXljYOmEE+GNFh0b2YUHghh40JuuUYLpoIZPyfiFV9uAisg8t/ZTC2mRRDEi72AZ11eA==","signatures":[{"sig":"MEYCIQDfjb5qsbQJGLekAlFp/5RlI8MF2XsZcTqDU+mnPwewFwIhAMIi6NnUNbP8CGr0TiXp7Azf93fLLH2ylES9Vj84ARBW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1369998},"main":"./dist/index.js","type":"module","_from":"file:acjlabs-google-taxonomy-verify-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"bun test","build":"rm -rf dist && tsc -p tsconfig.build.json","typecheck":"tsc --noEmit"},"_npmUser":{"name":"acjlabsdev","email":"npm@acjlabs.com"},"_resolved":"/tmp/acjlabs-publish/acjlabs-google-taxonomy-verify-0.1.0.tgz","_integrity":"sha512-46AT3+ElqSGuMvI65AqXljYOmEE+GNFh0b2YUHghh40JuuUYLpoIZPyfiFV9uAisg8t/ZTC2mRRDEi72AZ11eA==","repository":{"url":"git+https://github.com/acjlabs/google-taxonomy-verify.git","type":"git"},"_npmVersion":"10.9.2","description":"Zero-dependency Google Product Taxonomy data + verification helpers — catch an LLM classifier fabricating a plausible-but-wrong taxonomy ID before you trust it.","directories":{},"sideEffects":false,"_nodeVersion":"22.17.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/google-taxonomy-verify_0.1.0_1784764044594_0.9158144746253631","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@acjlabs/google-taxonomy-verify","version":"0.1.1","keywords":["google","product-taxonomy","google-shopping","category","taxonomy","llm","hallucination","validation"],"author":{"url":"https://acjlabs.com","name":"ACJ Labs","email":"contact@acjlabs.com"},"license":"MIT","_id":"@acjlabs/google-taxonomy-verify@0.1.1","maintainers":[{"name":"acjlabsdev","email":"npm@acjlabs.com"}],"homepage":"https://acjlabs.com/open-source","bugs":{"url":"https://github.com/acjlabs/google-taxonomy-verify/issues"},"dist":{"shasum":"9671b0d2f59142985f85cc93b8d0c6a9859b1fb5","tarball":"https://registry.npmjs.org/@acjlabs/google-taxonomy-verify/-/google-taxonomy-verify-0.1.1.tgz","fileCount":8,"integrity":"sha512-bTJOL2t1DjblxwQyjq2X859gomNsqrgPgkGJsHZo4pAAyxf+YwcpmnyBxe2Knt9Y5oNvdtu7KihQT58AlU3pdw==","signatures":[{"sig":"MEQCIEp3adJ7A5/TAsKk2xRzZYzGRISsaEmPcrEYTnOukFKuAiB7FsuChigZHl1rsw7zkQ8QgOgcmv6cZMqeXCQV3hehUA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1369973},"main":"./dist/index.js","type":"module","_from":"file:acjlabs-google-taxonomy-verify-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"bun test","build":"rm -rf dist && tsc -p tsconfig.build.json","typecheck":"tsc --noEmit"},"_npmUser":{"name":"acjlabsdev","email":"npm@acjlabs.com"},"_resolved":"/tmp/acjlabs-publish/acjlabs-google-taxonomy-verify-0.1.1.tgz","_integrity":"sha512-bTJOL2t1DjblxwQyjq2X859gomNsqrgPgkGJsHZo4pAAyxf+YwcpmnyBxe2Knt9Y5oNvdtu7KihQT58AlU3pdw==","repository":{"url":"git+https://github.com/acjlabs/google-taxonomy-verify.git","type":"git"},"_npmVersion":"10.9.2","description":"Zero-dependency Google Product Taxonomy data + verification helpers — catch an LLM classifier fabricating a plausible-but-wrong taxonomy ID before you trust it.","directories":{},"sideEffects":false,"_nodeVersion":"22.17.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/google-taxonomy-verify_0.1.1_1784964914155_0.8658603322741711","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@acjlabs/google-taxonomy-verify","version":"0.1.2","description":"Zero-dependency Google Product Taxonomy data + verification helpers — catch an LLM classifier fabricating a plausible-but-wrong taxonomy ID before you trust it.","license":"MIT","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"sideEffects":false,"scripts":{"build":"rm -rf dist && tsc -p tsconfig.build.json","test":"bun test","typecheck":"tsc --noEmit"},"keywords":["google","product-taxonomy","google-shopping","category","taxonomy","llm","hallucination","validation"],"repository":{"type":"git","url":"git+https://github.com/acjlabs/google-taxonomy-verify.git"},"homepage":"https://acjlabs.com/open-source","bugs":{"url":"https://github.com/acjlabs/google-taxonomy-verify/issues"},"author":{"name":"ACJ Labs","email":"contact@acjlabs.com","url":"https://acjlabs.com"},"_id":"@acjlabs/google-taxonomy-verify@0.1.2","_integrity":"sha512-MBKAc7H7lW3oAzHPIoracvaXJVOwYkGf1m90Hn5FUAvM0e7S81G6TL0A2RtxpVAkSGHVjU6wKOUSXpq6Z+gUnw==","_resolved":"/tmp/acjlabs-publish/acjlabs-google-taxonomy-verify-0.1.2.tgz","_from":"file:acjlabs-google-taxonomy-verify-0.1.2.tgz","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-MBKAc7H7lW3oAzHPIoracvaXJVOwYkGf1m90Hn5FUAvM0e7S81G6TL0A2RtxpVAkSGHVjU6wKOUSXpq6Z+gUnw==","shasum":"b0437cad3fbafbb9fdd1f37374fba2933a5d53c0","tarball":"https://registry.npmjs.org/@acjlabs/google-taxonomy-verify/-/google-taxonomy-verify-0.1.2.tgz","fileCount":8,"unpackedSize":1369917,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQChEWLtBZWzPUEsZGQ3BNmy71oAC0uHALihq6JYBkxKMQIhAKwbUfR5tMYSRwBzK/z6lG7+VaHlkdnUcAFbu03fhsbn"}]},"_npmUser":{"name":"acjlabsdev","email":"npm@acjlabs.com"},"directories":{},"maintainers":[{"name":"acjlabsdev","email":"npm@acjlabs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/google-taxonomy-verify_0.1.2_1785459967469_0.4888330367008431"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-22T23:47:24.457Z","modified":"2026-07-31T01:06:07.840Z","0.1.0":"2026-07-22T23:47:24.751Z","0.1.1":"2026-07-25T07:35:14.309Z","0.1.2":"2026-07-31T01:06:07.645Z"},"bugs":{"url":"https://github.com/acjlabs/google-taxonomy-verify/issues"},"author":{"name":"ACJ Labs","email":"contact@acjlabs.com","url":"https://acjlabs.com"},"license":"MIT","homepage":"https://acjlabs.com/open-source","keywords":["google","product-taxonomy","google-shopping","category","taxonomy","llm","hallucination","validation"],"repository":{"type":"git","url":"git+https://github.com/acjlabs/google-taxonomy-verify.git"},"description":"Zero-dependency Google Product Taxonomy data + verification helpers — catch an LLM classifier fabricating a plausible-but-wrong taxonomy ID before you trust it.","maintainers":[{"name":"acjlabsdev","email":"npm@acjlabs.com"}],"readme":"# @acjlabs/google-taxonomy-verify\n\nGoogle's official Product Taxonomy, bundled as data, plus lookup and verification helpers. TypeScript,\nworks in Node, Bun, Deno, and the browser — no network calls, no external services.\n\n## Install\n\n```sh\nnpm install @acjlabs/google-taxonomy-verify\n```\n\n## Why this exists\n\nAsk an LLM to classify a product into Google's Product Taxonomy and it will confidently return a\n`leaf_id` that looks plausible — and is sometimes wrong. A real example: asked to classify a winter\nparka, a capable model returned `212` (the real ID for \"Apparel & Accessories > Clothing > Shirts &\nTops\") instead of the correct `5598` (\"Apparel & Accessories > Clothing > Outerwear > Coats & Jackets\").\nThe claimed category *path* it gave alongside the ID didn't even match what `212` actually is — a\nfabrication, not just an imprecise guess.\n\nSince Google's taxonomy is fixed, public reference data with exactly one correct answer per real-world\ncategory, there's no reason to trust a probabilistic claim here. Verify it deterministically instead.\n\n## What's in it\n\n```ts\nimport {\n  isVerifiedGoogleLeafId,\n  lookupGoogleTaxonomyPath,\n  findGoogleTaxonomyId,\n  googleTaxonomyEntryCount,\n} from \"@acjlabs/google-taxonomy-verify\";\n\n// The core check: does this ID exist, AND does its real path match what was claimed?\nisVerifiedGoogleLeafId(\"212\", [\"Apparel & Accessories\", \"Clothing\", \"Shirts & Tops\"]); // true\nisVerifiedGoogleLeafId(\"212\", [\"Apparel & Accessories\", \"Clothing\", \"Outerwear\"]); // false — path mismatch\nisVerifiedGoogleLeafId(\"999999\", [\"Anything\"]); // false — ID doesn't exist\n\n// Plain lookup by ID.\nlookupGoogleTaxonomyPath(\"5598\");\n// [\"Apparel & Accessories\", \"Clothing\", \"Outerwear\", \"Coats & Jackets\"]\nlookupGoogleTaxonomyPath(\"not-a-real-id\"); // null\n\n// Reverse lookup: exact full path -> ID. Not a fuzzy search — segments must match exactly.\nfindGoogleTaxonomyId([\"Apparel & Accessories\", \"Clothing\", \"Shirts & Tops\"]); // \"212\"\n\ngoogleTaxonomyEntryCount(); // 5595\n```\n\n## The data\n\n`google-taxonomy-2021-09-21.json` — 5,595 entries, `{ID, Cat1..Cat7}` (up to 7 taxonomy levels; empty\nstring for unused levels). Sourced from Google's own published taxonomy file\n(`google.com/basepages/producttype/taxonomy-with-ids.en-US.txt`), confirmed current via a direct\nlive check against that file. Google publishes this taxonomy specifically for merchant/developer use in\nShopping feeds — public reference data, not a creative work requiring a license grant, consistent with\nthe several other open-source mirrors of the same file.\n\n## Why this exists (the longer version)\n\nWe build [Catalog Attribute Normalizer](https://github.com/acjlabs/catalog-normalizer), a hosted API/MCP\nserver that classifies merchant product catalogs into Google/Shopify/Amazon taxonomies using an LLM\nclassifier — and hit exactly the fabrication problem described above in our own real classifier output.\nThe fix (verify every claimed ID against the real taxonomy file before trusting it, never fabricate) is\nnow a standing part of that product. This package is the small, standalone piece of that fix: the real\ntaxonomy data plus the verification/lookup logic, with no LLM, no hosting, no API key — just the\nreference data and deterministic checks, MIT-licensed, for anyone who needs it on its own.\n\n## Scope\n\nThis ships one taxonomy snapshot (2021-09-21, confirmed current as of publishing this package). Google\nupdates the taxonomy occasionally; if a newer snapshot matters for your use case, verify against\nGoogle's own live file (linked above) before relying on an exact ID match for very recently added\ncategories. This package does **not** classify products for you — it only verifies/looks up IDs you (or\nyour classifier) already have. If you need the classification itself, that's a separate, harder\nproblem — see [Catalog Attribute Normalizer](https://github.com/acjlabs/catalog-normalizer) if you want\na hosted solution, or an open-source text-to-category matcher if you'd rather run one yourself (a\ndifferent task from this package's ID verification).\n\n## License\n\nMIT\n","readmeFilename":"README.md"}