@ipls/ipls
v1.0.1
Published
Unofficial IP.LS client — IP geolocation & network lookup in one call (https://ip.ls)
Maintainers
Readme
@ipls/ipls
Unofficial IP.LS client for Node.js — IP geolocation & network lookup in one call.
npm install @ipls/iplsUsage
import { lookup, self } from '@ipls/ipls';
await lookup('8.8.8.8');
// {
// ip: "8.8.8.8",
// city: "Mountain View",
// region: "California",
// country: "US",
// loc: "37.4220,-122.0850",
// org: "AS15169 Google LLC",
// postal: "",
// timezone: "",
// continent: "NA"
// }
await self(); // info about the caller's own public IPSupports IPv4 and IPv6. Requires Node.js >= 18 (built-in fetch).
API
lookup(ip): Promise<IpInfo>
Look up an IP address. Rejects with TypeError for invalid IPs, or Error on HTTP failures.
self(): Promise<IpInfo>
Look up the caller's own public IP address.
ip.ls
ip.ls is a free IP address lookup service.
Just like the Linux ls command — curl ip.ls lists IP contents.
No API key, no sign-up, no tracking.
curl ip.ls # your public IP
curl ip.ls/8.8.8.8 # JSON info for any IP
curl ip.ls/city # single field as plain textLicense
MIT
