This Node.js module provides a fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, station name, mcc, mnc, mobile brand, elevation, and usage type from IP address by using IP2Location database. This module uses a file based database available at IP2Location.com. This database simply contains IP blocks as keys, and other information such as country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, station name, mcc, mnc, mobile brand, elevation, and usage type as values. It supports both IP address in IPv4 and IPv6.
This module can be used in many types of projects such as:
- select the geographically closest mirror
- analyze your web server logs to determine the countries of your visitors
- credit card fraud detection
- software export controls
- display native language and currency
- prevent password sharing and abuse of service
- geotargeting in advertisement
The database will be updated in monthly basis for the greater accuracy. Free sample DB1 database is available at /samples directory or download it from http://www.ip2location.com/developers.htm.
The complete database is available at http://www.ip2location.com under Premium subscription package.
To install this module type the following:
npm install ip2location-nodejs
This library requires IP2Location BIN data file to function. You may download the BIN data file at
- IP2Location LITE BIN Data (Free): http://lite.ip2location.com
- IP2Location Commercial BIN Data (Comprehensive): http://www.ip2location.com
Use the IPv4 BIN file if you just need to query IPv4 addresses. If you query an IPv6 address using the IPv4 BIN, you'll see the IPV6_NOT_SUPPORTED error.
Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.
Copyright (C) 2017 by IP2Location.com
Licensed under MIT