npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@acjlabs/google-taxonomy-verify

v0.1.2

Published

Zero-dependency Google Product Taxonomy data + verification helpers — catch an LLM classifier fabricating a plausible-but-wrong taxonomy ID before you trust it.

Readme

@acjlabs/google-taxonomy-verify

Google's official Product Taxonomy, bundled as data, plus lookup and verification helpers. TypeScript, works in Node, Bun, Deno, and the browser — no network calls, no external services.

Install

npm install @acjlabs/google-taxonomy-verify

Why this exists

Ask an LLM to classify a product into Google's Product Taxonomy and it will confidently return a leaf_id that looks plausible — and is sometimes wrong. A real example: asked to classify a winter parka, a capable model returned 212 (the real ID for "Apparel & Accessories > Clothing > Shirts & Tops") instead of the correct 5598 ("Apparel & Accessories > Clothing > Outerwear > Coats & Jackets"). The claimed category path it gave alongside the ID didn't even match what 212 actually is — a fabrication, not just an imprecise guess.

Since Google's taxonomy is fixed, public reference data with exactly one correct answer per real-world category, there's no reason to trust a probabilistic claim here. Verify it deterministically instead.

What's in it

import {
  isVerifiedGoogleLeafId,
  lookupGoogleTaxonomyPath,
  findGoogleTaxonomyId,
  googleTaxonomyEntryCount,
} from "@acjlabs/google-taxonomy-verify";

// The core check: does this ID exist, AND does its real path match what was claimed?
isVerifiedGoogleLeafId("212", ["Apparel & Accessories", "Clothing", "Shirts & Tops"]); // true
isVerifiedGoogleLeafId("212", ["Apparel & Accessories", "Clothing", "Outerwear"]); // false — path mismatch
isVerifiedGoogleLeafId("999999", ["Anything"]); // false — ID doesn't exist

// Plain lookup by ID.
lookupGoogleTaxonomyPath("5598");
// ["Apparel & Accessories", "Clothing", "Outerwear", "Coats & Jackets"]
lookupGoogleTaxonomyPath("not-a-real-id"); // null

// Reverse lookup: exact full path -> ID. Not a fuzzy search — segments must match exactly.
findGoogleTaxonomyId(["Apparel & Accessories", "Clothing", "Shirts & Tops"]); // "212"

googleTaxonomyEntryCount(); // 5595

The data

google-taxonomy-2021-09-21.json — 5,595 entries, {ID, Cat1..Cat7} (up to 7 taxonomy levels; empty string for unused levels). Sourced from Google's own published taxonomy file (google.com/basepages/producttype/taxonomy-with-ids.en-US.txt), confirmed current via a direct live check against that file. Google publishes this taxonomy specifically for merchant/developer use in Shopping feeds — public reference data, not a creative work requiring a license grant, consistent with the several other open-source mirrors of the same file.

Why this exists (the longer version)

We build Catalog Attribute Normalizer, a hosted API/MCP server that classifies merchant product catalogs into Google/Shopify/Amazon taxonomies using an LLM classifier — and hit exactly the fabrication problem described above in our own real classifier output. The fix (verify every claimed ID against the real taxonomy file before trusting it, never fabricate) is now a standing part of that product. This package is the small, standalone piece of that fix: the real taxonomy data plus the verification/lookup logic, with no LLM, no hosting, no API key — just the reference data and deterministic checks, MIT-licensed, for anyone who needs it on its own.

Scope

This ships one taxonomy snapshot (2021-09-21, confirmed current as of publishing this package). Google updates the taxonomy occasionally; if a newer snapshot matters for your use case, verify against Google's own live file (linked above) before relying on an exact ID match for very recently added categories. This package does not classify products for you — it only verifies/looks up IDs you (or your classifier) already have. If you need the classification itself, that's a separate, harder problem — see Catalog Attribute Normalizer if you want a hosted solution, or an open-source text-to-category matcher if you'd rather run one yourself (a different task from this package's ID verification).

License

MIT