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

@trellisdigitalservices/ip-atlas

v0.1.1

Published

Official IP-Atlas API client — IP geolocation, ASN, VPN detection

Readme

@trellisdigitalservices/ip-atlas

Official Node.js / TypeScript client for the IP-Atlas API — IP geolocation, ASN lookup, VPN/proxy/datacenter detection, batch lookup, and account management.

Install

npm install @trellisdigitalservices/ip-atlas

Requires Node.js 18+. No runtime dependencies — uses the built-in fetch API.

Quickstart

Without an API key (free anonymous tier)

import { IPAtlas } from '@trellisdigitalservices/ip-atlas';

const client = new IPAtlas();

// Look up your own IP
const self = await client.lookupSelf();
console.log(self.country, self.org);

// Look up a specific IP (anonymous is limited to 60 req/min)
const result = await client.lookup('8.8.8.8');
console.log(result.asn, result.is_datacenter);

With an API key

import { IPAtlas } from '@trellisdigitalservices/ip-atlas';

const client = new IPAtlas({ apiKey: 'ipa_live_...' });

const result = await client.lookup('1.1.1.1');
console.log(result.country, result.city, result.org);

Batch lookup (up to 100 IPs)

import { IPAtlas } from '@trellisdigitalservices/ip-atlas';

const client = new IPAtlas({ apiKey: 'ipa_live_...' });

const batch = await client.lookupBatch(['8.8.8.8', '1.1.1.1', 'not-an-ip']);
for (const item of batch.results) {
  if ('error' in item) {
    console.error(`${item.ip}: ${item.error}`);
  } else {
    console.log(item.ip, item.country, item.org);
  }
}

Responses come back in the same order as the input list. Each element is either an IPResult (success) or a { ip, error } object for per-IP errors. Request-level failures (auth, quota) surface as thrown IPAtlasError instances.

Account management

const info = await client.account();
console.log(`Plan: ${info.plan}, used ${info.monthly_used}/${info.monthly_limit} this month`);

// Rotate the key (old one is revoked, new one returned once)
const { api_key } = await client.rotateKey();

Error handling

import { IPAtlas, IPAtlasError } from '@trellisdigitalservices/ip-atlas';

const client = new IPAtlas({ apiKey: 'ipa_live_...' });

try {
  const result = await client.lookup('not-an-ip');
} catch (err) {
  if (err instanceof IPAtlasError) {
    console.error(`API error ${err.status}:`, err.body);
  }
}

API

new IPAtlas(opts?)

| Option | Type | Default | Description | |-----------|----------|------------------------------|-------------------------------------| | apiKey | string | — | API key sent as X-API-Key header | | baseUrl | string | https://api.ip-atlas.io | Override the API base URL |

client.lookup(ip): Promise<IPResult>

Returns geolocation + ASN + threat data for the given IPv4 or IPv6 address.

client.lookupSelf(): Promise<IPResult>

Returns data for the caller's own IP address.

client.lookupBatch(ips): Promise<BatchResult>

Looks up up to 100 IPs in a single request. Returns { results: Array<IPResult | { ip, error }> } in the same order as the input list.

client.account(): Promise<AccountInfo>

Returns the plan, key prefix, daily/monthly usage, and Stripe linkage for the bound API key.

client.rotateKey(): Promise<{ api_key, key_prefix }>

Revokes the current key and issues a replacement with the same plan. The new plaintext key is only returned once.

Links