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-api-io

v1.0.0

Published

Official JavaScript/TypeScript client for ip-api.io — IP geolocation, email validation, fraud detection and risk scoring API

Readme

ip-api-io — Official JavaScript/TypeScript client for ip-api.io

npm test License: MIT

The official JavaScript/TypeScript client for the ip-api.io IP intelligence platform. One typed, zero-dependency client covers IP geolocation, email validation and verification (syntax, MX, SMTP deliverability), fraud detection and risk scoring, VPN/proxy/Tor detection, disposable email detection, ASN lookup, WHOIS, reverse DNS, MX records and domain age.

Built on the global fetch (Node ≥18, Deno, Bun and browsers) — zero dependencies, fully typed, ESM + CJS.

Install

npm install ip-api-io

Quickstart

import { IpApiClient } from "ip-api-io";

const client = new IpApiClient({ apiKey: "YOUR_API_KEY" }); // free key at https://ip-api.io

// Where is this IP, and is it risky?
const info = await client.lookup("8.8.8.8");
console.log(info.location.country);            // "United States"
console.log(info.suspicious_factors.is_vpn);   // false

const risk = await client.riskScore("8.8.8.8");
console.log(risk.score, risk.risk_level);      // 0 "low"

const email = await client.validateEmail("[email protected]");
console.log(email.reachable, email.disposable); // "yes" false

An API key is required — the API rejects keyless requests with 401. Sign up at ip-api.io for a free key.

Documentation

Each guide below documents the methods for one capability, with runnable examples and a link to the matching ip-api.io product page:

Methods

Every method maps to one ip-api.io endpoint and its product page:

| Method | Endpoint | Product page | |---|---|---| | lookup(ip?) | GET /api/v1/ip[/{ip}] | IP geolocation | | lookupBatch(ips) | POST /api/v1/ip/batch (≤100 IPs) | Bulk IP lookup | | emailInfo(email) | GET /api/v1/email/{email} | Email validation | | validateEmail(email) | GET /api/v1/email/advanced/{email} | Advanced email validation | | validateEmailBatch(emails) | POST /api/v1/email/advanced/batch (≤100) | Email list cleaning | | riskScore(ip?) | GET /api/v1/risk-score[/{ip}] | Risk score | | emailRiskScore(email) | GET /api/v1/risk-score/email/{email} | Fraud detection | | ipReputation(ip) | GET /api/v1/ip-reputation/{ip} | IP reputation | | torCheck(ip) | GET /api/v1/tor/{ip} | Tor detection | | asn(ip) | GET /api/v1/asn/{ip} | ASN lookup | | whois(domain) | GET /api/v1/dns/whois/{domain} | WHOIS lookup | | reverseDns(ip) | GET /api/v1/dns/reverse/{ip} | Reverse DNS | | forwardDns(hostname) | GET /api/v1/dns/forward/{hostname} | — | | mxRecords(domain) | GET /api/v1/dns/mx/{domain} | MX record lookup | | domainAge(domain) | GET /api/v1/domain/age/{domain} | Domain age checker | | domainAgeBatch(domains) | POST /api/v1/domain/age/batch | Domain age checker | | rateLimit() | GET /api/v1/ratelimit | — | | usageSummary() | GET /api/v1/usage/summary | — |

All responses are fully typed (IpInfo, RiskScore, AdvancedEmailValidation, …) and exported from the package.

Error handling

The client throws typed errors and never retries — on 429, RateLimitError.reset tells you when your quota renews:

import { IpApiClient, RateLimitError, AuthenticationError } from "ip-api-io";

const client = new IpApiClient({ apiKey: "YOUR_API_KEY" });
try {
  await client.lookup("8.8.8.8");
} catch (error) {
  if (error instanceof RateLimitError) {
    console.log(`limit=${error.limit} remaining=${error.remaining} resetsAt=${error.reset}`);
  } else if (error instanceof AuthenticationError) {
    console.log("invalid API key");
  }
}

See docs/error-handling.md for the full error taxonomy.

Links

  • Website: https://ip-api.io
  • API reference: https://ip-api.io/api-docs.html
  • OpenAPI spec: https://ip-api.io/openapi.json
  • Get a free API key: https://ip-api.io

ip-api-io is the official client for ip-api.io. It is not affiliated with ip-api.com or ipapi.com.