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

looktwice-api

v0.1.1

Published

Official TypeScript SDK for LookTwice validation, CPSC recall screening, and evidence-backed watches.

Downloads

374

Readme

looktwice-api

npm version license

Official, dependency-free TypeScript SDK for the LookTwice API. Email, EU VAT, IBAN, and domain checks, plus evidence-backed CPSC recall screening.

curl -sS https://api.looktwice.dev/v1/vat/check \
  -H "Authorization: Bearer $LOOKTWICE_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"country_code":"DE","vat_number":"123456789"}'

OpenAPI: https://api.looktwice.dev/docs/json

Install

npm install looktwice-api

Node.js 18 or newer is required. The SDK is intended for server-side applications; never expose a live API key in public browser code.

Tools

| Method | What it does | Does not claim | | --- | --- | --- | | client.email.check | Syntax, MX, disposable, role, free-provider signals | Mailbox existence | | client.vat.check | Live EU VIES result, returned business fields, request evidence | Permanent tax status | | client.iban.check | Country length and ISO 7064 MOD-97 | Account existence or ownership | | client.domain.check | DNS, MX, TLS, RDAP for a registrable domain | Website safety | | client.cpsc.recallMatch | Ranked candidates against CPSC recalls and warnings | Safety, legality, or clearance |

Run your first check

Create a key in the LookTwice dashboard, then:

import { randomUUID } from "node:crypto";
import { LookTwice } from "looktwice-api";

const client = new LookTwice({
  apiKey: process.env.LOOKTWICE_API_KEY!,
});

const result = await client.vat.check(
  { country_code: "DE", vat_number: "123456789" },
  { idempotencyKey: randomUUID() },
);

console.log(result.valid, result.checked_at, result.request_identifier);

Charged checks require an idempotency key. Reusing the same key with the same request body returns the original result without charging twice. The SDK retries safe GET requests and requests carrying an idempotency key on 408, 429, and retryable 5xx responses.

Main methods

client.email.check(input, { idempotencyKey });
client.vat.check(input, { idempotencyKey });
client.iban.check(input, { idempotencyKey });
client.domain.check(input);
client.cpsc.recallMatch(input, { idempotencyKey });

client.cpsc.catalogs.create(input);
client.cpsc.catalogs.upsertItems(catalogId, input);
client.cpsc.catalogs.matches(catalogId, "active");

client.knowledge.watches.create(input);
client.knowledge.watches.get(watchId);

client.credits.balance();
client.usage.list();
client.prices.get();

Compared with building it yourself

| Need | Typical in-house path | What this SDK keeps explicit | | --- | --- | --- | | EU VAT | Call VIES, then invent retry and evidence storage | Valid / invalid / unavailable stay separate; request identifier and check time are returned | | Email | Regex plus a stale disposable list | MX and disposable signals; no SMTP probe | | IBAN | Regex or checksum-only library | Country length + MOD-97; no account-existence claim | | CPSC | Keyword search of the public feed | UPC/brand/model ranking with official URLs and timestamps |

Typed errors

import { LookTwiceError } from "looktwice-api";

try {
  await client.iban.check({ iban: "not-an-iban" }, { idempotencyKey: crypto.randomUUID() });
} catch (error) {
  if (error instanceof LookTwiceError) {
    console.error(error.status, error.code, error.requestId, error.details);
  }
}

Retry control

const client = new LookTwice({
  apiKey: process.env.LOOKTWICE_API_KEY!,
  maxRetries: 2,
  retryDelayMs: 250,
});

Non-idempotent POST requests are not retried automatically. Keep one idempotency key for all retries of the same logical charged request; do not generate a new key for every network attempt.

client.domain.check is a free, quota-limited POST without an idempotency key, so the SDK deliberately does not retry it after an ambiguous network failure.

Honest product boundaries

  • Email Check does not probe whether a mailbox exists.
  • IBAN Check validates structure and checksum; it does not confirm that an account exists or belongs to someone.
  • A CPSC none result means no match was found in the named, time-stamped sources. It is not a safety or legal clearance.
  • Knowledge Watch supports public HTTPS pages and reports evidence-backed fact changes.

See the API documentation, pricing, and free browser tools.

Support and security