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

@lookuptax/sdk

v1.0.2

Published

Official LookupTax SDK — validate tax IDs (VAT, EIN, GSTIN, ABN…) against government registries.

Readme

LookupTax SDK for TypeScript & JavaScript

Validate tax IDs — VAT, EIN, GSTIN, ABN and more — against official government registries.

lookuptax.com

Written in TypeScript, published with compiled JS and type definitions, so JavaScript and TypeScript projects both consume it the same way.

npm install @lookuptax/sdk

Requires Node 18+ (or any runtime with global fetch).

Quick start

import { LookupTax } from "@lookuptax/sdk";

const lookuptax = new LookupTax({ apiKey: process.env.LOOKUPTAX_API_KEY! });

const res = await lookuptax.validate("IE", "53057102A");

if (res.result.status === "VALID") {
  console.log("Confirmed:", res.entity?.name);
}

Read result.status, not isValid

Every response carries a result object whose status is the single source of truth. There are five mutually exclusive values:

| result.status | Meaning | |---|---| | VALID | Format passed and a government registry confirmed the entity. | | INVALID | Definitive negative — bad structure/check digit, or no registry record. | | UNVERIFIED | No queryable registry for that country, so only the format was checked. A pass is not proof the business exists. | | INDETERMINATE | A registry was temporarily unreachable. Retry — do not treat as invalid. | | UNSUPPORTED | We don't validate that country or number type yet. |

Do not branch on validation.overall.isValid: it is true for VALID, UNVERIFIED and INDETERMINATE alike, so a format-only pass looks identical to a registry-confirmed one. result.status exists to remove that ambiguity.

switch (res.result.status) {
  case "VALID":         return accept(res.entity);
  case "INVALID":       return reject(res.result.reason);
  case "UNVERIFIED":    return acceptWithCaveat();   // format checked only
  case "INDETERMINATE": return retryLater();         // registry was down
  case "UNSUPPORTED":   return skip();
}

Errors vs outcomes

The SDK mirrors the API's split, and the distinction matters:

  • Validation outcomes resolve. An INVALID tax ID is a successful call — you get a response, not an exception. UNSUPPORTED resolves too, even though it arrives as HTTP 422, because the body still carries a result.
  • Request errors throw. Authentication, quota, rate limit, malformed request — the call could not be processed at all.
import { LookupTaxError, QuotaExceededError, RateLimitError } from "@lookuptax/sdk";

try {
  const res = await lookuptax.validate("IE", "53057102A");
} catch (err) {
  if (err instanceof RateLimitError) await sleep((err.retryAfter ?? 1) * 1000);
  else if (err instanceof QuotaExceededError) notifyBilling();
  else if (err instanceof LookupTaxError) console.error(err.code, err.status);
}

Branch on err.code (a stable machine-readable string), never on err.message.

Transient failures — 429, 500, 503 — are retried automatically (2 attempts by default, honouring Retry-After). Set maxRetries: 0 to opt out. Batch submission is never retried automatically, because a retried submission that actually succeeded would create a second batch and reserve quota twice.

EU routing

For EU member states you can choose which authority answers:

await lookuptax.validate("DE", "DE123456789", { validationSource: "vies" });  // VIES only
await lookuptax.validate("DE", "DE123456789", { validationSource: "local" }); // national registry only

With vies or local there is no fallback to the other — if the requested source cannot answer you get INDETERMINATE rather than a silent answer from the other one, which is what makes it usable for reconciliation. Default is auto. Ignored outside VIES-covered countries.

Countries needing a name

Some registries match on name as well as number:

await lookuptax.validate("MX", "XAXX010101000", {
  additionalParams: { name: "Empresa Ejemplo SA de CV" },
});

Batch

Submit up to 100 IDs; validation runs asynchronously. Enterprise plan only.

const batch = await lookuptax.createBatch([
  { countryIso: "IE", tin: "53057102A" },
  { countryIso: "MX", tin: "XAXX010101000", name: "Empresa Ejemplo SA de CV" },
]);

const done = await lookuptax.waitForBatch(batch.batch_id);

for await (const item of lookuptax.iterateBatchResults(batch.batch_id)) {
  console.log(item.tin, item.validation_result?.result.status);
}

waitForBatch polls on a relaxed cadence by design. When a registry is unreachable an item keeps retrying for roughly three days, carrying a next_retry_at — a long-running item is not a stuck one.

Configuration

new LookupTax({
  apiKey:    "…",                               // required
  baseUrl:   "https://api.lookuptax.com/v1",    // default
  timeoutMs: 30_000,                            // per request
  maxRetries: 2,                                // 429/500/503 only
  fetch:     customFetch,                       // inject an agent/proxy, or for tests
});

baseUrl is configurable because the published path prefix is deployment configuration rather than a property of the SDK — point it at whichever root serves your account.

API

| Method | Endpoint | |---|---| | validate(countryIso, tin, opts?) | GET /validate | | createBatch(taxIds, opts?) | POST /batch | | getBatch(batchId, opts?) | GET /batch/{id} | | listBatches(opts?) | GET /batch | | cancelBatch(batchId) | POST /batch/{id}/cancel | | deleteBatch(batchId) | DELETE /batch/{id} | | getTaxId(requestId) | GET /batch/tax-id/{id} | | waitForBatch(batchId, opts?) | polls getBatch to a terminal state | | iterateBatchResults(batchId, opts?) | async iterator over every page |

License

MIT