You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

get-ip-location-lite

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-ip-location-lite

Fetches IP address geolocation data using ip-api.com (no API key required)

1.0.1
latest
npmnpm
Version published
Weekly downloads
3
200%
Maintainers
1
Weekly downloads
 
Created
Source

🌍 get-ip-location-lite

Lightweight utility to fetch geolocation data (country, city, ISP, coordinates, etc.) from an IP address using the ipwho.is API.

No API key required. Works with HTTPS.

📦 Installation

Using npm

npm install get-ip-location-lite

Using yarn

yarn add get-ip-location-lite

🚀 Usage

const getIPLocation = require("get-ip-location-lite");

// Get the location of the current user's IP
getIPLocation()
  .then(data => console.log("Your IP Location:", data))
  .catch(err => console.error("Error:", err));

// OR get location info for a specific IP
getIPLocation("8.8.8.8")
  .then(data => console.log("Google DNS IP Location:", data))
  .catch(err => console.error("Error:", err));

⚙️ Options

No options object required.

ParameterTypeRequiredDescription
ipstringIP address to lookup (leave blank for current IP)

📤 Output Example

{
  "ip": "8.8.8.8",
  "success": true,
  "country": "United States",
  "city": "Mountain View",
  "region": "California",
  "latitude": 37.386,
  "longitude": -122.0838,
  "isp": "Google LLC"
}

Powered by ipwho.is

🧪 Run Test

node test.js

🪪 License

MIT

Keywords

ip

FAQs

Package last updated on 28 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts