Get ip location information.
npm install iplocation
const ipLocation = require("iplocation");
(async () => {
await ipLocation("172.217.167.78");
//=> { latitude: -33.8591, longitude: 151.2002, region: { name: "New South Wales" ... } ... }
})();
Type: string
The ipv4 address to get the information for.
Type: object
Type: string
An optional ipapi API key to use.
const ipLocation = require("iplocation");
(async () => {
await ipLocation("172.217.167.78", { apiKey: 'YOUR_API_KEY' });
//=> { latitude: -33.8591, longitude: 151.2002, region: { name: "New South Wales" ... } ... }
})();
iplocation currently uses ipapi for IP lookups. Their free API is limited to 1000 requests per day.
- iplocation-cli - CLI for this module.