node-iplocate

1.0.4 • Public • Published

IPLocate for Node.js

NPM Package Version NPM Package License NPM Package Downloads

Look up details about an IP address using the free IPLocate.io API:

  • IP geolocation data (IP to city, IP to country, IP to region, postal code, latitude, and longitude)
  • ASN details (ISP or network operator, associated domain name, and type, such as business, hosting, or company)
  • Privacy & threat data (VPN detection, proxy detection, iCloud Private Relay detection, spam and abuser detection)
  • Company data (the name and domain of the business that uses the IP address)

See what information we can provide for your IP address.

IPLocate.io provides 1,000 free requests per day with a free account. For higher plans and access to more data, check out API pricing.

Installation

npm install node-iplocate

Usage Example

const iplocate = require("node-iplocate");

iplocate("123.243.246.200").then(function(results) {
  console.log("IP Address: " + results.ip);
  console.log("Country: " + results.country + " (" + results.country_code + ")");
  console.log("Continent: " + results.continent);

  console.log(JSON.stringify(results, null, 2));
});

// Without an API key you can make 50 free requests per day.
// With a free API key from IPLocate.io, you can make 1,000 requests per day.
iplocate("123.243.246.200", { api_key: "abcdef" }).then(function(results) {
  // ...
});

IP Address: 123.243.246.200
Country: Australia (AU)
Continent: Australia

{
  "ip": "123.243.246.200",
  "country": "Australia",
  "country_code": "AU",
  "is_eu": false,
  "city": "Sydney",
  "continent": "Oceania",
  "latitude": -33.8672,
  "longitude": 151.1997,
  "time_zone": "Australia/Sydney",
  "postal_code": "2049",
  "subdivision": "New South Wales",
  "subdivision2": null,
  "network": "123.243.240.0/20",
  "asn": {
    "asn": "AS7545",
    "route": "123.243.246.0/24",
    "netname": "TPG-INTERNET-AP",
    "name": "TPG Telecom Limited",
    "country_code": "AU",
    "domain": "tpgtelecom.com.au",
    "type": "isp",
    "rir": "APNIC"
  },
  "privacy": {
    "is_abuser": false,
    "is_anonymous": false,
    "is_bogon": false,
    "is_datacenter": false,
    "is_icloud_relay": false,
    "is_proxy": false,
    "is_tor": false,
    "is_vpn": false
  },
  "company": {
    "name": "TPG Telecom",
    "domain": "www.tpgtelecom.com.au",
    "country_code": "AU",
    "type": "isp"
  },
  "abuse": {
    "address": "TPG Internet Pty Ltd., (Part of the Total Peripherals Group), 65 Waterloo Road, North Ryde NSW 2113",
    "email": "hostmaster@tpgtelecom.com.au",
    "name": "ABUSE TPGCOMAU",
    "network": "123.243.246.192 - 123.243.246.223",
    "phone": "+000000000"
  }
}

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

License

Distributed under the MIT License.

Package Sidebar

Install

npm i node-iplocate

Weekly Downloads

803

Version

1.0.4

License

MIT

Unpacked Size

15.4 kB

Total Files

7

Last publish

Collaborators

  • tallytarik