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

1lookup

v0.1.0

Published

Official Node.js client for the 1Lookup API: phone validation, carrier and line type, HLR, caller name (CNAM), reverse phone and email lookup, email verification, IP lookup and DNC scrub.

Downloads

404

Readme

1lookup

Official Node.js client for the 1Lookup API: phone validation, carrier and line type, HLR lookup, caller name (CNAM), reverse phone and reverse email lookup, email verification, IP lookup and Do Not Call scrub.

  • One API key and one shared credit balance for every endpoint.
  • Typed results and typed errors (TypeScript types included).
  • Zero runtime dependencies. Uses the built-in fetch (Node 18 or newer).
  • ESM and CommonJS.

Full API reference: https://app.1lookup.io/api Pricing: https://www.1lookup.io/pricing

Install

npm install 1lookup

Create an API key at https://app.1lookup.io/api-keys and keep it on your server. Never ship it to a browser.

import { OneLookup } from "1lookup";
// CommonJS: const { OneLookup } = require("1lookup");

const client = new OneLookup({ apiKey: process.env.ONELOOKUP_API_KEY });

If you leave out apiKey, the client reads the ONELOOKUP_API_KEY environment variable.

Examples

1. Validate a phone number (line type and carrier)

const phone = await client.validatePhone("+14155552671");

console.log(phone.classification.line_type);          // e.g. "MOBILE"
console.log(phone.classification.number_status);      // e.g. "ACTIVE"
console.log(phone.insights.raw_api_fields?.network);  // carrier name
console.log(phone.insights.reachability?.is_reachable);

2. Verify an email address

const email = await client.verifyEmail("[email protected]");

if (email.classification.deliverability_status === "DELIVERABLE") {
  // safe to send
}
console.log(email.risk_assessment?.risk_factors); // e.g. ["ROLE_BASED_EMAIL"]

3. HLR lookup (live mobile network status)

const hlr = await client.hlrLookup("+447700900123");

console.log(hlr.classification.connectivity_status);   // CONNECTED, ABSENT, INVALID_MSISDN or UNDETERMINED
console.log(hlr.insights.hlr_result.current_carrier);

4. Check Do Not Call, then look up the caller name (CNAM)

const scrub = await client.scrubPhone("+14155552671");

if (!scrub.classification.doNotCall && !scrub.classification.litigator) {
  const cnam = await client.cnamLookup("+14155552671");
  if (cnam.classification.matched) {
    console.log(cnam.classification.primary_name);
  }
}

5. Look up an IP address

const ip = await client.lookupIp("8.8.8.8");

console.log(ip.insights.location?.country_code);
console.log(ip.classification.connection_type);
console.log(ip.risk_assessment?.fraud_score);

Methods

Every lookup method returns the response's data object. Results come from a 7-day cache when the same lookup ran recently; pass { bypassCache: true } to force a fresh lookup (it spends credits even when a cached result exists).

| Method | Endpoint | Returns | |---|---|---| | validatePhone(phone) | POST /phone | Line type, carrier, location, reachability, porting, DNC/DNO flags | | carrierLookup(phone) | POST /phone | Same call as validatePhone; carrier name in insights.raw_api_fields.network | | lineType(phone) | POST /nt-lookup | Mobile, landline, VoIP or other, plus validity | | hlrLookup(phone) | POST /hlr-lookup | Live subscriber status, roaming state and network | | mnpLookup(phone) | POST /mnp-lookup | The network a number was ported to | | reversePhone(phone, { lookupSource }) | POST /reverse-phone-lookup | Person or business behind a number ("standard" or "premium") | | cnamLookup(phone) | POST /reverse-phone-lookup | Caller name from caller ID records (lookup_source: "standard") | | scrubPhone(phone) | POST /phone-scrub | Do Not Call and known-litigator check | | phoneSpam(phone) | POST /phone-spam | Spam or fraud history | | verifyEmail(email) | POST /email | Deliverability; disposable, role-based and risky flags | | reverseEmail(email) | POST /reverse-email-append | Person and company behind an email address | | lookupIp(ip) | POST /ip | Geolocation, connection type, proxy, VPN, Tor and datacenter flags | | getAccount() | GET /account | Plan, credit balance and usage (spends no credits) | | request(method, path, body?) | any | Any other endpoint in the API reference |

What each lookup costs: see pricing.

Any other endpoint

const age = await client.request("POST", "/domain-age", { domain: "example.com" });

Errors and retries

Failed calls throw a subclass of OneLookupError with status, code (the API's error code), message, requestId and, when the API sends it, retryAfter in seconds.

import { InsufficientCreditsError, RateLimitError, AuthenticationError } from "1lookup";

try {
  await client.validatePhone("+14155552671");
} catch (err) {
  if (err instanceof InsufficientCreditsError) {
    // 402: out of credits, see https://www.1lookup.io/pricing
  } else if (err instanceof RateLimitError) {
    // 429: wait err.retryAfter seconds
  } else if (err instanceof AuthenticationError) {
    // 401: check the API key
  } else {
    throw err;
  }
}

| Status | Class | |---|---| | 400 | BadRequestError | | 401 | AuthenticationError | | 402 | InsufficientCreditsError | | 403 | PermissionDeniedError | | 429 | RateLimitError (also has rateLimit.limit, .remaining, .reset) | | 503 | ServiceUnavailableError | | other 5xx | ServerError | | no answer | APIConnectionError, APITimeoutError |

The client retries 429 and 503 answers up to 2 times, waiting for Retry-After. Nothing else is retried. Change it with maxRetries (0 turns retries off) and maxRetryDelayMs (a Retry-After longer than this is thrown to you instead of waited on).

const client = new OneLookup({
  apiKey: process.env.ONELOOKUP_API_KEY,
  timeoutMs: 30_000,   // per request, default 60000
  maxRetries: 2,
  maxRetryDelayMs: 20_000,
});

AI agents

Agents can also call 1Lookup over the hosted MCP server at https://app.1lookup.io/api/mcp instead of REST.

License

MIT