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

macadress

v1.0.0

Published

Official JavaScript and TypeScript client for the macadress.com MAC address and OUI vendor lookup API. Runs on Node, Deno, Bun and browsers, with zero dependencies.

Readme

macadress

Official JavaScript and TypeScript client for the macadress.com MAC address and OUI vendor lookup API.

  • Vendor name, OUI, IEEE block, country, address type, EUI-64 / IPv6 link-local, randomization confidence, device guess
  • Keyless vendor-name lookup, plus keyed single / batch / directory-search endpoints
  • Typed results and a typed error per failure mode
  • Zero dependencies. Runs on Node 18+, Deno, Bun and browsers on the platform fetch
  • Ships ESM + CommonJS + .d.ts on npm, and TypeScript source on JSR
import { Client } from "macadress";

const macadress = new Client("mk_live_xxx");

await macadress.vendor("00:03:93:AB:12:34");            // "Apple, Inc."   (no API key required)
(await macadress.lookup("00:03:93:AB:12:34")).country; // "US"

Install

npm install macadress
// Deno
import { Client } from "jsr:@macadress/sdk";
// or:  deno add jsr:@macadress/sdk

// Bun
// bun add macadress

// Browser / no build step
import { Client } from "https://esm.sh/macadress";

Getting a key

vendor() needs no key. Everything else does. A free key (1,000 lookups a day) is instant at macadress.com/signup; see pricing for more.

Usage

Create a client

import { Client } from "macadress";

const macadress = new Client("mk_live_xxx");

// keyless: only vendor() will work
const anon = new Client();

// options (an object may be passed as the only argument too)
const configured = new Client("mk_live_xxx", {
  baseUri: "https://api.macadress.com", // change only for a self-hosted deployment
  timeout: 10_000,                      // milliseconds
  headers: { "X-Trace": "my-app" },
  fetch: myFetch,                       // inject a fetch implementation
});

vendor() - name only, no key

Resolves to the vendor string, or null when the address is valid but has no vendor to report (unregistered, private, or locally administered / randomized).

await macadress.vendor("00:03:93:AB:12:34");   // "Apple, Inc."
await macadress.vendor("02:1a:2b:3c:4d:5e");   // null

:, -, . and space grouping are all accepted; a bare 12-hex string works too.

lookup() - full analysis

const r = await macadress.lookup("3C:22:FB:12:34:56");

r.organization;              // string | null
r.isVendorLookupReliable;    // boolean  (false for a private block / LAA)
r.oui;                       // "3C:22:FB"
r.matchedPrefix;             // full matched block at its real width
r.blockType;                 // "MA-L" | "MA-M" | "MA-S" | "IAB" | "CID" | null
r.country;                   // "US" | null
r.administrationType;        // "universally_administered" | "locally_administered"
r.isPotentiallyRandomized;   // boolean
r.randomizationConfidence;   // "none" | "possible" | "likely"
r.eui64;                     // "3E:22:FB:FF:FE:12:34:56" | null
r.ipv6LinkLocal;             // "fe80::3e22:fbff:fe12:3456" | null
r.device.category;           // "unknown" (usually)
r.explanation;               // plain-English summary
r.databaseVersion;           // "2026-08-30" (UTC sync date)

Any field without a typed getter is still reachable:

r.get("vendor_location.city");   // dot path, undefined if absent
r.raw;                           // the decoded payload as given
JSON.stringify(r);               // the same payload back out

Enum values are plain strings; the exported objects give you named constants:

import { BlockType } from "macadress";
if (r.blockType === BlockType.MaL) { /* ... */ }

batch() - up to 100 at once

Results come back in input order; check each item for a per-entry error.

for (const item of await macadress.batch(["00:03:93:00:00:00", "3C:22:FB:00:00:00", "bad"])) {
  console.log(item.failed ? `${item.input} -> ERROR ${item.error}` : `${item.input} -> ${item.organization}`);
}

Throws TypeError (no request made) if the array is empty or has more than 100 entries.

searchVendors() - the directory

const result = await macadress.searchVendors("Cisco", { country: "US", limit: 20 });

result.total;   // total matches, ignoring the limit
for (const block of result) {
  console.log(`${block.blockType} ${block.organization} (${block.country})`);
}

health()

await macadress.health();   // boolean, keyless, uncounted

Errors

Every failure is an instance of MacadressError.

| Class | When | |---|---| | InvalidMacError | HTTP 400, the input did not parse | | AuthenticationError | HTTP 401, missing or invalid API key | | RateLimitError | HTTP 429, per-minute rate exceeded. .retryAfter (seconds) when sent | | QuotaExceededError | HTTP 429, billing-cycle quota spent. Subclass of RateLimitError | | ApiError | any other 4xx/5xx, or an unreadable response | | TransportError | never reached the API: DNS, connection, TLS, timeout. .cause holds the original | | ConfigurationError | bad client options (thrown before any request) |

Each carries .statusCode, .requestId and .responseBody where available.

import { Client, RateLimitError, MacadressError } from "macadress";

try {
  const r = await macadress.lookup(input);
} catch (error) {
  if (error instanceof RateLimitError) {
    await sleep((error.retryAfter ?? 5) * 1000);
  } else if (error instanceof MacadressError) {
    report(`macadress ${error.statusCode}: ${error.message} (${error.requestId})`);
  } else {
    throw error;
  }
}

Runtimes

The client calls the global fetch, Headers, URL and AbortSignal.timeout, so it runs unchanged on:

  • Node 18+ (fetch is built in)
  • Deno and Bun
  • Browsers, Cloudflare Workers, and other edge runtimes

On an older runtime, pass your own fetch through the fetch option.

Examples

Runnable scripts in examples/ (build first: npm run build):

node examples/01-vendor-name.mjs 00:03:93:AB:12:34
MACADRESS_API_KEY=mk_live_xxx node examples/02-full-lookup.mjs 3C:22:FB:00:00:00
MACADRESS_API_KEY=mk_live_xxx node examples/03-batch.mjs
MACADRESS_API_KEY=mk_live_xxx node examples/04-search-vendors.mjs Cisco US
deno run --allow-net examples/deno.ts 00:03:93:AB:12:34

Development

Contributing needs Node 22+ (the test run strips TypeScript types natively). The published bundle targets Node 18+.

npm install
npm run typecheck    # tsc --noEmit
npm test             # node --test
npm run build        # tsup -> dist/ (esm + cjs + d.ts)

The version lives in src/version.ts; keep package.json, jsr.json and the CHANGELOG heading in step with it on a release.

Links

License

MIT, see LICENSE. A product of ApisOS FZE.