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

ip-finder-client

v1.0.19

Published

Lightweight SDK for IP geolocation, ASN lookup, and network information

Downloads

1,616

Readme

ip-finder-client

A lightweight, zero-dependency Node.js SDK for IP geolocation, ASN lookup, and network information.

Get Your API Key

Get your free API key at ipwhere.site

Installation

npm install ip-finder-client
yarn add ip-finder-client
pnpm add ip-finder-client

Quick Start

import { IPInsight } from 'ip-finder-client';

const client = new IPInsight({
  apiKey: 'your-api-key'
});

// Look up an IP address
const result = await client.lookup('8.8.8.8');

console.log(result.location?.country);  // "US"
console.log(result.location?.city);     // "Mountain View"
console.log(result.isp?.organization);  // "GOOGLE"
console.log(result.isp?.asn);           // "AS15169"

Configuration

const client = new IPInsight({
  // Required: Your API key
  apiKey: 'your-api-key',

  // Optional: Request timeout in ms (default: 10000)
  timeout: 5000,

  // Optional: Number of retries for failed requests (default: 2)
  retries: 3,
});

API Reference

lookup(ip: string): Promise<IPLookupResult>

Look up information for a single IP address.

const result = await client.lookup('8.8.8.8');

// Result structure:
{
  ip: '8.8.8.8',
  ipDetails: { version: 4, decimal: '134744072', hex: '08080808' },
  location: {
    city: 'Mountain View',
    region: 'California',
    country: 'US',
    timezone: 'America/Los_Angeles',
    coordinates: { latitude: 37.422, longitude: -122.085 },
    maps: { search: '...', place: '...', directions: '...' }
  },
  isp: {
    organization: 'GOOGLE',
    asn: 'AS15169',
    domain: 'google.com',
    connectionType: 'Cable/DSL'
  },
  network: {
    cidr: '8.8.8.0/24',
    rir: 'ARIN',
    status: 'allocated'
  },
  cloud: { isCloud: false }
}

lookupBatch(ips: string[]): Promise<(IPLookupResult | IPInsightError)[]>

Look up multiple IP addresses in parallel.

const results = await client.lookupBatch(['8.8.8.8', '1.1.1.1', '9.9.9.9']);

results.forEach(result => {
  if (result instanceof IPInsightError) {
    console.error(`Error: ${result.message}`);
  } else {
    console.log(`${result.ip}: ${result.location?.country}`);
  }
});

healthCheck(): Promise<boolean>

Check if the API is healthy and reachable.

const isHealthy = await client.healthCheck();
console.log(isHealthy ? 'API is up!' : 'API is down');

Rate Limiting

Rate limit information is available after each request:

await client.lookup('8.8.8.8');

console.log(client.rateLimit);
// { limit: 1000, remaining: 999, reset: 1703980800 }

Error Handling

import { IPInsight, IPInsightError } from 'ip-finder-client';

try {
  const result = await client.lookup('invalid-ip');
} catch (error) {
  if (error instanceof IPInsightError) {
    console.error(`API Error: ${error.message}`);
    console.error(`Status Code: ${error.statusCode}`);
    console.error(`Error Code: ${error.code}`);
  }
}

Error Codes

| Code | Description | |------|-------------| | TIMEOUT | Request timed out | | NETWORK_ERROR | Network connectivity issue | | BATCH_ERROR | Error during batch lookup |

HTTP Status Codes

| Status | Description | |--------|-------------| | 400 | Invalid IP address format | | 401 | Invalid or missing API key | | 404 | IP not found in database | | 429 | Rate limit exceeded | | 500 | Server error |

CommonJS Usage

const { IPInsight } = require('ip-finder-client');

const client = new IPInsight({ apiKey: 'your-api-key' });

Factory Function

Alternatively, use the factory function:

import { createClient } from 'ip-finder-client';

const client = createClient({
  apiKey: 'your-api-key'
});

TypeScript Support

Full TypeScript support with exported types:

import type {
  IPFinderConfig,
  IPLookupResult,
  Location,
  ISP,
  Network,
  RateLimitInfo
} from 'ip-finder-client';

Requirements

  • Node.js 18+ (uses native fetch)

License

MIT